Fixing server announcement. Gui callback still needed.

This commit is contained in:
lotodore
2009-11-08 09:48:01 +00:00
parent f1c213b707
commit 5424aed21e
9 changed files with 54 additions and 34 deletions
+15 -3
View File
@@ -266,7 +266,7 @@ void Session::clientJoinGame(unsigned gameId, const std::string &password)
myNetClient->SendJoinGame(gameId, password);
}
void Session::startNetworkServer()
void Session::startNetworkServer(bool dedicated)
{
if (myNetServer)
{
@@ -304,11 +304,23 @@ void Session::startNetworkServer()
myConfig->readConfigString("LobbyIRCChannelPassword"));
}
ServerMode mode;
if (dedicated)
{
#ifdef POKERTH_OFFICIAL_SERVER
mode = SERVER_MODE_INTERNET_AUTH;
#else
mode = SERVER_MODE_INTERNET_NOAUTH;
#endif
}
else
mode = SERVER_MODE_LAN;
myNetServer->Init(
myConfig->readConfigInt("ServerPort"),
myConfig->readConfigInt("ServerUseIpv6") == 1,
myConfig->readConfigInt("ServerUseSctp") == 1 ? NETWORK_MODE_TCP_SCTP : NETWORK_MODE_TCP,
myConfig->readConfigString("ServerPassword"),
myConfig->readConfigInt("ServerUseSctp") == 1 ? TRANSPORT_PROTOCOL_TCP_SCTP : TRANSPORT_PROTOCOL_TCP,
mode,
myQtToolsInterface->stringFromUtf8(myConfig->readConfigString("LogDir")),
tmpIrcAdminThread,
tmpIrcLobbyThread