Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 1,559 Lines • ▼ Show 20 Lines | if (args.Has("autostart-host")) | ||||
g_NetServer->UpdateGameAttributes(&attrs, scriptInterface); | g_NetServer->UpdateGameAttributes(&attrs, scriptInterface); | ||||
bool ok = g_NetServer->SetupConnection(PS_DEFAULT_PORT); | bool ok = g_NetServer->SetupConnection(PS_DEFAULT_PORT); | ||||
ENSURE(ok); | ENSURE(ok); | ||||
g_NetClient = new CNetClient(g_Game, true); | g_NetClient = new CNetClient(g_Game, true); | ||||
g_NetClient->SetUserName(userName); | g_NetClient->SetUserName(userName); | ||||
g_NetClient->SetupConnection("127.0.0.1", PS_DEFAULT_PORT, nullptr); | g_NetClient->SetupServerData("127.0.0.1", PS_DEFAULT_PORT, false); | ||||
g_NetClient->SetupConnection(nullptr); | |||||
} | } | ||||
else if (args.Has("autostart-client")) | else if (args.Has("autostart-client")) | ||||
{ | { | ||||
InitPsAutostart(true, attrs); | InitPsAutostart(true, attrs); | ||||
g_NetClient = new CNetClient(g_Game, false); | g_NetClient = new CNetClient(g_Game, false); | ||||
g_NetClient->SetUserName(userName); | g_NetClient->SetUserName(userName); | ||||
CStr ip = args.Get("autostart-client"); | CStr ip = args.Get("autostart-client"); | ||||
if (ip.empty()) | if (ip.empty()) | ||||
ip = "127.0.0.1"; | ip = "127.0.0.1"; | ||||
bool ok = g_NetClient->SetupConnection(ip, PS_DEFAULT_PORT, nullptr); | g_NetClient->SetupServerData(ip, PS_DEFAULT_PORT, false); | ||||
ENSURE(ok); | ENSURE(g_NetClient->SetupConnection(nullptr)); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
g_Game->SetPlayerID(args.Has("autostart-player") ? args.Get("autostart-player").ToInt() : 1); | g_Game->SetPlayerID(args.Has("autostart-player") ? args.Get("autostart-player").ToInt() : 1); | ||||
g_Game->StartGame(&attrs, ""); | g_Game->StartGame(&attrs, ""); | ||||
if (CRenderer::IsInitialised()) | if (CRenderer::IsInitialised()) | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator