Browse Source

send port of unencrypted server to clients

Kolja Strohm 3 years ago
parent
commit
a3d41f9ca7
2 changed files with 8 additions and 0 deletions
  1. 7 0
      FactoryCraft/Server.cpp
  2. 1 0
      FactoryCraft/Server.h

+ 7 - 0
FactoryCraft/Server.cpp

@@ -161,6 +161,11 @@ bool FactoryCraftServer::hatClients() const
     return klients->hat( 0 );
 }
 
+int FactoryCraftServer::getUnencryptedPort() const
+{
+    return server->getPort();
+}
+
 Game* FactoryCraftServer::zGame() const
 {
     return game;
@@ -304,6 +309,8 @@ void FCKlient::thread()
                                 klient->sende( "\1", 1 );
                                 klient->sende( (char*)&authKeyLen, 4 );
                                 klient->sende( authKey, authKeyLen );
+                                int port = ls->getUnencryptedPort();
+                                klient->sende( (char*)&port, 4 );
                                 ok = true;
                             }
                         }

+ 1 - 0
FactoryCraft/Server.h

@@ -37,6 +37,7 @@ public:
     bool absturzKlient( int accountId );
     bool removeKlient( FCKlient* zKlient );
     bool hatClients() const;
+    int getUnencryptedPort() const;
     Game* zGame() const;
 };