From fc2856e69b3b5c05c330439b7f55160dc70c9668 Mon Sep 17 00:00:00 2001 From: Gitea Date: Tue, 13 Dec 2022 14:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/emu/grasscutter/config/ConfigContainer.java | 6 +++--- src/main/java/emu/grasscutter/game/gacha/GachaSystem.java | 4 +--- src/main/java/emu/grasscutter/game/player/Player.java | 1 - .../grasscutter/server/game/GameServerStartFinishEvent.java | 5 ----- .../emu/grasscutter/server/game/GameServerStopEvent.java | 5 ----- .../emu/grasscutter/server/game/GameServerTickEvent.java | 5 ----- src/main/java/emu/grasscutter/server/game/GameSession.java | 1 + .../server/packet/recv/HandlerGetPlayerTokenReq.java | 1 + .../server/packet/send/PacketGetPlayerFriendListRsp.java | 2 +- 9 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 src/main/java/emu/grasscutter/server/game/GameServerStartFinishEvent.java delete mode 100644 src/main/java/emu/grasscutter/server/game/GameServerStopEvent.java delete mode 100644 src/main/java/emu/grasscutter/server/game/GameServerTickEvent.java diff --git a/src/main/java/emu/grasscutter/config/ConfigContainer.java b/src/main/java/emu/grasscutter/config/ConfigContainer.java index 3f9550c..4509100 100644 --- a/src/main/java/emu/grasscutter/config/ConfigContainer.java +++ b/src/main/java/emu/grasscutter/config/ConfigContainer.java @@ -277,11 +277,11 @@ public class ConfigContainer { public static class ConsoleAccount { public int avatarId = 10000007; public int nameCardId = 210001; - public int adventureRank = 1; - public int worldLevel = 0; + public int adventureRank = 60; + public int worldLevel = 8; public String nickName = "Server"; - public String signature = "Welcome to Grasscutter!"; + public String signature = "Server Running in "+System.getProperty("os.name"); } public static class Files { diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java index c3984d0..0a7f5c0 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java @@ -2,7 +2,6 @@ package emu.grasscutter.game.gacha; import static emu.grasscutter.config.Configuration.*; -import java.io.File; import java.nio.file.*; import java.util.ArrayList; import java.util.List; @@ -29,7 +28,6 @@ import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.server.game.BaseGameSystem; import emu.grasscutter.server.game.GameServer; -import emu.grasscutter.server.game.GameServerTickEvent; import emu.grasscutter.server.packet.send.PacketDoGachaRsp; import emu.grasscutter.utils.FileUtils; import emu.grasscutter.utils.Utils; @@ -388,7 +386,7 @@ public class GachaSystem extends BaseGameSystem { } @Subscribe - public synchronized void watchBannerJson(GameServerTickEvent tickEvent) { + public synchronized void watchBannerJson() { if (GAME_OPTIONS.watchGachaConfig) { try { WatchKey watchKey = watchService.take(); diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index f48ed14..fc90bd1 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -1253,7 +1253,6 @@ public class Player { this.save(); this.getTeamManager().saveAvatars(); this.getFriendsList().save(); - }catch (Throwable e) { e.printStackTrace(); Grasscutter.getLogger().warn("Player (UID {}) save failure", getUid()); diff --git a/src/main/java/emu/grasscutter/server/game/GameServerStartFinishEvent.java b/src/main/java/emu/grasscutter/server/game/GameServerStartFinishEvent.java deleted file mode 100644 index 5e960ad..0000000 --- a/src/main/java/emu/grasscutter/server/game/GameServerStartFinishEvent.java +++ /dev/null @@ -1,5 +0,0 @@ -package emu.grasscutter.server.game; - -public class GameServerStartFinishEvent { - // Placeholder class for now, probably will get used later -} diff --git a/src/main/java/emu/grasscutter/server/game/GameServerStopEvent.java b/src/main/java/emu/grasscutter/server/game/GameServerStopEvent.java deleted file mode 100644 index 7a7ef40..0000000 --- a/src/main/java/emu/grasscutter/server/game/GameServerStopEvent.java +++ /dev/null @@ -1,5 +0,0 @@ -package emu.grasscutter.server.game; - -public class GameServerStopEvent { - // Placeholder class for now, probably will get used later -} diff --git a/src/main/java/emu/grasscutter/server/game/GameServerTickEvent.java b/src/main/java/emu/grasscutter/server/game/GameServerTickEvent.java deleted file mode 100644 index f9069d2..0000000 --- a/src/main/java/emu/grasscutter/server/game/GameServerTickEvent.java +++ /dev/null @@ -1,5 +0,0 @@ -package emu.grasscutter.server.game; - -public class GameServerTickEvent { - // Placeholder class for now, probably will get used later -} diff --git a/src/main/java/emu/grasscutter/server/game/GameSession.java b/src/main/java/emu/grasscutter/server/game/GameSession.java index 6d07e9b..678c289 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSession.java +++ b/src/main/java/emu/grasscutter/server/game/GameSession.java @@ -139,6 +139,7 @@ public class GameSession implements GameSessionManager.KcpChannel { default -> { } } + tunnel.writeData(packet.build()); } @Override diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java index 5e9e46c..5e293b4 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetPlayerTokenReq.java @@ -69,6 +69,7 @@ public class HandlerGetPlayerTokenReq extends PacketHandler { Player player = DatabaseHelper.getPlayerByAccount(account, Player.class); if (player == null) { + Grasscutter.getLogger().info("P: "+player.getNickname()); int nextPlayerUid = DatabaseHelper.getNextPlayerId(session.getAccount().getReservedPlayerUid()); // Create player instance from event. diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java index 82110ef..a29281d 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetPlayerFriendListRsp.java @@ -26,7 +26,7 @@ public class PacketGetPlayerFriendListRsp extends BasePacket { .setProfilePicture(ProfilePicture.newBuilder().setAvatarId(serverAccount.avatarId)) .setWorldLevel(serverAccount.worldLevel) .setSignature(serverAccount.signature) - .setLastActiveTime((int) (System.currentTimeMillis() / 1000f)) + .setLastActiveTime(0) .setNameCardId(serverAccount.nameCardId) .setOnlineState(FriendOnlineState.FRIEND_ONLINE_STATE_ONLINE) .setParam(1)