mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Adjust formatting
This commit is contained in:
@@ -164,55 +164,53 @@ public class GameEngine {
|
|||||||
*/
|
*/
|
||||||
scheduler.scheduleAtFixedRate(new Runnable() {
|
scheduler.scheduleAtFixedRate(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
/**
|
/**
|
||||||
* Main Server Tick
|
* Main Server Tick
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
if (GameEngine.shutdownServer) {
|
if (GameEngine.shutdownServer) {
|
||||||
scheduler.shutdown();
|
scheduler.shutdown();
|
||||||
}
|
}
|
||||||
itemHandler.process();
|
itemHandler.process();
|
||||||
playerHandler.process();
|
playerHandler.process();
|
||||||
npcHandler.process();
|
npcHandler.process();
|
||||||
shopHandler.process();
|
shopHandler.process();
|
||||||
objectManager.process();
|
objectManager.process();
|
||||||
CastleWars.process();
|
CastleWars.process();
|
||||||
FightPits.process();
|
FightPits.process();
|
||||||
pestControl.process();
|
pestControl.process();
|
||||||
CycleEventHandler.getSingleton().process();
|
CycleEventHandler.getSingleton().process();
|
||||||
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
|
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
|
||||||
RegisteredAccsWebsite
|
RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
|
||||||
.addUpdateRegisteredUsersTask();
|
DiscordActivity.updateActivity();
|
||||||
DiscordActivity.updateActivity();
|
if (System.currentTimeMillis() - lastMassSave > 300000) {
|
||||||
if (System.currentTimeMillis()
|
for (Player p : PlayerHandler.players) {
|
||||||
- lastMassSave > 300000) {
|
if (p == null) {
|
||||||
for (Player p : PlayerHandler.players) {
|
continue;
|
||||||
if (p == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
PlayerSave.saveGame((Client) p);
|
|
||||||
System.out.println("Saved game for " + p.playerName + ".");
|
|
||||||
lastMassSave = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
System.out.println("A fatal exception has been thrown!");
|
|
||||||
for (Player p : PlayerHandler.players) {
|
|
||||||
if (p == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (p.inTrade) {
|
|
||||||
((Client) p).getTrading().declineTrade();
|
|
||||||
}
|
|
||||||
if (p.duelStatus == 6) {
|
|
||||||
((Client) p).getDueling().claimStakedItems();
|
|
||||||
}
|
|
||||||
PlayerSave.saveGame((Client) p);
|
|
||||||
System.out.println("Saved game for " + p.playerName + ".");
|
|
||||||
scheduler.shutdown(); // Kills the tickloop thread if Exception is thrown.
|
|
||||||
}
|
}
|
||||||
|
PlayerSave.saveGame((Client) p);
|
||||||
|
System.out.println("Saved game for " + p.playerName + ".");
|
||||||
|
lastMassSave = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
System.out.println("A fatal exception has been thrown!");
|
||||||
|
for (Player p : PlayerHandler.players) {
|
||||||
|
if (p == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (p.inTrade) {
|
||||||
|
((Client) p).getTrading().declineTrade();
|
||||||
|
}
|
||||||
|
if (p.duelStatus == 6) {
|
||||||
|
((Client) p).getDueling().claimStakedItems();
|
||||||
|
}
|
||||||
|
PlayerSave.saveGame((Client) p);
|
||||||
|
System.out.println("Saved game for " + p.playerName + ".");
|
||||||
|
scheduler.shutdown(); // Kills the tickloop thread if Exception is thrown.
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
|
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user