Selaa lähdekoodia

Einiege flüchtigkeitsfehler behoben

Kolja Strohm 6 vuotta sitten
vanhempi
commit
42395d28ff

+ 2 - 2
KSGNetwork/EditorClient.cpp

@@ -128,10 +128,10 @@ bool EditorClient::verbinde()
     k = new Network::Klient();
     int l = 0;
     char *key;
-    Keys::getServerKey( &key, l, Keys::LOGIN, Keys::SENDEN );
+    Keys::getServerKey( &key, l, Keys::EDITOR, Keys::SENDEN );
     k->setSendeKey( key, l );
     delete[] key;
-    Keys::getServerKey( &key, l, Keys::LOGIN, Keys::EMPFANGEN );
+    Keys::getServerKey( &key, l, Keys::EDITOR, Keys::EMPFANGEN );
     k->setEmpfangKey( key, l );
     delete[] key;
     if( k->verbinde( port, ip ) )

+ 5 - 3
KSGNetwork/InformationClient.cpp

@@ -1766,7 +1766,7 @@ HistorieServerClient *InformationClient::createHistorieServerClient( int spielId
         k->getNachrichtEncrypted( (char*)&ret, 1 );
         if( ret == 1 )
         {
-            k->getNachrichtEncrypted( (char*)port, 4 );
+            k->getNachrichtEncrypted( (char*)&port, 4 );
             char län = 0;
             k->getNachrichtEncrypted( &län, 1 );
             char *ip = new char[ län + 1 ];
@@ -1787,6 +1787,8 @@ HistorieServerClient *InformationClient::createHistorieServerClient( int spielId
         k->getNachrichtEncrypted( f, byte );
         err = f;
         delete[] f;
+        cs.unlock();
+        return 0;
     }
     err = "Unbekannter Fehler";
     cs.unlock();
@@ -1927,7 +1929,7 @@ EditorServerClient *InformationClient::createEditorServerClient( int karteId )
             char län = 0;
             k->getNachrichtEncrypted( &län, 1 );
             char *ip = new char[ län + 1 ];
-            ip[ län - 1 ] = 0;
+            ip[ län ] = 0;
             k->getNachrichtEncrypted( ip, län );
             EditorClient *ret = new EditorClient( cId, (unsigned short)port, ip, this->key, this->keyLen );
             delete[] ip;
@@ -1978,7 +1980,7 @@ KartenServerClient *InformationClient::createKartenServerClient( int karteId )
             char län = 0;
             k->getNachrichtEncrypted( &län, 1 );
             char *ip = new char[ län + 1 ];
-            ip[ län - 1 ] = 0;
+            ip[ län ] = 0;
             k->getNachrichtEncrypted( ip, län );
             KartenClient *ret = new KartenClient( cId, (unsigned short)port, ip, this->key, this->keyLen );
             delete[] ip;

+ 1 - 1
KSGNetwork/KSGNetwork.vcxproj

@@ -159,7 +159,7 @@
     <ClInclude Include="KartenClient.h" />
     <ClInclude Include="Keys.h" />
     <ClInclude Include="LoginClient.h" />
-    <ClInclude Include="Main.cpp" />
+    <ClCompile Include="Main.cpp" />
     <ClInclude Include="MainClient.h" />
     <ClInclude Include="MinigameClient.h" />
     <ClInclude Include="NewsClient.h" />

+ 2 - 2
KSGNetwork/Main.cpp

@@ -8,7 +8,7 @@ extern "C"
 
     // Erzeugt einen neuen Client beim Serversystem.
     //  registerSSL Methode muss aufgerufen werden um den Client beim Serversystem anzumelden
-    MainServerClient *createMainServerClient()
+    __declspec( dllexport ) MainServerClient *createMainServerClient()
     {
         return new MainClient();
     }
@@ -16,7 +16,7 @@ extern "C"
     //  ip: Die Ip des Main Servers für angemeldete Clients
     //  port: Der Port des Main Servers für angemeldete Clients
     //  klientId: Die Id die der Client durch das Anmelden bekommen hat
-    MainServerClient *createRegisterdMainServerClient( char *ip, unsigned short port, int klientId, char *key, unsigned char keyLen )
+    __declspec( dllexport ) MainServerClient *createRegisterdMainServerClient( char *ip, unsigned short port, int klientId, char *key, unsigned char keyLen )
     {
         return new MainClient( ip, port, klientId, key, keyLen );
     }

+ 0 - 11
KSGNetwork/MainClient.cpp

@@ -170,7 +170,6 @@ ErhaltungServerClient *MainClient::createErhaltungServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -222,7 +221,6 @@ PatchServerClient *MainClient::createPatchServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -274,7 +272,6 @@ NewsServerClient *MainClient::createNewsServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -326,7 +323,6 @@ RegisterServerClient *MainClient::createRegisterServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -378,7 +374,6 @@ LoginServerClient *MainClient::createLoginServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -430,7 +425,6 @@ InformationServerClient *MainClient::createInformationServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -482,7 +476,6 @@ ChatServerClient *MainClient::createChatServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -534,7 +527,6 @@ ShopServerClient *MainClient::createShopServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -586,7 +578,6 @@ AnmeldungServerClient *MainClient::createAnmeldungServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }
@@ -638,7 +629,6 @@ MinigameServerClient *MainClient::createMinigameServerClient()
         connect();
     if( !k )
     {
-        err = "no connection to minigame Server";
         cs.unlock();
         return 0;
     }
@@ -707,7 +697,6 @@ bool MainClient::unregister()
         connect();
     if( !k )
     {
-        err = "no connection to Main Server";
         cs.unlock();
         return 0;
     }