mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-28 07:55:49 +00:00
PlayerList is sent every 2 seconds.
This commit is contained in:
1 parent
619caf5dff
commit
fea6acb1c4
1 file changed
+7
-2
@@ -50,6 +50,7 @@ public enum OpisServerTickHandler implements ITickHandler {
|
||||
public int profilerRunningTicks;
|
||||
public long timer500 = System.nanoTime();
|
||||
public long timer1000 = System.nanoTime();
|
||||
public long timer2000 = System.nanoTime();
|
||||
public long timer5000 = System.nanoTime();
|
||||
|
||||
public HashMap<Player, AccessLevel> cachedAccess = new HashMap<Player, AccessLevel>();
|
||||
@@ -108,13 +109,17 @@ public enum OpisServerTickHandler implements ITickHandler {
|
||||
((ProfilerPacket)ProfilerSection.PACKET_OUTBOUND.getProfiler()).dataAmount = 0L;
|
||||
}
|
||||
|
||||
// Two second timer
|
||||
if (System.nanoTime() - timer2000 > 2000000000L){
|
||||
timer2000 = System.nanoTime();
|
||||
OpisPacketHandler.sendPacketToAllSwing(NetDataList.create(Message.LIST_PLAYERS, EntityManager.INSTANCE.getAllPlayers()));
|
||||
}
|
||||
|
||||
// Five second timer
|
||||
if (System.nanoTime() - timer5000 > 5000000000L){
|
||||
timer5000 = System.nanoTime();
|
||||
updatePlayers();
|
||||
|
||||
OpisPacketHandler.sendPacketToAllSwing(NetDataList.create(Message.LIST_PLAYERS, EntityManager.INSTANCE.getAllPlayers()));
|
||||
|
||||
OpisPacketHandler.sendPacketToAllSwing(NetDataList.create(Message.LIST_PACKETS_OUTBOUND, ((ProfilerPacket)ProfilerSection.PACKET_OUTBOUND.getProfiler()).data));
|
||||
OpisPacketHandler.sendPacketToAllSwing(NetDataList.create(Message.LIST_PACKETS_INBOUND, ((ProfilerPacket)ProfilerSection.PACKET_INBOUND.getProfiler()).data));
|
||||
|
||||
|
||||
Reference in new issue
Block a user