mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Merge pull request #807 from Areloch/DisconnectAndCleanupFix
Disconnect and Shutdown fixes
This commit is contained in:
commit
a73695a01a
4 changed files with 32 additions and 2 deletions
|
|
@ -32,7 +32,7 @@
|
||||||
MODULE_BEGIN( ShaderGenFeatureMgr )
|
MODULE_BEGIN( ShaderGenFeatureMgr )
|
||||||
|
|
||||||
MODULE_INIT_BEFORE( ShaderGen )
|
MODULE_INIT_BEFORE( ShaderGen )
|
||||||
MODULE_SHUTDOWN_AFTER( Sim ) // allow registered features to be removed before destroying singleton
|
MODULE_SHUTDOWN_AFTER(Scene)
|
||||||
|
|
||||||
MODULE_INIT
|
MODULE_INIT
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,20 @@ function GameConnection::onControlObjectChange(%this)
|
||||||
//turnOffZoom();
|
//turnOffZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function GameConnection::onConnectionTimedOut(%this)
|
||||||
|
{
|
||||||
|
// Called when an established connection times out
|
||||||
|
disconnectedCleanup();
|
||||||
|
MessageBoxOK( "TIMED OUT", "The server connection has timed out.");
|
||||||
|
}
|
||||||
|
|
||||||
|
function GameConnection::onConnectionDropped(%this, %msg)
|
||||||
|
{
|
||||||
|
// Established connection was dropped by the server
|
||||||
|
disconnectedCleanup();
|
||||||
|
MessageBoxOK( "DISCONNECT", "The server has dropped the connection: " @ %msg);
|
||||||
|
}
|
||||||
|
|
||||||
function GameConnection::onConnectionError(%this, %msg)
|
function GameConnection::onConnectionError(%this, %msg)
|
||||||
{
|
{
|
||||||
// General connection error, usually raised by ghosted objects
|
// General connection error, usually raised by ghosted objects
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ function MainMenuGui::onWake(%this)
|
||||||
//This will ultimately call MainMenuButtons::onOpen(), so to see where the navigation
|
//This will ultimately call MainMenuButtons::onOpen(), so to see where the navigation
|
||||||
//chain continues, see that function.
|
//chain continues, see that function.
|
||||||
%this.setRootPage(MainMenuButtons);
|
%this.setRootPage(MainMenuButtons);
|
||||||
|
|
||||||
|
%this.refreshPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
function MainMenuButtonHolder::onWake(%this)
|
function MainMenuButtonHolder::onWake(%this)
|
||||||
|
|
|
||||||
|
|
@ -287,4 +287,18 @@ function UINavigation::getPageCount(%this)
|
||||||
%count++;
|
%count++;
|
||||||
|
|
||||||
return %count;
|
return %count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
/// Summary:
|
||||||
|
/// Force the page to reprocess to ensure it's status is up to date
|
||||||
|
function UINavigation::refreshPage(%this)
|
||||||
|
{
|
||||||
|
%page = %this.getCurrentPage();
|
||||||
|
if(!isObject(%page))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(%page.isMethod("onOpen"))
|
||||||
|
%page.call("onOpen");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue