Clone response when getting friends list

This is so we dont add nextpackages to our cached proto
This commit is contained in:
Melledy
2025-11-14 07:55:06 -08:00
parent 9c5eb2c637
commit 484ca84e00

View File

@@ -10,8 +10,11 @@ public class HandlerFriendListGetReq extends NetHandler {
@Override
public byte[] handle(GameSession session, byte[] message) throws Exception {
// Build response
var rsp = session.getPlayer().getFriendList().toProto();
// Get cached friends list proto
var proto = session.getPlayer().getFriendList().toProto();
// Clone response from cached proto
var rsp = proto.clone();
// Encode and send
return session.encodeMsg(NetMsgId.friend_list_get_succeed_ack, rsp);