MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ConNetworkConnect

Function ConNetworkConnect

src/console_cmds.cpp:1150–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1148}
1149
1150static bool ConNetworkConnect(std::span<std::string_view> argv)
1151{
1152 if (argv.empty()) {
1153 IConsolePrint(CC_HELP, "Connect to a remote OTTD server and join the game. Usage: 'connect <ip>'.");
1154 IConsolePrint(CC_HELP, "IP can contain port and company: 'IP[:Port][#Company]', eg: 'server.ottd.org:443#2'.");
1155 IConsolePrint(CC_HELP, "Company #255 is spectator all others are a certain company with Company 1 being #1.");
1156 return true;
1157 }
1158
1159 if (argv.size() < 2) return false;
1160
1161 return NetworkClientConnectGame(argv[1], COMPANY_NEW_COMPANY);
1162}
1163
1164/*********************************
1165 * script file console commands

Callers

nothing calls this directly

Calls 4

NetworkClientConnectGameFunction · 0.85
IConsolePrintFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected