mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
minor state fixes
This commit is contained in:
parent
0b5f4d96db
commit
25262156e3
3 changed files with 29 additions and 4 deletions
|
|
@ -107,7 +107,10 @@ class ProfilerUI {
|
|||
lastSentMove = @:privateAccess Net.clientConnection.moveManager.queuedMoves[Net.clientConnection.moveManager.queuedMoves.length - 1].id;
|
||||
}
|
||||
|
||||
if (Net.isClient) {
|
||||
if (Net.isClient
|
||||
&& lastSentMove != null
|
||||
&& @:privateAccess MarbleGame.instance.world.lastMoves != null
|
||||
&& @:privateAccess MarbleGame.instance.world.lastMoves.myMarbleUpdate != null) {
|
||||
instance.networkStats.text = 'Client World Ticks: ${MarbleGame.instance.world.timeState.ticks}\n'
|
||||
+ 'Client Marble Ticks: ${@:privateAccess MarbleGame.instance.world.marble.serverTicks}\n'
|
||||
+ 'Server Ticks: ${@:privateAccess MarbleGame.instance.world.lastMoves.myMarbleUpdate.serverTicks}\n'
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ class PlayGui {
|
|||
var blastFillUltra:GuiImage;
|
||||
var blastFrame:GuiImage;
|
||||
|
||||
var playerListContainerOuter:GuiControl;
|
||||
var playerListContainer:GuiControl;
|
||||
var playerListCtrl:GuiMLTextListCtrl;
|
||||
var playerListScoresCtrl:GuiMLTextListCtrl;
|
||||
|
|
@ -104,6 +103,19 @@ class PlayGui {
|
|||
if (_init) {
|
||||
playGuiCtrlOuter.dispose();
|
||||
|
||||
if (playerListContainer != null) {
|
||||
playerListContainer.dispose();
|
||||
playerListContainer = null;
|
||||
playerListCtrl.dispose();
|
||||
playerListCtrl = null;
|
||||
playerListShadowCtrl.dispose();
|
||||
playerListShadowCtrl = null;
|
||||
playerListScoresCtrl.dispose();
|
||||
playerListScoresCtrl = null;
|
||||
playerListScoresShadowCtrl.dispose();
|
||||
playerListScoresShadowCtrl = null;
|
||||
}
|
||||
|
||||
for (textureResource in textureResources) {
|
||||
textureResource.release();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -415,10 +415,20 @@ class Net {
|
|||
if (wsAccum >= 20.0) {
|
||||
wsAccum = 0;
|
||||
if (Net.isHost) {
|
||||
MasterServerClient.instance.sendServerInfo(serverInfo); // Heartbeat
|
||||
if (MasterServerClient.instance != null)
|
||||
MasterServerClient.instance.sendServerInfo(serverInfo); // Heartbeat
|
||||
else
|
||||
MasterServerClient.connectToMasterServer(() -> {
|
||||
MasterServerClient.instance.sendServerInfo(serverInfo); // Heartbeat
|
||||
});
|
||||
}
|
||||
if (Net.isClient) {
|
||||
MasterServerClient.instance.heartBeat();
|
||||
if (MasterServerClient.instance != null)
|
||||
MasterServerClient.instance.heartBeat();
|
||||
else
|
||||
MasterServerClient.connectToMasterServer(() -> {
|
||||
MasterServerClient.instance.heartBeat();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue