Fix friend request pending list

This commit is contained in:
zhaodice 2022-06-17 14:34:30 +08:00 committed by Melledy
parent ac3214f10a
commit 0b672f9a17
2 changed files with 16 additions and 9 deletions

View File

@ -0,0 +1,15 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketGetPlayerAskFriendListRsp;
@Opcodes(PacketOpcodes.GetPlayerAskFriendListReq)
public class HandlerGetPlayerAskFriendListReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
session.send(new PacketGetPlayerAskFriendListRsp(session.getPlayer()));
}
}

View File

@ -39,15 +39,7 @@ public class PacketGetPlayerFriendListRsp extends BasePacket {
for (Friendship friendship : player.getFriendsList().getFriends().values()) {
proto.addFriendList(friendship.toProto());
}
for (Friendship friendship : player.getFriendsList().getPendingFriends().values()) {
if (friendship.getAskerId() == player.getUid()) {
continue;
}
proto.addAskFriendList(friendship.toProto());
}
this.setData(proto);
}
}