Added logging to proxy Plugin.

Changed tracking to async logging so it doesn't stop players from connecting if stats is down or slow.
This commit is contained in:
Jonathan Williams 2014-04-22 22:10:25 -07:00
parent 7ea601e94b
commit 97c8573926
6 changed files with 19 additions and 3 deletions

View File

@ -53,6 +53,8 @@ public class LobbyBalancerRepository
}
}
}
System.out.println("Initialized LobbyBalancer.");
}
public List<ServerStatusData> retrieveServerStatuses()

View File

@ -47,6 +47,8 @@ public class MotdRepository
}
}
}
System.out.println("Initialized MOTD.");
}
public String retrieveMotd()

View File

@ -139,6 +139,8 @@ public class PlayerCountRepository
}
}
}
System.out.println("Initialized PlayerCount.");
}
public boolean updatePlayerCountInDatabase(int players)

View File

@ -21,9 +21,15 @@ public class PlayerStats implements Listener
}
@EventHandler
public void playerConnect(PostLoginEvent event)
public void playerConnect(final PostLoginEvent event)
{
_repository.addPlayer(event.getPlayer().getName());
_repository.addPlayerVersion(event.getPlayer().getName(), (event.getPlayer().getPendingConnection().getVersion() == 4 ? "1.7" : "1.6"));
_plugin.getProxy().getScheduler().runAsync(_plugin, new Runnable()
{
public void run()
{
_repository.addPlayer(event.getPlayer().getName());
_repository.addPlayerVersion(event.getPlayer().getName(), (event.getPlayer().getPendingConnection().getVersion() == 4 ? "1.7" : "1.6"));
}
});
}
}

View File

@ -55,6 +55,8 @@ public class PlayerStatsRepository
}
}
}
System.out.println("Initialized PlayerStats.");
}
public boolean addPlayer(String playerName)

View File

@ -61,6 +61,8 @@ public class PlayerTrackerRepository
}
}
}
System.out.println("Initialized PlayerTracker.");
}
public boolean updatePlayerServer(String name, String server)