MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / StartClient

Method StartClient

Source/Engine/Networking/NetworkManager.cpp:534–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534bool NetworkManager::StartClient()
535{
536 PROFILE_CPU();
537 PROFILE_MEM(Networking);
538 Stop();
539
540 LOG(Info, "Starting network manager as client");
541 Mode = NetworkManagerMode::Client;
542 if (StartPeer())
543 {
544 Mode = NetworkManagerMode::Offline;
545 return true;
546 }
547 if (!Peer->Connect())
548 {
549 Stop();
550 return true;
551 }
552 LocalClientId = 0; // Id gets assigned by server later after connection
553 NextClientId = 0;
554 LocalClient = New<NetworkClient>(LocalClientId, NetworkConnection{ 0 });
555
556 return false;
557}
558
559bool NetworkManager::StartHost()
560{

Callers

nothing calls this directly

Calls 3

StartPeerFunction · 0.85
StopFunction · 0.50
ConnectMethod · 0.45

Tested by

no test coverage detected