فهرست منبع

An neues Framework angepasst

Kolja Strohm 5 سال پیش
والد
کامیت
a0d9871b8f
3فایلهای تغییر یافته به همراه89 افزوده شده و 109 حذف شده
  1. 5 1
      AppServer Linux/AppServer Linux.vcxproj
  2. 84 104
      AppServer/AppServer.cpp
  3. 0 4
      AppServer/AppServer.h

+ 5 - 1
AppServer Linux/AppServer Linux.vcxproj

@@ -50,7 +50,7 @@
     <TargetName>AppServer</TargetName>
     <TargetExt />
     <RemoteProjectDir>$(RemoteRootDir)/Server/AppServer/debug</RemoteProjectDir>
-    <IncludePath>..\..\..\Allgemein\Framework;../../../Framework/debug;..\..\..\Allgemein\Network\Network;../../../Network/debug;..\..\..\Allgemein\sql\sql;../../../sql/debug;..\AppServer;$(IncludePath)</IncludePath>
+    <IncludePath>..\..\..\Allgemein\Framework;..\..\..\Allgemein\Network\Network;../../../Network/debug;..\..\..\Allgemein\sql\sql;../../../sql/debug;..\AppServer;$(IncludePath)</IncludePath>
     <LibraryPath>
     </LibraryPath>
     <OutDir>$(ProjectDir)bin\$(Platform)\debug\</OutDir>
@@ -73,6 +73,9 @@
       <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
     </Link>
     <ClCompile />
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(RemoteRootDir)/Framework/debug;$(RemoteRootDir)/Network/debug;$(RemoteRootDir)/sql/debug;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Link>
@@ -82,6 +85,7 @@
     </Link>
     <ClCompile>
       <AdditionalOptions>-Wl,-rpath,../lib %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalIncludeDirectories>$(RemoteRootDir)/Framework/release;$(RemoteRootDir)/Network/release;$(RemoteRootDir)/sql/release;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 84 - 104
AppServer/AppServer.cpp

@@ -30,7 +30,6 @@ AppServer::AppServer( InitDatei *zDat )
     }
     end = 0;
     InitializeCriticalSection( &cs );
-    ref = 1;
     if( zDat->wertExistiert( "Aktiv" ) && zDat->zWert( "Aktiv" )->istGleich( "TRUE" ) )
         serverStarten();
 }
@@ -65,7 +64,7 @@ void AppServer::runn()
         }
         if( !klient )
             continue;
-        AppSAKlient *clHandle = new AppSAKlient( klient, getThis() );
+        AppSAKlient * clHandle = new AppSAKlient( klient, (AppServer *)getThis() );
         clHandle->start();
     }
 }
@@ -79,7 +78,7 @@ void AppServer::thread()
         if( !klient )
             continue;
         Framework::getThreadRegister()->cleanUpClosedThreads();
-        AppSKlient *clHandle = new AppSKlient( klient, getThis() );
+        AppSKlient * clHandle = new AppSKlient( klient, (AppServer *)getThis() );
         clHandle->start();
         clients++;
     }
@@ -166,29 +165,10 @@ bool AppServer::hatClients() const
     return clients > 0;
 }
 
-// Reference Counting
-AppServer *AppServer::getThis()
-{
-    EnterCriticalSection( &cs );
-    ref++;
-    LeaveCriticalSection( &cs );
-    return this;
-}
-
-AppServer *AppServer::release()
-{
-    EnterCriticalSection( &cs );
-    ref--;
-    LeaveCriticalSection( &cs );
-    if( !ref )
-        delete this;
-    return 0;
-}
-
 
 // Inhalt der AppSKlient Klasse aus AppServer.h
 // Konstruktor 
