@@ -42,6 +43,7 @@ public final class GameServer extends KcpServer {
...
@@ -42,6 +43,7 @@ public final class GameServer extends KcpServer {
privatefinalDungeonManagerdungeonManager;
privatefinalDungeonManagerdungeonManager;
privatefinalCommandMapcommandMap;
privatefinalCommandMapcommandMap;
privatefinalTaskMaptaskMap;
privatefinalTaskMaptaskMap;
privatefinalDropManagerdropManager;
publicGameServer(InetSocketAddressaddress){
publicGameServer(InetSocketAddressaddress){
super(address);
super(address);
...
@@ -60,6 +62,7 @@ public final class GameServer extends KcpServer {
...
@@ -60,6 +62,7 @@ public final class GameServer extends KcpServer {
this.dungeonManager=newDungeonManager(this);
this.dungeonManager=newDungeonManager(this);
this.commandMap=newCommandMap(true);
this.commandMap=newCommandMap(true);
this.taskMap=newTaskMap(true);
this.taskMap=newTaskMap(true);
this.dropManager=newDropManager(this);
// Schedule game loop.
// Schedule game loop.
TimergameLoop=newTimer();
TimergameLoop=newTimer();
...
@@ -109,6 +112,10 @@ public final class GameServer extends KcpServer {
...
@@ -109,6 +112,10 @@ public final class GameServer extends KcpServer {
publicMultiplayerManagergetMultiplayerManager(){
publicMultiplayerManagergetMultiplayerManager(){
returnmultiplayerManager;
returnmultiplayerManager;
}
}
publicDropManagergetDropManager(){
returndropManager;
}
publicDungeonManagergetDungeonManager(){
publicDungeonManagergetDungeonManager(){
returndungeonManager;
returndungeonManager;
...
@@ -196,6 +203,7 @@ public final class GameServer extends KcpServer {
...
@@ -196,6 +203,7 @@ public final class GameServer extends KcpServer {
@Override
@Override
publicvoidonStartFinish(){
publicvoidonStartFinish(){
Grasscutter.getLogger().info("Grasscutter is FREE software. If you have paid for this, you may have been scammed. Homepage: https://github.com/Grasscutters/Grasscutter");
Grasscutter.getLogger().info("Game Server started on port "+address.getPort());
Grasscutter.getLogger().info("Game Server started on port "+address.getPort());
if(message.stateValue==1){// Make sure it isn't a gift
if(message.stateValue==1){// Make sure it isn't a gift
if(message.expireTime>(int)Instant.now().getEpochSecond()){// Make sure the message isn't expired (The game won't show expired mail, but I don't want to send unnecessary information).
if(message.expireTime>(int)Instant.now().getEpochSecond()){// Make sure the message isn't expired (The game won't show expired mail, but I don't want to send unnecessary information).
if(mailDataList.size()<=1000){// Make sure that there isn't over 1000 messages in the mailbox. (idk what will happen if there is but the game probably won't like it.)
if(mailDataList.size()<=1000){// Make sure that there isn't over 1000 messages in the mailbox. (idk what will happen if there is but the game probably won't like it.)
...
@@ -79,17 +70,8 @@ public class PacketGetAllMailRsp extends BasePacket {
...
@@ -79,17 +70,8 @@ public class PacketGetAllMailRsp extends BasePacket {
proto.addAllMailList(mailDataList);
proto.addAllMailList(mailDataList);
proto.setIsTruncated(mailDataList.size()<=1000?false:true);// When enabled this will send a notification to the user telling them their inbox is full and they should delete old messages when opening the mailbox.
proto.setIsTruncated(mailDataList.size()<=1000?false:true);// When enabled this will send a notification to the user telling them their inbox is full and they should delete old messages when opening the mailbox.