| 883 | } |
| 884 | |
| 885 | void 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 | |
| 913 | void GameConnection::setDisconnectReason(const char *str) |
| 914 | { |
nothing calls this directly
no test coverage detected