Implement Heartlink

This commit is contained in:
Melledy committed 2025-11-11 23:47:07 -08:00
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);
}
}