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:
parent
7ea601e94b
commit
97c8573926
@ -53,6 +53,8 @@ public class LobbyBalancerRepository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Initialized LobbyBalancer.");
|
||||
}
|
||||
|
||||
public List<ServerStatusData> retrieveServerStatuses()
|
||||
|
@ -47,6 +47,8 @@ public class MotdRepository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Initialized MOTD.");
|
||||
}
|
||||
|
||||
public String retrieveMotd()
|
||||
|
@ -139,6 +139,8 @@ public class PlayerCountRepository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Initialized PlayerCount.");
|
||||
}
|
||||
|
||||
public boolean updatePlayerCountInDatabase(int players)
|
||||
|
@ -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"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ public class PlayerStatsRepository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Initialized PlayerStats.");
|
||||
}
|
||||
|
||||
public boolean addPlayer(String playerName)
|
||||
|
@ -61,6 +61,8 @@ public class PlayerTrackerRepository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Initialized PlayerTracker.");
|
||||
}
|
||||
|
||||
public boolean updatePlayerServer(String name, String server)
|
||||
|
Loading…
Reference in New Issue
Block a user