MCPcopy Create free account
hub / github.com/ZDoom/Raze / JoinGame

Function JoinGame

source/common/engine/i_net.cpp:886–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886bool JoinGame (int i)
887{
888 if ((i == Args->NumArgs() - 1) ||
889 (Args->GetArg(i+1)[0] == '-') ||
890 (Args->GetArg(i+1)[0] == '+'))
891 I_FatalError ("You need to specify the host machine's address");
892
893 StartNetwork (true);
894
895 // Host is always node 1
896 BuildAddress (&sendaddress[1], Args->GetArg(i+1));
897 sendplayer[1] = 0;
898 doomcom.numnodes = 2;
899 doomcom.consoleplayer = -1;
900
901
902 // Let host know we are here
903 I_NetInit ("Contacting host", 0);
904
905 if (!I_NetLoop (Guest_ContactHost, NULL))
906 {
907 SendAbort();
908 return false;
909 }
910
911 // Wait for everyone else to connect
912 if (!I_NetLoop (Guest_WaitForOthers, 0))
913 {
914 SendAbort();
915 return false;
916 }
917
918 I_NetMessage ("Total players: %d", doomcom.numnodes);
919
920 doomcom.id = DOOMCOM_ID;
921 doomcom.numplayers = doomcom.numnodes;
922 return true;
923}
924
925static int PrivateNetOf(in_addr in)
926{

Callers 1

I_InitNetworkFunction · 0.85

Calls 9

I_FatalErrorFunction · 0.85
StartNetworkFunction · 0.85
BuildAddressFunction · 0.85
I_NetInitFunction · 0.85
I_NetLoopFunction · 0.85
SendAbortFunction · 0.85
I_NetMessageFunction · 0.85
NumArgsMethod · 0.80
GetArgMethod · 0.45

Tested by

no test coverage detected