mirror of
https://github.com/Melledy/Nebula.git
synced 2026-11-04 21:36:51 +01:00
Implement Heartlink
This commit is contained in:
1 parent
080d345981
commit
d4a7aa0320
11 files changed
+366
-6
No files matched your search
@@ -2,6 +2,7 @@ package emu.nebula.server.handlers;
|
||||
|
||||
import emu.nebula.net.NetHandler;
|
||||
import emu.nebula.net.NetMsgId;
|
||||
import emu.nebula.proto.PhoneContactsInfo.PhoneContactsInfoResp;
|
||||
import emu.nebula.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@@ -10,7 +11,15 @@ public class HandlerPhoneContactsInfoReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
return session.encodeMsg(NetMsgId.phone_contacts_info_succeed_ack);
|
||||
// Build response
|
||||
var rsp = PhoneContactsInfoResp.newInstance();
|
||||
|
||||
for (var character : session.getPlayer().getCharacters().getCharacterCollection()) {
|
||||
rsp.addList(character.getContact().toProto());
|
||||
}
|
||||
|
||||
// Encode and send
|
||||
return session.encodeMsg(NetMsgId.phone_contacts_info_succeed_ack, rsp);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user