MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / handleConnectAccept

Method handleConnectAccept

Engine/source/sim/netInterface.cpp:350–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

getConnectionStateMethod · 0.80
setNetworkConnectionMethod · 0.80
setEstablishedMethod · 0.80
setConnectSequenceMethod · 0.80
readMethod · 0.45
readConnectAcceptMethod · 0.45
handleStartupErrorMethod · 0.45
deleteObjectMethod · 0.45

Tested by

no test coverage detected