public static void main(String args[])
{
s = new Server();
//SQL.createConnection();
s.worldO = new WorldObjects();
try
{
//Class.forName("org.gjt.mm.mysql.Driver");
//s.myConnection = DriverManager.getConnection("jdbc:mysql://127.0.0.1/theserverthecanneverbehacked", "root", "");
//s.myStmt = s.myConnection.createStatement();
}
catch(Exception exception)
{
System.out.println(exception.getMessage());
exception.printStackTrace();
}
s.npcHandler = new NPCHandler();
s.itemHandler = new ItemHandler();
s.pc = new PestControl();
s.shopHandler = new ShopHandler();
s.magicHandler = new MagicHandler();
(new Thread(s)).start();
boolean flag = false;
long l = System.currentTimeMillis();
long l1 = 0L;
while(s.keepServerOn)
{
s.restartTime++;
if(s.playerHandler != null)
s.playerHandler.process(windowClosingException);
if(s.npcHandler != null)
s.npcHandler.process(CYCLE_TIME);
if(s.itemHandler != null)
s.itemHandler.process();
if(s.shopHandler != null)
s.shopHandler.process();
if(s.pc != null)
s.pc.process();
if(s.worldO != null)
s.worldO.process();
s.garbageCollectDelay--;
if(s.garbageCollectDelay == 0)
{
s.garbageCollectDelay = 240;
System.gc();
}
long l2 = System.currentTimeMillis() - l;
s.msLag = (int)l2;
s.getClass();
if(l2 >= 500L)
{
s.getClass();
l2 = 500L;
}
try
{
s.getClass();
Thread.sleep(500L - l2);
}
catch(Exception exception1)
{
System.err.println("Thread Sleep Error");
}
l = System.currentTimeMillis();
}
s.resetServer();
}