mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-02-14 00:32:52 +08:00
Fix whitespace [skip actions]
This commit is contained in:
parent
8a5a6ab83e
commit
5287882f45
@ -5,34 +5,34 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ResourceType {
|
||||
|
||||
/** Names of the file that this Resource loads from */
|
||||
String[] name();
|
||||
|
||||
/** Load priority - dictates which order to load this resource, with "highest" being loaded first */
|
||||
LoadPriority loadPriority() default LoadPriority.NORMAL;
|
||||
|
||||
public enum LoadPriority {
|
||||
HIGHEST (4),
|
||||
HIGH (3),
|
||||
NORMAL (2),
|
||||
LOW (1),
|
||||
LOWEST (0);
|
||||
/** Names of the file that this Resource loads from */
|
||||
String[] name();
|
||||
|
||||
private final int value;
|
||||
|
||||
LoadPriority(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return value;
|
||||
}
|
||||
/** Load priority - dictates which order to load this resource, with "highest" being loaded first */
|
||||
LoadPriority loadPriority() default LoadPriority.NORMAL;
|
||||
|
||||
public enum LoadPriority {
|
||||
HIGHEST (4),
|
||||
HIGH (3),
|
||||
NORMAL (2),
|
||||
LOW (1),
|
||||
LOWEST (0);
|
||||
|
||||
private final int value;
|
||||
|
||||
LoadPriority(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static List<LoadPriority> getInOrder() {
|
||||
return Stream.of(LoadPriority.values()).sorted((x, y) -> y.value() - x.value()).toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,12 +32,12 @@ public class MusicGameBeatmap {
|
||||
|
||||
List<List<BeatmapNote>> beatmap;
|
||||
|
||||
public static MusicGameBeatmap getByShareId(long musicShareId){
|
||||
public static MusicGameBeatmap getByShareId(long musicShareId) {
|
||||
return DatabaseHelper.getMusicGameBeatmap(musicShareId);
|
||||
}
|
||||
|
||||
public void save(){
|
||||
if(musicShareId == 0){
|
||||
public void save() {
|
||||
if (musicShareId == 0) {
|
||||
musicShareId = new Random().nextLong(100000000000000L,999999999999999L);
|
||||
}
|
||||
DatabaseHelper.saveMusicGameBeatmap(this);
|
||||
@ -51,7 +51,7 @@ public class MusicGameBeatmap {
|
||||
.toList();
|
||||
}
|
||||
|
||||
public UgcMusicRecordOuterClass.UgcMusicRecord toProto(){
|
||||
public UgcMusicRecordOuterClass.UgcMusicRecord toProto() {
|
||||
return UgcMusicRecordOuterClass.UgcMusicRecord.newBuilder()
|
||||
.setMusicId(musicId)
|
||||
.addAllMusicTrackList(beatmap.stream()
|
||||
@ -60,7 +60,7 @@ public class MusicGameBeatmap {
|
||||
.build();
|
||||
}
|
||||
|
||||
public UgcMusicBriefInfoOuterClass.UgcMusicBriefInfo.Builder toBriefProto(){
|
||||
public UgcMusicBriefInfoOuterClass.UgcMusicBriefInfo.Builder toBriefProto() {
|
||||
var player = DatabaseHelper.getPlayerByUid(authorUid);
|
||||
|
||||
return UgcMusicBriefInfoOuterClass.UgcMusicBriefInfo.newBuilder()
|
||||
@ -73,7 +73,7 @@ public class MusicGameBeatmap {
|
||||
.setVersion(1);
|
||||
}
|
||||
|
||||
private UgcMusicTrackOuterClass.UgcMusicTrack musicBeatmapListToProto(List<BeatmapNote> beatmapNoteList){
|
||||
private UgcMusicTrackOuterClass.UgcMusicTrack musicBeatmapListToProto(List<BeatmapNote> beatmapNoteList) {
|
||||
return UgcMusicTrackOuterClass.UgcMusicTrack.newBuilder()
|
||||
.addAllMusicNoteList(beatmapNoteList.stream()
|
||||
.map(BeatmapNote::toProto)
|
||||
@ -89,14 +89,14 @@ public class MusicGameBeatmap {
|
||||
int startTime;
|
||||
int endTime;
|
||||
|
||||
public static BeatmapNote parse(UgcMusicNoteOuterClass.UgcMusicNote note){
|
||||
public static BeatmapNote parse(UgcMusicNoteOuterClass.UgcMusicNote note) {
|
||||
return BeatmapNote.of()
|
||||
.startTime(note.getStartTime())
|
||||
.endTime(note.getEndTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
public UgcMusicNoteOuterClass.UgcMusicNote toProto(){
|
||||
public UgcMusicNoteOuterClass.UgcMusicNote toProto() {
|
||||
return UgcMusicNoteOuterClass.UgcMusicNote.newBuilder()
|
||||
.setStartTime(startTime)
|
||||
.setEndTime(endTime)
|
||||
|
@ -12,98 +12,98 @@ import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
|
||||
|
||||
@Entity(value = "friendships", useDiscriminator = false)
|
||||
public class Friendship {
|
||||
@Id private ObjectId id;
|
||||
@Id private ObjectId id;
|
||||
|
||||
@Transient private Player owner;
|
||||
@Transient private Player owner;
|
||||
|
||||
@Indexed private int ownerId;
|
||||
@Indexed private int friendId;
|
||||
private boolean isFriend;
|
||||
private int askerId;
|
||||
@Indexed private int ownerId;
|
||||
@Indexed private int friendId;
|
||||
private boolean isFriend;
|
||||
private int askerId;
|
||||
|
||||
private PlayerProfile profile;
|
||||
private PlayerProfile profile;
|
||||
|
||||
@Deprecated // Morphia use only
|
||||
public Friendship() { }
|
||||
@Deprecated // Morphia use only
|
||||
public Friendship() { }
|
||||
|
||||
public Friendship(Player owner, Player friend, Player asker) {
|
||||
this.setOwner(owner);
|
||||
this.ownerId = owner.getUid();
|
||||
this.friendId = friend.getUid();
|
||||
this.profile = friend.getProfile();
|
||||
this.askerId = asker.getUid();
|
||||
}
|
||||
public Friendship(Player owner, Player friend, Player asker) {
|
||||
this.setOwner(owner);
|
||||
this.ownerId = owner.getUid();
|
||||
this.friendId = friend.getUid();
|
||||
this.profile = friend.getProfile();
|
||||
this.askerId = asker.getUid();
|
||||
}
|
||||
|
||||
public Player getOwner() {
|
||||
return owner;
|
||||
}
|
||||
public Player getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(Player owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
public void setOwner(Player owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public boolean isFriend() {
|
||||
return isFriend;
|
||||
}
|
||||
public boolean isFriend() {
|
||||
return isFriend;
|
||||
}
|
||||
|
||||
public void setIsFriend(boolean b) {
|
||||
this.isFriend = b;
|
||||
}
|
||||
public void setIsFriend(boolean b) {
|
||||
this.isFriend = b;
|
||||
}
|
||||
|
||||
public int getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
public int getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public int getFriendId() {
|
||||
return friendId;
|
||||
}
|
||||
public int getFriendId() {
|
||||
return friendId;
|
||||
}
|
||||
|
||||
public int getAskerId() {
|
||||
return askerId;
|
||||
}
|
||||
public int getAskerId() {
|
||||
return askerId;
|
||||
}
|
||||
|
||||
public void setAskerId(int askerId) {
|
||||
this.askerId = askerId;
|
||||
}
|
||||
public void setAskerId(int askerId) {
|
||||
this.askerId = askerId;
|
||||
}
|
||||
|
||||
public PlayerProfile getFriendProfile() {
|
||||
return profile;
|
||||
}
|
||||
public PlayerProfile getFriendProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setFriendProfile(Player character) {
|
||||
if (character == null || this.friendId != character.getUid()) return;
|
||||
this.profile = character.getProfile();
|
||||
}
|
||||
public void setFriendProfile(Player character) {
|
||||
if (character == null || this.friendId != character.getUid()) return;
|
||||
this.profile = character.getProfile();
|
||||
}
|
||||
|
||||
public boolean isOnline() {
|
||||
return getFriendProfile().getPlayer() != null;
|
||||
}
|
||||
public boolean isOnline() {
|
||||
return getFriendProfile().getPlayer() != null;
|
||||
}
|
||||
|
||||
public void save() {
|
||||
DatabaseHelper.saveFriendship(this);
|
||||
}
|
||||
public void save() {
|
||||
DatabaseHelper.saveFriendship(this);
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
DatabaseHelper.deleteFriendship(this);
|
||||
}
|
||||
public void delete() {
|
||||
DatabaseHelper.deleteFriendship(this);
|
||||
}
|
||||
|
||||
public FriendBrief toProto() {
|
||||
FriendBrief proto = FriendBrief.newBuilder()
|
||||
.setUid(getFriendProfile().getUid())
|
||||
.setNickname(getFriendProfile().getName())
|
||||
.setLevel(getFriendProfile().getPlayerLevel())
|
||||
.setProfilePicture(ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId()))
|
||||
.setWorldLevel(getFriendProfile().getWorldLevel())
|
||||
.setSignature(getFriendProfile().getSignature())
|
||||
.setOnlineState(getFriendProfile().isOnline() ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE : FriendOnlineState.FRIEND_ONLINE_STATE_DISCONNECT)
|
||||
.setIsMpModeAvailable(true)
|
||||
.setLastActiveTime(getFriendProfile().getLastActiveTime())
|
||||
.setNameCardId(getFriendProfile().getNameCard())
|
||||
.setParam(getFriendProfile().getDaysSinceLogin())
|
||||
.setIsGameSource(true)
|
||||
.setPlatformType(PlatformTypeOuterClass.PlatformType.PLATFORM_TYPE_PC)
|
||||
.build();
|
||||
public FriendBrief toProto() {
|
||||
FriendBrief proto = FriendBrief.newBuilder()
|
||||
.setUid(getFriendProfile().getUid())
|
||||
.setNickname(getFriendProfile().getName())
|
||||
.setLevel(getFriendProfile().getPlayerLevel())
|
||||
.setProfilePicture(ProfilePicture.newBuilder().setAvatarId(getFriendProfile().getAvatarId()))
|
||||
.setWorldLevel(getFriendProfile().getWorldLevel())
|
||||
.setSignature(getFriendProfile().getSignature())
|
||||
.setOnlineState(getFriendProfile().isOnline() ? FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE : FriendOnlineState.FRIEND_ONLINE_STATE_DISCONNECT)
|
||||
.setIsMpModeAvailable(true)
|
||||
.setLastActiveTime(getFriendProfile().getLastActiveTime())
|
||||
.setNameCardId(getFriendProfile().getNameCard())
|
||||
.setParam(getFriendProfile().getDaysSinceLogin())
|
||||
.setIsGameSource(true)
|
||||
.setPlatformType(PlatformTypeOuterClass.PlatformType.PLATFORM_TYPE_PC)
|
||||
.build();
|
||||
|
||||
return proto;
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
}
|
||||
|
@ -10,15 +10,15 @@ import emu.grasscutter.server.packet.send.*;
|
||||
@Opcodes(PacketOpcodes.HomeChangeEditModeReq)
|
||||
public class HandlerHomeChangeEditModeReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
var req = HomeChangeEditModeReqOuterClass.HomeChangeEditModeReq.parseFrom(payload);
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
var req = HomeChangeEditModeReqOuterClass.HomeChangeEditModeReq.parseFrom(payload);
|
||||
|
||||
session.send(new PacketHomePreChangeEditModeNotify(req.getIsEnterEditMode()));
|
||||
session.send(new PacketHomeBasicInfoNotify(session.getPlayer(), req.getIsEnterEditMode()));
|
||||
session.send(new PacketHomeComfortInfoNotify(session.getPlayer()));
|
||||
session.send(new PacketHomePreChangeEditModeNotify(req.getIsEnterEditMode()));
|
||||
session.send(new PacketHomeBasicInfoNotify(session.getPlayer(), req.getIsEnterEditMode()));
|
||||
session.send(new PacketHomeComfortInfoNotify(session.getPlayer()));
|
||||
|
||||
session.send(new PacketHomeChangeEditModeRsp(req.getIsEnterEditMode()));
|
||||
}
|
||||
session.send(new PacketHomeChangeEditModeRsp(req.getIsEnterEditMode()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
// musicGameBeatmap.save();
|
||||
//
|
||||
// var playerData = session.getPlayer().getActivityManager().getPlayerActivityDataByActivityType(ActivityType.NEW_ACTIVITY_MUSIC_GAME);
|
||||
// if(playerData.isEmpty()){
|
||||
// if (playerData.isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
|
@ -17,7 +17,7 @@
|
||||
//
|
||||
// var musicGameBeatmap = MusicGameBeatmap.getByShareId(req.getMusicShareId());
|
||||
//
|
||||
// if(musicGameBeatmap == null){
|
||||
// if (musicGameBeatmap == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
|
@ -17,7 +17,7 @@
|
||||
//
|
||||
// var musicGameBeatmap = MusicGameBeatmap.getByShareId(req.getMusicShareId());
|
||||
//
|
||||
// if(musicGameBeatmap == null){
|
||||
// if (musicGameBeatmap == null) {
|
||||
// session.send(new PacketMusicGameSearchBeatmapRsp(11153, req.getUnknownEnum1()));
|
||||
// return;
|
||||
// }
|
||||
|
@ -10,11 +10,11 @@ import emu.grasscutter.server.packet.send.PacketMusicGameStartRsp;
|
||||
@Opcodes(PacketOpcodes.MusicGameStartReq)
|
||||
public class HandlerMusicGameStartReq extends PacketHandler {
|
||||
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
var req = MusicGameStartReqOuterClass.MusicGameStartReq.parseFrom(payload);
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||
var req = MusicGameStartReqOuterClass.MusicGameStartReq.parseFrom(payload);
|
||||
|
||||
session.send(new PacketMusicGameStartRsp(req.getMusicBasicId(), req.getUgcGuid()));
|
||||
}
|
||||
session.send(new PacketMusicGameStartRsp(req.getMusicBasicId(), req.getUgcGuid()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class PacketEntityFightPropChangeReasonNotify extends BasePacket {
|
||||
.setReason(reason)
|
||||
.setChangeHpReason(changeHpReason);
|
||||
|
||||
for(int p : param){
|
||||
for (int p : param) {
|
||||
proto.addParamList(p);
|
||||
}
|
||||
|
||||
|
@ -6,14 +6,14 @@ import emu.grasscutter.net.proto.MusicGameStartRspOuterClass;
|
||||
|
||||
public class PacketMusicGameStartRsp extends BasePacket {
|
||||
|
||||
public PacketMusicGameStartRsp(int musicBasicId, long musicShareId) {
|
||||
super(PacketOpcodes.MusicGameStartRsp);
|
||||
public PacketMusicGameStartRsp(int musicBasicId, long musicShareId) {
|
||||
super(PacketOpcodes.MusicGameStartRsp);
|
||||
|
||||
var proto = MusicGameStartRspOuterClass.MusicGameStartRsp.newBuilder();
|
||||
var proto = MusicGameStartRspOuterClass.MusicGameStartRsp.newBuilder();
|
||||
|
||||
proto.setMusicBasicId(musicBasicId)
|
||||
proto.setMusicBasicId(musicBasicId)
|
||||
.setUgcGuid(musicShareId);
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -8,29 +8,29 @@ import emu.grasscutter.net.proto.PlayerApplyEnterMpResultNotifyOuterClass.Player
|
||||
|
||||
public class PacketPlayerApplyEnterMpResultNotify extends BasePacket {
|
||||
|
||||
public PacketPlayerApplyEnterMpResultNotify(Player target, boolean isAgreed, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason reason) {
|
||||
super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
|
||||
public PacketPlayerApplyEnterMpResultNotify(Player target, boolean isAgreed, PlayerApplyEnterMpResultNotifyOuterClass.PlayerApplyEnterMpResultNotify.Reason reason) {
|
||||
super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
|
||||
|
||||
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
|
||||
.setTargetUid(target.getUid())
|
||||
.setTargetNickname(target.getNickname())
|
||||
.setIsAgreed(isAgreed)
|
||||
.setReason(reason)
|
||||
.build();
|
||||
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
|
||||
.setTargetUid(target.getUid())
|
||||
.setTargetNickname(target.getNickname())
|
||||
.setIsAgreed(isAgreed)
|
||||
.setReason(reason)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketPlayerApplyEnterMpResultNotify(int targetId, String targetName, boolean isAgreed, PlayerApplyEnterMpResultNotify.Reason reason) {
|
||||
super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
|
||||
public PacketPlayerApplyEnterMpResultNotify(int targetId, String targetName, boolean isAgreed, PlayerApplyEnterMpResultNotify.Reason reason) {
|
||||
super(PacketOpcodes.PlayerApplyEnterMpResultNotify);
|
||||
|
||||
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
|
||||
.setTargetUid(targetId)
|
||||
.setTargetNickname(targetName)
|
||||
.setIsAgreed(isAgreed)
|
||||
.setReason(reason)
|
||||
.build();
|
||||
PlayerApplyEnterMpResultNotify proto = PlayerApplyEnterMpResultNotify.newBuilder()
|
||||
.setTargetUid(targetId)
|
||||
.setTargetNickname(targetName)
|
||||
.setIsAgreed(isAgreed)
|
||||
.setReason(reason)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -8,54 +8,54 @@ import emu.grasscutter.net.proto.PlayerChatNotifyOuterClass.PlayerChatNotify;
|
||||
|
||||
public class PacketPlayerChatNotify extends BasePacket {
|
||||
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, String message) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, String message) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setText(message)
|
||||
.build();
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setText(message)
|
||||
.build();
|
||||
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, int emote) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, int emote) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setIcon(emote)
|
||||
.build();
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setIcon(emote)
|
||||
.build();
|
||||
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, ChatInfo.SystemHint systemHint) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
public PacketPlayerChatNotify(Player sender, int channelId, ChatInfo.SystemHint systemHint) {
|
||||
super(PacketOpcodes.PlayerChatNotify);
|
||||
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setSystemHint(systemHint)
|
||||
.build();
|
||||
ChatInfo info = ChatInfo.newBuilder()
|
||||
.setTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setUid(sender.getUid())
|
||||
.setSystemHint(systemHint)
|
||||
.build();
|
||||
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
PlayerChatNotify proto = PlayerChatNotify.newBuilder()
|
||||
.setChannelId(channelId)
|
||||
.setChatInfo(info)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ public class PacketScenePointUnlockNotify extends BasePacket {
|
||||
ScenePointUnlockNotify.Builder p = ScenePointUnlockNotify.newBuilder()
|
||||
.setSceneId(sceneId)
|
||||
.addPointList(pointId)
|
||||
.addUnhidePointList(pointId);
|
||||
.addUnhidePointList(pointId);
|
||||
|
||||
this.setData(p);
|
||||
}
|
||||
@ -22,7 +22,7 @@ public class PacketScenePointUnlockNotify extends BasePacket {
|
||||
ScenePointUnlockNotify.Builder p = ScenePointUnlockNotify.newBuilder()
|
||||
.setSceneId(sceneId)
|
||||
.addAllPointList(pointIds)
|
||||
.addAllUnhidePointList(pointIds);
|
||||
.addAllUnhidePointList(pointIds);
|
||||
|
||||
this.setData(p);
|
||||
}
|
||||
|
@ -7,17 +7,17 @@ import emu.grasscutter.net.proto.TowerCurLevelRecordOuterClass.TowerCurLevelReco
|
||||
|
||||
public class PacketTowerCurLevelRecordChangeNotify extends BasePacket {
|
||||
|
||||
public PacketTowerCurLevelRecordChangeNotify(int curFloorId, int curLevelIndex) {
|
||||
super(PacketOpcodes.TowerCurLevelRecordChangeNotify);
|
||||
public PacketTowerCurLevelRecordChangeNotify(int curFloorId, int curLevelIndex) {
|
||||
super(PacketOpcodes.TowerCurLevelRecordChangeNotify);
|
||||
|
||||
TowerCurLevelRecordChangeNotify proto = TowerCurLevelRecordChangeNotify.newBuilder()
|
||||
.setCurLevelRecord(TowerCurLevelRecord.newBuilder()
|
||||
.setCurFloorId(curFloorId)
|
||||
.setCurLevelIndex(curLevelIndex)
|
||||
// TODO team info
|
||||
.build())
|
||||
.build();
|
||||
TowerCurLevelRecordChangeNotify proto = TowerCurLevelRecordChangeNotify.newBuilder()
|
||||
.setCurLevelRecord(TowerCurLevelRecord.newBuilder()
|
||||
.setCurFloorId(curFloorId)
|
||||
.setCurLevelIndex(curLevelIndex)
|
||||
// TODO team info
|
||||
.build())
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -7,26 +7,26 @@ import emu.grasscutter.net.proto.TowerLevelStarCondNotifyOuterClass.TowerLevelSt
|
||||
|
||||
public class PacketTowerLevelStarCondNotify extends BasePacket {
|
||||
|
||||
public PacketTowerLevelStarCondNotify(int floorId, int levelIndex) {
|
||||
super(PacketOpcodes.TowerLevelStarCondNotify);
|
||||
public PacketTowerLevelStarCondNotify(int floorId, int levelIndex) {
|
||||
super(PacketOpcodes.TowerLevelStarCondNotify);
|
||||
|
||||
TowerLevelStarCondNotify proto = TowerLevelStarCondNotify.newBuilder()
|
||||
.setFloorId(floorId)
|
||||
.setLevelIndex(levelIndex)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(1)
|
||||
.build()
|
||||
)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(2)
|
||||
.build()
|
||||
)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(3)
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
TowerLevelStarCondNotify proto = TowerLevelStarCondNotify.newBuilder()
|
||||
.setFloorId(floorId)
|
||||
.setLevelIndex(levelIndex)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(1)
|
||||
.build()
|
||||
)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(2)
|
||||
.build()
|
||||
)
|
||||
.addCondDataList(TowerLevelStarCondData.newBuilder()
|
||||
.setCondValue(3)
|
||||
.build()
|
||||
)
|
||||
.build();
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
this.setData(proto);
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class JsonAdapters {
|
||||
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
|
||||
Class<T> enumClass = (Class<T>) type.getRawType();
|
||||
if (!enumClass.isEnum()) return null;
|
||||
|
||||
|
||||
// Make mappings of (string) names to enum constants
|
||||
val map = new HashMap<String, T>();
|
||||
val enumConstants = enumClass.getEnumConstants();
|
||||
|
@ -252,7 +252,7 @@ public class TsvUtils {
|
||||
|
||||
public JsonElement toJson() {
|
||||
// Determine if this is an object, an array, or a value
|
||||
if (this.value != null) { //
|
||||
if (this.value != null) { //
|
||||
return new JsonPrimitive(this.value);
|
||||
}
|
||||
if (!this.arrayChildren.isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user