mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-12-05 03:03:31 +00:00
8abd3ace6c
Co-Authored-By: ShigemoriHakura <62388797+ShigemoriHakura@users.noreply.github.com> Co-Authored-By: KanyeWestc <104547412+KanyeWestc@users.noreply.github.com> Co-Authored-By: QAQ 天小络 <72185326+XTL676@users.noreply.github.com> Co-Authored-By: nkxingxh <25559053+nkxingxh@users.noreply.github.com> Co-Authored-By: Yazawazi <47273265+Yazawazi@users.noreply.github.com> Co-Authored-By: wuwuwu223 <81224214+wuwuwu223@users.noreply.github.com> Co-Authored-By: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Co-Authored-By: Sakura <104815797+Sakura@users.noreply.github.com> Co-Authored-By: NewNeko-2022 <104819344+NewNeko-2022@users.noreply.github.com> Co-Authored-By: JimWails <30657653+JimWails@users.noreply.github.com> Co-Authored-By: buttercookies <19878609+ButterCookies@users.noreply.github.com>
30 lines
1.3 KiB
Java
30 lines
1.3 KiB
Java
package emu.grasscutter.server.packet.send;
|
|
|
|
import emu.grasscutter.game.expedition.ExpeditionInfo;
|
|
import emu.grasscutter.game.player.Player;
|
|
import emu.grasscutter.net.packet.BasePacket;
|
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
|
import emu.grasscutter.net.proto.AvatarExpeditionDataNotifyOuterClass.AvatarExpeditionDataNotify;
|
|
import emu.grasscutter.net.proto.AvatarExpeditionInfoOuterClass.AvatarExpeditionInfo;
|
|
|
|
import java.util.*;
|
|
|
|
public class PacketAvatarExpeditionDataNotify extends BasePacket {
|
|
public PacketAvatarExpeditionDataNotify(Player player) {
|
|
super(PacketOpcodes.AvatarExpeditionDataNotify);
|
|
|
|
Map<Long, AvatarExpeditionInfo> avatarExpeditionInfoList = new HashMap<Long, AvatarExpeditionInfo>();
|
|
|
|
var expeditionInfo = player.getExpeditionInfo();
|
|
for (Long key : player.getExpeditionInfo().keySet()) {
|
|
ExpeditionInfo e = expeditionInfo.get(key);
|
|
avatarExpeditionInfoList.put(key, AvatarExpeditionInfo.newBuilder().setStateValue(e.getState()).setExpId(e.getExpId()).setHourTime(e.getHourTime()).setStartTime(e.getStartTime()).build());
|
|
};
|
|
|
|
AvatarExpeditionDataNotify.Builder proto = AvatarExpeditionDataNotify.newBuilder()
|
|
.putAllExpeditionInfoMap(avatarExpeditionInfoList);
|
|
|
|
this.setData(proto.build());
|
|
}
|
|
}
|