MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / onRemove

Method onRemove

Engine/source/T3D/gameBase/gameConnection.cpp:885–911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883}
884
885void GameConnection::onRemove()
886{
887 if(isNetworkConnection())
888 {
889 sendDisconnectPacket(mDisconnectReason);
890 }
891 else if (isLocalConnection() && isConnectionToServer())
892 {
893 // We're a client-side but local connection
894 // delete the server side of the connection on our local server so that it updates
895 // clientgroup and what not (this is so that we can disconnect from a local server
896 // without needing to destroy and recreate the server before we can connect to it
897 // again).
898 // Safe-delete as we don't know whether the server connection is currently being
899 // worked on.
900 getRemoteConnection()->safeDeleteObject();
901 setRemoteConnectionObject(NULL);
902 }
903 if(!isConnectionToServer())
904 {
905 onDrop_callback(mDisconnectReason);
906 }
907
908 if (mControlObject)
909 mControlObject->setControllingClient(0);
910 Parent::onRemove();
911}
912
913void GameConnection::setDisconnectReason(const char *str)
914{

Callers

nothing calls this directly

Calls 2

safeDeleteObjectMethod · 0.80
setControllingClientMethod · 0.45

Tested by

no test coverage detected