-AppSAKlient::AppSAKlient( SSLSKlient *klient, AppServer *appS )
+AppSAKlient::AppSAKlient( SSLSKlient * klient, AppServer * appS )
     : Thread()
 {
     this->klient = klient;
@@ -226,13 +206,13 @@ void AppSAKlient::thread()
                 {
                     klient->sende( "\1", 1 );
                     unsigned char nLen = 0;
-                    klient->getNachricht( (char*)&nLen, 1 );
+                    klient->getNachricht( (char *)& nLen, 1 );
                     char *n = new char[ nLen + 1 ];
                     n[ (int)nLen ] = 0;
                     if( nLen )
                         klient->getNachricht( n, nLen );
                     unsigned char pLen = 0;
-                    klient->getNachricht( (char*)&pLen, 1 );
+                    klient->getNachricht( (char *)& pLen, 1 );
                     char *p = new char[ pLen + 1 ];
                     p[ (int)pLen ] = 0;
                     if( pLen )
@@ -309,7 +289,7 @@ void AppSAKlient::thread()
                     }
                     else
                         ok = 1;
-                    if( ok && appS->hatClients() )
+                    if( ok &&appS->hatClients() )
                     {
                         errorZuKlient( "Es sind noch Klients Online. Bitte versuche es später erneut." );
                         break;
@@ -385,14 +365,14 @@ void AppSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fe
 
 // Inhalt der AppSKlient Klasse aus AppServer.h
 // Konstruktor 
-AppSKlient::AppSKlient( SKlient *klient, AppServer *appS )
+AppSKlient::AppSKlient( SKlient * klient, AppServer * appS )
     : Thread()
 {
     std::cout << "New Client aktuell:" << appS->getClients() << "\n";
     this->klient = klient;
     unsigned char key[ 20 ] = { 74, 103, 6, 115, 185, 240, 35, 53, 108, 55, 120, 253, 1, 232, 78, 254, 183, 223, 101, 9 };
-    klient->setSendeKey( (char*)key, 20 );
-    klient->setEmpfangKey( (char*)key, 20 );
+    klient->setSendeKey( (char *)key, 20 );
+    klient->setEmpfangKey( (char *)key, 20 );
     this->appS = appS;
     accountId = 0;
     tmo = new AppSKTimeOut( this );
@@ -448,12 +428,12 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     unsigned char l = 0;
-                    klient->getNachrichtEncrypted( (char*)&l, 1 );
+                    klient->getNachrichtEncrypted( (char *)& l, 1 );
                     char *name = new char[ l + 1 ];
                     name[ (int)l ] = 0;
                     if( l )
                         klient->getNachrichtEncrypted( name, l );
-                    klient->getNachrichtEncrypted( (char*)&l, 1 );
+                    klient->getNachrichtEncrypted( (char *)& l, 1 );
                     char *passwort = new char[ l + 1 ];
                     passwort[ (int)l ] = 0;
                     if( l )
@@ -465,7 +445,7 @@ void AppSKlient::thread()
                         klient->sendeEncrypted( "\1", 1 );
                     else
                         klient->sende( "\0", 1 );
-                    if( accountId && appS->zDB()->istNeu( accountId ) )
+                    if( accountId &&appS->zDB()->istNeu( accountId ) )
                         klient->sendeEncrypted( "\1", 1 );
                     else if( accountId )
                         klient->sendeEncrypted( "\0", 1 );
@@ -476,15 +456,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltBloeckeScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -498,15 +478,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltMauerScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -520,15 +500,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltFarbenScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -542,15 +522,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltFangenScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -564,15 +544,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltRennenScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -586,15 +566,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int num = 0;
-                    klient->getNachrichtEncrypted( (char*)&num, 4 );
+                    klient->getNachrichtEncrypted( (char *)& num, 4 );
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *namen = new RCArray< Text >();
                     num = appS->zDB()->getWeltGesamtScore( num, score, namen );
-                    klient->sendeEncrypted( (char*)&num, 4 );
+                    klient->sendeEncrypted( (char *)& num, 4 );
                     for( int i = 0; i < num; i++ )
                     {
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char l = (char)namen->z( i )->getLength();
                         klient->sendeEncrypted( &l, 1 );
                         klient->sendeEncrypted( namen->z( i )->getText(), l );
@@ -614,7 +594,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getBloeckeScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 9: // Frage nach Mauer Score
@@ -628,7 +608,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getMauerScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 10: // Frage nach Farben Score
@@ -642,7 +622,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getFarbenScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 11: // Frage nach Fangen Score
@@ -656,7 +636,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getFangenScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 12: // Frage nach Rennen Score
@@ -670,7 +650,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getRennenScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 13: // Frage nach Gesamt Score
@@ -684,7 +664,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = appS->zDB()->getGesamtScore( accountId );
-                    klient->sendeEncrypted( (char*)&score, 4 );
+                    klient->sendeEncrypted( (char *)& score, 4 );
                     break;
                 }
             case 14: // Frage nach Mauer Zeit
@@ -698,9 +678,9 @@ void AppSKlient::thread()
                         break;
                     }
                     int level = 0;
-                    klient->getNachrichtEncrypted( (char*)&level, 4 );
+                    klient->getNachrichtEncrypted( (char *)& level, 4 );
                     int sek = appS->zDB()->getMauerZeit( accountId, level );
-                    klient->sendeEncrypted( (char*)&sek, 4 );
+                    klient->sendeEncrypted( (char *)& sek, 4 );
                     break;
                 }
             case 15: // Set Blöcke Score
@@ -714,7 +694,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = 0;
-                    klient->getNachrichtEncrypted( (char*)&score, 4 );
+                    klient->getNachrichtEncrypted( (char *)& score, 4 );
                     appS->zDB()->setBloeckeScore( accountId, score );
                     klient->sendeEncrypted( "\1", 1 );
                     break;
@@ -730,7 +710,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = 0;
-                    klient->getNachrichtEncrypted( (char*)&score, 4 );
+                    klient->getNachrichtEncrypted( (char *)& score, 4 );
                     appS->zDB()->setFarbenScore( accountId, score );
                     klient->sendeEncrypted( "\1", 1 );
                     break;
@@ -746,7 +726,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = 0;
-                    klient->getNachrichtEncrypted( (char*)&score, 4 );
+                    klient->getNachrichtEncrypted( (char *)& score, 4 );
                     appS->zDB()->setFangenScore( accountId, score );
                     klient->sendeEncrypted( "\1", 1 );
                     break;
@@ -762,7 +742,7 @@ void AppSKlient::thread()
                         break;
                     }
                     int score = 0;
