| 349 | } |
| 350 | |
| 351 | void NetInterface::handleConnectAccept(const NetAddress *address, BitStream *stream) |
| 352 | { |
| 353 | U32 connectSequence; |
| 354 | stream->read(&connectSequence); |
| 355 | NetConnection *conn = findPendingConnection(address, connectSequence); |
| 356 | if(!conn || conn->getConnectionState() != NetConnection::AwaitingConnectResponse) |
| 357 | return; |
| 358 | const char *errorString = NULL; |
| 359 | if(!conn->readConnectAccept(stream, &errorString)) |
| 360 | { |
| 361 | conn->handleStartupError(errorString); |
| 362 | removePendingConnection(conn); |
| 363 | conn->deleteObject(); |
| 364 | return; |
| 365 | } |
| 366 | |
| 367 | removePendingConnection(conn); // remove from the pending connection list |
| 368 | conn->setNetworkConnection(true); |
| 369 | conn->onConnectionEstablished(true); // notify the connection that it has been established |
| 370 | conn->setEstablished(); // installs the connection in the connection table, and causes pings/timeouts to happen |
| 371 | conn->setConnectSequence(connectSequence); |
| 372 | } |
| 373 | |
| 374 | void NetInterface::sendConnectReject(NetConnection *conn, const char *reason) |
| 375 | { |
nothing calls this directly
no test coverage detected