mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 10:55:08 +01:00
Move player mail to MailHandler class
This is so we dont have to save the entire player to the db every time we send mail
This commit is contained in:
@@ -13,17 +13,10 @@ public class PacketDelMailRsp extends BasePacket {
|
||||
public PacketDelMailRsp(Player player, List<Integer> toDeleteIds) {
|
||||
super(PacketOpcodes.DelMailRsp);
|
||||
|
||||
DelMailRsp.Builder proto = DelMailRsp.newBuilder();
|
||||
|
||||
List<Integer> deletedIds = new ArrayList<>();
|
||||
|
||||
for(int mailId : toDeleteIds) {
|
||||
if(player.deleteMail(mailId)) {
|
||||
deletedIds.add(mailId);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData(proto.build());
|
||||
player.getSession().send(new PacketMailChangeNotify(player, null, deletedIds));
|
||||
DelMailRsp proto = DelMailRsp.newBuilder()
|
||||
.addAllMailIdList(toDeleteIds)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user