2022-04-17 12:43:07 +00:00
|
|
|
package emu.grasscutter.server.packet.send;
|
|
|
|
|
|
|
|
import emu.grasscutter.game.GenshinPlayer;
|
|
|
|
import emu.grasscutter.net.packet.GenshinPacket;
|
|
|
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
|
|
|
import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo;
|
|
|
|
import emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify;
|
|
|
|
import emu.grasscutter.net.proto.SystemHintOuterClass.SystemHint;
|
|
|
|
|
|
|
|
public class PacketPlayerChatNotify extends GenshinPacket {
|
|
|
|
|
|
|
|
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, String message) {
|
|
|
|
super(PacketOpcodes.PlayerChatNotify);
|
|
|
|
|
|
|
|
ChatInfo info = ChatInfo.newBuilder()
|
|
|
|
.setTime((int) (System.currentTimeMillis() / 1000))
|
2022-04-19 09:22:21 +00:00
|
|
|
.setUid(sender.getUid())
|
2022-04-17 12:43:07 +00:00
|
|
|
.setText(message)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
|
|
|
.setChannelId(channelId)
|
|
|
|
.setChatInfo(info)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
this.setData(proto);
|
|
|
|
}
|
|
|
|
|
|
|
|
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, int emote) {
|
|
|
|
super(PacketOpcodes.PlayerChatNotify);
|
|
|
|
|
|
|
|
ChatInfo info = ChatInfo.newBuilder()
|
|
|
|
.setTime((int) (System.currentTimeMillis() / 1000))
|
2022-04-19 09:22:21 +00:00
|
|
|
.setUid(sender.getUid())
|
2022-04-17 12:43:07 +00:00
|
|
|
.setIcon(emote)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
|
|
|
.setChannelId(channelId)
|
|
|
|
.setChatInfo(info)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
this.setData(proto);
|
|
|
|
}
|
|
|
|
|
|
|
|
public PacketPlayerChatNotify(GenshinPlayer sender, int channelId, SystemHint systemHint) {
|
|
|
|
super(PacketOpcodes.PlayerChatNotify);
|
|
|
|
|
|
|
|
ChatInfo info = ChatInfo.newBuilder()
|
|
|
|
.setTime((int) (System.currentTimeMillis() / 1000))
|
2022-04-19 09:22:21 +00:00
|
|
|
.setUid(sender.getUid())
|
2022-04-17 12:43:07 +00:00
|
|
|
.setSystemHint(systemHint)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
|
|
|
.setChannelId(channelId)
|
|
|
|
.setChatInfo(info)
|
|
|
|
.build();
|
|
|
|
|
|
|
|
this.setData(proto);
|
|
|
|
}
|
|
|
|
}
|