private static void SavePlayers() { foreach (string clientKey in WorldSocket.Clients.Keys) { WorldClient thisclient = WorldSocket.Clients[clientKey] as WorldClient; if (thisclient != null && thisclient.playerData.lastSaveTime == 0) { thisclient.playerData.lastSaveTime = TimeUtils.getUnixTimeUint32(); } if (thisclient != null && (TimeUtils.getUnixTimeUint32() - thisclient.playerData.lastSaveTime) > 20) { thisclient.playerData.lastSaveTime = TimeUtils.getUnixTimeUint32(); // Save Player new PlayerHelper().savePlayerInfo(thisclient); // Notify Player about save ServerPackets pak = new ServerPackets(); pak.sendSaveCharDataMessage(thisclient, StringUtils.charBytesToString_NZ(thisclient.playerInstance.CharacterName.getValue())); } // Handle Jackout exit if (thisclient.playerData.isJackoutInProgress == true && (thisclient.playerData.jackoutStartTime - TimeUtils.getUnixTimeUint32()) > 5) { ServerPackets packets = new ServerPackets(); packets.sendExitGame(thisclient); } } }
public void processGameFinish() { ServerPackets packets = new ServerPackets(); packets.sendExitGame(Store.currentClient); }