-                    klient->getNachrichtEncrypted( (char*)&score, 4 );
+                    klient->getNachrichtEncrypted( (char *)& score, 4 );
                     appS->zDB()->setRennenScore( accountId, score );
                     klient->sendeEncrypted( "\1", 1 );
                     break;
@@ -778,9 +758,9 @@ void AppSKlient::thread()
                         break;
                     }
                     int level = 0;
-                    klient->getNachrichtEncrypted( (char*)&level, 4 );
+                    klient->getNachrichtEncrypted( (char *)& level, 4 );
                     int zeit = 0;
-                    klient->getNachrichtEncrypted( (char*)&zeit, 4 );
+                    klient->getNachrichtEncrypted( (char *)& zeit, 4 );
                     appS->zDB()->setMauerZeit( accountId, level, zeit );
                     klient->sendeEncrypted( "\1", 1 );
                     break;
@@ -790,7 +770,7 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     unsigned char len[ 4 ] = { 0, 0, 0, 0 };
-                    klient->getNachrichtEncrypted( (char*)len, 4 );
+                    klient->getNachrichtEncrypted( (char *)len, 4 );
                     char *acc_name = new char[ len[ 0 ] + 1 ];
                     acc_name[ len[ 0 ] ] = 0;
                     klient->getNachrichtEncrypted( acc_name, len[ 0 ] );
@@ -804,7 +784,7 @@ void AppSKlient::thread()
                     acc_mail[ len[ 3 ] ] = 0;
                     klient->getNachrichtEncrypted( acc_mail, len[ 3 ] );
                     unsigned short acc_geb_jahr = 0;
-                    klient->getNachrichtEncrypted( (char*)&acc_geb_jahr, 2 );
+                    klient->getNachrichtEncrypted( (char *)& acc_geb_jahr, 2 );
                     char acc_geb_monat = 0;
                     klient->getNachrichtEncrypted( &acc_geb_monat, 1 );
                     char acc_geb_tag = 0;
@@ -841,15 +821,15 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int level = 0;
-                    klient->getNachrichtEncrypted( (char*)&level, 4 );
+                    klient->getNachrichtEncrypted( (char *)& level, 4 );
                     int sek = 0;
