WebSocket protocol support can now be configured and is only used in the dedicated server.

This commit is contained in:
lotodore
2013-10-03 00:41:07 +02:00
parent d23cc87c93
commit 04abfb658d
7 changed files with 23 additions and 9 deletions
+9 -1
View File
@@ -330,10 +330,18 @@ void Session::startNetworkServer(bool dedicated)
myNetServer = ServerManagerFactory::CreateServerManager(*myConfig, *myGui, mode, *myAvatarManager);
int protocol = TRANSPORT_PROTOCOL_TCP;
if (dedicated && myConfig->readConfigInt("ServerUseWebSocket") == 1) {
protocol |= TRANSPORT_PROTOCOL_WEBSOCKET;
}
if (myConfig->readConfigInt("ServerUseSctp") == 1) {
protocol |= TRANSPORT_PROTOCOL_SCTP;
}
myNetServer->Init(
myConfig->readConfigInt("ServerPort"),
myConfig->readConfigInt("ServerWebSocketPort"),
myConfig->readConfigInt("ServerUseIpv6") == 1,
myConfig->readConfigInt("ServerUseSctp") == 1 ? TRANSPORT_PROTOCOL_TCP_SCTP : TRANSPORT_PROTOCOL_TCP,
protocol,
myQtToolsInterface->stringFromUtf8(myConfig->readConfigString("LogDir"))
);