-                    klient->getNachrichtEncrypted( (char*)&sek, 4 );
+                    klient->getNachrichtEncrypted( (char *)& sek, 4 );
                     if( accountId )
                         appS->zDB()->markballsFinish( level, sek, accountId, 0, 0, 0, 0 );
                     else
                     {
                         unsigned char l = 0;
-                        klient->getNachrichtEncrypted( (char*)&l, 1 );
+                        klient->getNachrichtEncrypted( (char *)& l, 1 );
                         char *device = new char[ l + 1 ];
                         device[ (int)l ] = 0;
                         klient->getNachrichtEncrypted( device, l );
@@ -867,13 +847,13 @@ void AppSKlient::thread()
                     Array< int > *score = new Array< int >();
                     RCArray< Text > *name = new RCArray< Text >();
                     int anz = appS->zDB()->getMarkballsScore( level, score, name, 0 );
-                    klient->sendeEncrypted( (char*)&anz, 4 );
+                    klient->sendeEncrypted( (char *)& anz, 4 );
                     for( int i = 0; i < anz; i++ )
                     {
                         int l = level->get( i );
-                        klient->sendeEncrypted( (char*)&l, 4 );
+                        klient->sendeEncrypted( (char *)& l, 4 );
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                         char nl = (char)name->z( i )->getLength();
                         klient->sendeEncrypted( &nl, 1 );
                         if( nl )
@@ -889,17 +869,17 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     unsigned char l = 0;
-                    klient->getNachrichtEncrypted( (char*)&l, 1 );
+                    klient->getNachrichtEncrypted( (char *)& l, 1 );
                     char *name = new char[ l + 1 ];
                     name[ (int)l ] = 0;
                     if( l )
                         klient->getNachrichtEncrypted( name, l );
-                    klient->getNachrichtEncrypted( (char*)&l, 1 );
+                    klient->getNachrichtEncrypted( (char *)& l, 1 );
                     char *passwort = new char[ l + 1 ];
                     passwort[ (int)l ] = 0;
                     if( l )
                         klient->getNachrichtEncrypted( passwort, l );
-                    klient->getNachrichtEncrypted( (char*)&l, 1 );
+                    klient->getNachrichtEncrypted( (char *)& l, 1 );
                     char *device = new char[ l + 1 ];
                     device[ (int)l ] = 0;
                     if( l )
@@ -922,23 +902,23 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int level = 0;
-                    klient->getNachrichtEncrypted( (char*)&level, 4 );
+                    klient->getNachrichtEncrypted( (char *)& level, 4 );
                     int sek = 0;
-                    klient->getNachrichtEncrypted( (char*)&sek, 4 );
+                    klient->getNachrichtEncrypted( (char *)& sek, 4 );
                     int diff = 0;
-                    klient->getNachrichtEncrypted( (char*)&diff, 4 );
+                    klient->getNachrichtEncrypted( (char *)& diff, 4 );
                     int gId = 0;
-                    klient->getNachrichtEncrypted( (char*)&gId, 4 );
+                    klient->getNachrichtEncrypted( (char *)& gId, 4 );
                     if( accountId )
                     {
                         int kupfer = 0;
-                        klient->getNachrichtEncrypted( (char*)&kupfer, 4 );
+                        klient->getNachrichtEncrypted( (char *)& kupfer, 4 );
                         appS->zDB()->markballsFinish( level, sek, accountId, 0, diff, kupfer, gId );
                     }
                     else
                     {
                         unsigned char l = 0;
-                        klient->getNachrichtEncrypted( (char*)&l, 1 );
+                        klient->getNachrichtEncrypted( (char *)& l, 1 );
                         char *device = new char[ l + 1 ];
                         device[ (int)l ] = 0;
                         klient->getNachrichtEncrypted( device, l );
@@ -953,17 +933,17 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int diff = 0;
-                    klient->getNachrichtEncrypted( (char*)&diff, 4 );
+                    klient->getNachrichtEncrypted( (char *)& diff, 4 );
                     Array< int > *level = new Array< int >();
                     Array< int > *score = new Array< int >();
                     int anz = appS->zDB()->getMarkballsScore( level, score, diff );
-                    klient->sendeEncrypted( (char*)&anz, 4 );
+                    klient->sendeEncrypted( (char *)& anz, 4 );
                     for( int i = 0; i < anz; i++ )
                     {
                         int l = level->get( i );
-                        klient->sendeEncrypted( (char*)&l, 4 );
+                        klient->sendeEncrypted( (char *)& l, 4 );
                         int s = score->get( i );
-                        klient->sendeEncrypted( (char*)&s, 4 );
+                        klient->sendeEncrypted( (char *)& s, 4 );
                     }
                     level->release();
                     score->release();
@@ -981,20 +961,20 @@ void AppSKlient::thread()
                     else
                     {
                         unsigned char l = 0;
-                        klient->getNachrichtEncrypted( (char*)&l, 1 );
+                        klient->getNachrichtEncrypted( (char *)& l, 1 );
                         char *device = new char[ l + 1 ];
                         device[ (int)l ] = 0;
                         klient->getNachrichtEncrypted( device, l );
                         anz = appS->zDB()->getGegenstaende( 0, device, gId, diff );
                         delete[] device;
                     }
-                    klient->sendeEncrypted( (char*)&anz, 4 );
+                    klient->sendeEncrypted( (char *)& anz, 4 );
                     for( int i = 0; i < anz; i++ )
                     {
                         int g = gId->get( i );
-                        klient->sendeEncrypted( (char*)&g, 4 );
+                        klient->sendeEncrypted( (char *)& g, 4 );
                         int d = diff->get( i );
-                        klient->sendeEncrypted( (char*)&d, 4 );
+                        klient->sendeEncrypted( (char *)& d, 4 );
                     }
                     gId->release();
                     diff->release();
@@ -1009,7 +989,7 @@ void AppSKlient::thread()
                     {
                         klient->sendeEncrypted( "\1", 1 );
                         int ret = appS->zDB()->getKupfer( accountId );
-                        klient->sendeEncrypted( (char*)&ret, 4 );
+                        klient->sendeEncrypted( (char *)& ret, 4 );
                     }
                     break;
                 }
@@ -1024,18 +1004,18 @@ void AppSKlient::thread()
                     else
                     {
                         unsigned char l = 0;
-                        klient->getNachrichtEncrypted( (char*)&l, 1 );
+                        klient->getNachrichtEncrypted( (char *)& l, 1 );
                         char *device = new char[ l + 1 ];
                         device[ (int)l ] = 0;
                         klient->getNachrichtEncrypted( device, l );
                         anz = appS->zDB()->getMarkballsFortschritt( 0, device, fortschritt );
                         delete[] device;
                     }
-                    klient->sendeEncrypted( (char*)&anz, 4 );
+                    klient->sendeEncrypted( (char *)& anz, 4 );
                     for( int i = 0; i < anz; i++ )
                     {
                         int f = fortschritt->get( i );
-                        klient->sendeEncrypted( (char*)&f, 4 );
+                        klient->sendeEncrypted( (char *)& f, 4 );
                     }
                     fortschritt->release();
                     break;
@@ -1044,17 +1024,17 @@ void AppSKlient::thread()
             {
                 klient->sendeEncrypted( "\1", 1 );
                 unsigned char l = 0;
-                klient->getNachrichtEncrypted( (char*)&l, 1 );
+                klient->getNachrichtEncrypted( (char *)& l, 1 );
                 char *name = new char[ l + 1 ];
                 name[ (int)l ] = 0;
                 if( l )
                     klient->getNachrichtEncrypted( name, l );
-                klient->getNachrichtEncrypted( (char*)&l, 1 );
+                klient->getNachrichtEncrypted( (char *)& l, 1 );
                 char *passwort = new char[ l + 1 ];
                 passwort[ (int)l ] = 0;
                 if( l )
                     klient->getNachrichtEncrypted( passwort, l );
-                klient->getNachrichtEncrypted( (char*)&l, 1 );
+                klient->getNachrichtEncrypted( (char *)& l, 1 );
                 char *device = new char[ l + 1 ];
                 device[ (int)l ] = 0;
                 if( l )
@@ -1075,7 +1055,7 @@ void AppSKlient::thread()
                 {
                     klient->sendeEncrypted( "\1", 1 );
                     int kupfer = 0;
-                    klient->getNachrichtEncrypted( (char*)&kupfer, 4 );
+                    klient->getNachrichtEncrypted( (char *)& kupfer, 4 );
                     appS->zDB()->addKupfer( accountId, kupfer );
                 }
                 else
@@ -1095,11 +1075,11 @@ void AppSKlient::thread()
                     klient->sendeEncrypted( "\0", 1 );
                 break;
             }
-			case 37: // keppAlive
-			{
-				klient->sendeEncrypted( "\1", 1 );
-				break;
-			}
+            case 37: // keppAlive
+            {
+                klient->sendeEncrypted( "\1", 1 );
+                break;
+            }
             default:
                 klient->sendeEncrypted( "\0", 1 );
                 br = true;
@@ -1118,7 +1098,7 @@ void AppSKlient::thread()
 
 void AppSKlient::timeout()
 {
-	klient->trenne();
+    klient->trenne();
 }
 
 void AppSKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
@@ -1132,7 +1112,7 @@ void AppSKlient::errorZuKlient( const char *nachricht ) const // sendet eine Feh
 
 // Inhalt der AppSKTimeOut Klasse aus AppServer.h
 // Konstruktor
-AppSKTimeOut::AppSKTimeOut( AppSKlient *zK )
+AppSKTimeOut::AppSKTimeOut( AppSKlient * zK )
 {
     zKlient = zK;
     zm = new ZeitMesser();

+ 0 - 4
AppServer/AppServer.h

@@ -24,7 +24,6 @@ private:
     int gesendet;
     int clients;
     bool end;
-    int ref;
 
 public:
     // Konstruktor 
@@ -46,9 +45,6 @@ public:
     AppSDatenbank *zDB() const;
     int getClients() const;
     bool hatClients() const;
-    // Reference Counting
-    AppServer *getThis();
-    AppServer *release();
 };
 
 class AppSAKlient : public Thread