Ver Fonte

fix array usages

Kolja Strohm há 2 anos atrás
pai
commit
14ee636a0f

+ 10 - 2
SpielServer/Datenbank.cpp

@@ -362,7 +362,7 @@ int SSDatenbank::getSpielErstelltSpieler( int spielErstelltId, Array< int > *acc
     befehl->release();
     int ret = res.zeilenAnzahl;
     for( int i = 0; i < ret; i++ )
-        accountIds->set( TextZuInt( res.values[ i ].getText(), 10 ), i );
+        accountIds->add( TextZuInt( res.values[ i ].getText(), 10 ) );
     res.destroy();
     return ret;
 }
@@ -554,11 +554,15 @@ bool SSDatenbank::spielErstelltAbbruch( int spielErstelltId, int anzahl, Array<
                     befehl->append( "' )" );
                     if( datenbank->befehl( befehl->getText() ) )
                     {
+                        while( !inWarteschlange->hat( j ) )
+                            inWarteschlange->add( 0 );
                         inWarteschlange->set( 1, j );
                         Zeit *jetzt = getZeit();
                         Zeit *anmeldung = new Zeit();
                         anmeldung->setZeit( "y-m-d h:i:s", acc.values[ i * 2 + 1 ].getText() );
                         jetzt->minusZeit( anmeldung );
+                        while( !zeit->hat( j ) )
+                            zeit->add( 0 );
                         zeit->set( jetzt, j );
                     }
                 }
@@ -606,7 +610,11 @@ bool SSDatenbank::spielErstelltAbbruch( int spielErstelltId, int anzahl, Array<
                     {
                         if( accounts->hat( k ) && akkId == accounts->get( k ) )
                         {
+                            while( !inWarteschlange->hat( j ) )
+                                inWarteschlange->add( 0 );
                             inWarteschlange->set( 1, k );
+                            while( !zeit->hat( j ) )
+                                zeit->add( 0 );
                             zeit->set( dynamic_cast<Zeit *>( jetzt->getThis() ), k );
                         }
                     }
@@ -714,7 +722,7 @@ int SSDatenbank::getSpielerAusGruppe( int gruppeId, Array< int > *accounts )
     befehl->release();
     int ret = res.zeilenAnzahl;
     for( int i = 0; i < ret; i++ )
-        accounts->set( TextZuInt( res.values[ i ].getText(), 10 ), i );
+        accounts->add( TextZuInt( res.values[ i ].getText(), 10 ) );
     res.destroy();
     return ret;
 }

+ 4 - 4
SpielServer/KartenLeser.cpp

@@ -137,7 +137,7 @@ bool KartenLeser::ladeSpielerTeamStruktur( SpielerTeamStruktur *sts )
     {
         int farbe = 0;
         datei->lese( (char *)&farbe, 4 );
-        sts->spielerFarbe->set( farbe, i );
+        sts->spielerFarbe->add( farbe );
     }
     if( sts->teamFarbe )
         sts->teamFarbe->release();
@@ -146,7 +146,7 @@ bool KartenLeser::ladeSpielerTeamStruktur( SpielerTeamStruktur *sts )
     {
         int farbe = 0;
         datei->lese( (char *)&farbe, 4 );
-        sts->teamFarbe->set( farbe, i );
+        sts->teamFarbe->add( farbe );
     }
     if( sts->teamName )
         sts->teamName->release();
@@ -160,7 +160,7 @@ bool KartenLeser::ladeSpielerTeamStruktur( SpielerTeamStruktur *sts )
         datei->lese( txt, len );
         Text *name = new Text( txt );
         delete[] txt;
-        sts->teamName->set( name, i );
+        sts->teamName->add( name );
     }
     if( sts->teamSize )
         sts->teamSize->release();
@@ -169,7 +169,7 @@ bool KartenLeser::ladeSpielerTeamStruktur( SpielerTeamStruktur *sts )
     {
         int size = 0;
         datei->lese( (char *)&size, 4 );
-        sts->teamSize->set( size, i );
+        sts->teamSize->add( size );
     }
     datei->close();
     datei->release();

+ 34 - 2
SpielServer/Spiel.cpp

@@ -133,6 +133,8 @@ void Spiel::teamAusgleich()
                 if( !gefunden )
                     break;
             }
+            while( !spielerNummern->hat( i ) )
+                spielerNummern->add( 0 );
             spielerNummern->set( sNum, i );
         }
     }
@@ -141,15 +143,17 @@ void Spiel::teamAusgleich()
 // nicht constant
 void Spiel::setAccounts( int anzahl, Array< int > *zAccounts )
 {
+    accounts->leeren();
     for( int i = 0; i < anzahl; i++ )
-        accounts->set( zAccounts->hat( i ) ? zAccounts->get( i ) : 0, i );
+        accounts->add( zAccounts->hat( i ) ? zAccounts->get( i ) : 0 );
     spielerAnzahl = anzahl;
 }
 
 void Spiel::setKlients( int anzahl, RCArray< SSKlient > *zKlients )
 {
+    klients->leeren();
     for( int i = 0; i < anzahl; i++ )
-        klients->set( zKlients->get( i ), i );
+        klients->add( zKlients->get( i ) );
 }
 
 void Spiel::setKarteId( int karteId )
@@ -186,7 +190,11 @@ bool Spiel::klientVerbunden( SSKlient *klient )
             }
             if( state == 5 && spiel )
                 spiel->klientOnline( klient->getAccountId(), klient );
+            while( !klients->hat( i ) )
+                klients->add( 0 );
             klients->set( klient, i );
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 1, i );
             klient->setSpiel( this );
             ret = 1;
@@ -207,7 +215,11 @@ bool Spiel::klientWechseltTeam( int accountId, int team )
         for( int i = 0; i < spielerAnzahl; i++ )
         {
             if( accounts->hat( i ) && accounts->get( i ) == accountId )
+            {
+                while( !spielerNummern->hat( i ) )
+                    spielerNummern->add( 0 );
                 spielerNummern->set( 0, i );
+            }
             SSKlient *tmp = klients->z( i );
             if( tmp )
                 tmp->erstellungSpielerTeam( accountId, 0 );
@@ -237,7 +249,11 @@ bool Spiel::klientWechseltTeam( int accountId, int team )
             for( int j = 0; j < spielerAnzahl; j++ )
             {
                 if( accounts->hat( j ) && accounts->get( j ) == accountId )
+                {
+                    while( !spielerNummern->hat( j ) )
+                        spielerNummern->add( 0 );
                     spielerNummern->set( i, j );
+                }
                 SSKlient *tmp = klients->z( j );
                 if( tmp )
                     tmp->erstellungSpielerTeam( accountId, i );
@@ -290,8 +306,14 @@ bool Spiel::klientGetrennt( SSKlient *zKlient )
                         statistik->klientOffline( zKlient->getAccountId() );
                 }
                 zKlient->setSpielErstellt( 0 );
+                while( !spielerNummern->hat( i ) )
+                    spielerNummern->add( 0 );
                 spielerNummern->set( 0, i );
+                while( !status->hat( i ) )
+                    status->add( 0 );
                 status->set( 0, i );
+                while( !klients->hat( i ) )
+                    klients->add( 0 );
                 klients->set( 0, i );
                 ret = 1;
             }
@@ -307,6 +329,8 @@ bool Spiel::klientTeamAuswahlFertig( int accountId )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !teamAuswahlFertig->hat( i ) )
+                teamAuswahlFertig->add( 0 );
             teamAuswahlFertig->set( 1, i );
             return 1;
         }
@@ -322,6 +346,8 @@ bool Spiel::klientBereitZumLaden( int accountId )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 2, i );
             return 1;
         }
@@ -337,6 +363,8 @@ bool Spiel::klientSpielLadenProzent( int accountId, int prozent )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !this->prozent->hat( i ) )
+                this->prozent->add( 0 );
             this->prozent->set( prozent, i );
             return 1;
         }
@@ -352,6 +380,8 @@ bool Spiel::klientBereitZumSpiel( int accountId )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 3, i );
             return 1;
         }
@@ -459,6 +489,8 @@ void Spiel::thread()
             tg += sts->teamSize->hat( j ) ? sts->teamSize->get( j ) : 0;
             if( sNum < tg )
             {
+                while( !teams->hat( i ) )
+                    teams->add( 0 );
                 teams->set( j, i );
                 break;
             }

+ 21 - 0
SpielServer/SpielErstellt.cpp

@@ -120,7 +120,11 @@ bool SpielErstellt::klientVerbunden( SSKlient *klient )
         {
             if( state == 1 )
                 klient->spielGefunden( karte );
+            while( !klients->hat( i ) )
+                klients->add( 0 );
             klients->set( klient, i );
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 1, i );
             verbunden++;
             klient->setSpielErstellt( this );
@@ -142,6 +146,8 @@ bool SpielErstellt::klientNimmtAn( int accountId )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 2, i );
             ret = 1;
             break;
@@ -159,6 +165,8 @@ bool SpielErstellt::klientLehntAb( int accountId )
     {
         if( accounts->hat( i ) && accounts->get( i ) == accountId )
         {
+            while( !status->hat( i ) )
+                status->add( 0 );
             status->set( 3, i );
             ret = 1;
             break;
@@ -180,8 +188,12 @@ bool SpielErstellt::klientGetrennt( SSKlient *zKlient )
             if( status->hat( i ) && status->get( i ) != 0 )
             {
                 zKlient->setSpielErstellt( 0 );
+                while( !status->hat( i ) )
+                    status->add( 0 );
                 status->set( 0, i );
                 verbunden--;
+                while( !klients->hat( i ) )
+                    klients->add( 0 );
                 klients->set( 0, i );
                 ret = 1;
             }
@@ -213,7 +225,12 @@ void SpielErstellt::thread()
                 for( int j = 0; j < spielerAnzahl; j++ )
                 {
                     if( j != i )
+                    {
+                        while( !status->hat( j ) )
+                            status->add( 0 );
                         status->set( 2, j );
+                    }
+                    
                 }
                 break;
             }
@@ -266,7 +283,11 @@ void SpielErstellt::thread()
         err = "Das Spiel wurde Wegen abwesenheit eines Spielers Abgebrochen.";
         abbruch = 1;
         for( int j = 0; j < spielerAnzahl; j++ )
+        {
+            while( !status->hat( j ) )
+                status->add( 0 );
             status->set( 2, j );
+        }
     }
     if( abbruch )
     { // Es sind nicht alle bereit Vorgang abbrechen

+ 132 - 148
SpielServer/SpielServer.cpp

@@ -11,7 +11,7 @@
 
 // Inhalt der SpielServer Klasse aus SpielServer.h
 // Konstruktor 
-SpielServer::SpielServer( InitDatei *zIni )
+SpielServer::SpielServer( InitDatei* zIni )
     : Thread()
 {
     Network::Start( 100 );
@@ -20,7 +20,7 @@ SpielServer::SpielServer( InitDatei *zIni )
     empfangen = 0;
     gesendet = 0;
     fehler = new Text();
-    ini = dynamic_cast<InitDatei *>( zIni->getThis() );
+    ini = dynamic_cast<InitDatei*>(zIni->getThis());
     id = *zIni->zWert( "ServerId" );
     server = new Server();
     aServer = new SSLServer();
@@ -47,10 +47,6 @@ SpielServer::SpielServer( InitDatei *zIni )
     spiele = new RCArray< Spiel >();
     klients = new RCArray< SSKlient >();
     spielHistorieId = new Array< int >();
-    spielErstelltAnzahl = 0;
-    spielAnzahl = 0;
-    klientAnzahl = 0;
-    klientAnzahl2 = 0;
     historieS = new HistorieSender( this );
     historieS->start();
 }
@@ -93,18 +89,18 @@ void SpielServer::runn()
 {
     while( !end && aServer->isConnected() )
     {
-        SSLSKlient *klient;
+        SSLSKlient* klient;
         klient = aServer->getKlient();
         if( end && klient )
         {
             klient->trenne();
-            klient = (SSLSKlient *)klient->release();
+            klient = (SSLSKlient*)klient->release();
             Sleep( 1000 );
             return;
         }
         if( !klient )
             continue;
-        SSAKlient *slHandle = new SSAKlient( klient, dynamic_cast<SpielServer *>( getThis() ) );
+        SSAKlient* slHandle = new SSAKlient( klient, dynamic_cast<SpielServer*>(getThis()) );
         slHandle->start();
     }
 }
@@ -113,13 +109,12 @@ void SpielServer::thread()
 {
     while( server->isConnected() )
     {
-        SKlient *klient;
+        SKlient* klient;
         klient = server->getKlient();
         if( !klient )
             continue;
         Framework::getThreadRegister()->cleanUpClosedThreads();
-        SSKlient *slHandle = new SSKlient( klient, dynamic_cast<SpielServer *>( getThis() ) );
-        klientAnzahl2++;
+        SSKlient* slHandle = new SSKlient( klient, dynamic_cast<SpielServer*>(getThis()) );
         slHandle->start();
     }
 }
@@ -132,16 +127,15 @@ void SpielServer::close()
     warteAufThread( 1000 );
 #endif
     lock();
-    for( int i = 0; i < klientAnzahl; i++ )
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
         klients->z( i )->absturz();
     if( klients )
-        klients = ( RCArray<SSKlient>* ) klients->release();
-    klientAnzahl = 0;
+        klients = (RCArray<SSKlient>*) klients->release();
     unlock();
     ende();
     run = 0;
     end = 1;
-    Klient *klient = new Klient();
+    Klient* klient = new Klient();
     klient->verbinde( aServer->getPort(), "127.0.0.1" );
     Sleep( 500 );
     aServer->trenne();
@@ -240,18 +234,17 @@ bool SpielServer::setMaxSpiele( int ms )
     return 1;
 }
 
-void SpielServer::addSpielErstellt( SpielErstellt *erstellt )
+void SpielServer::addSpielErstellt( SpielErstellt* erstellt )
 {
     lock();
-    this->erstellt->set( erstellt, spielErstelltAnzahl );
-    spielErstelltAnzahl++;
+    this->erstellt->add( erstellt );
     unlock();
 }
 
 void SpielServer::SpielErstelltAbbruch( int spielErstelltId )
 {
     lock();
-    for( int i = 0; i < spielErstelltAnzahl; i++ )
+    for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
     {
         if( erstellt->z( i )->getId() == spielErstelltId )
         {
@@ -266,12 +259,11 @@ void SpielServer::removeSpielErstellt( int id )
 {
     lock();
     bool gefunden = 0;
-    for( int i = 0; i < spielErstelltAnzahl; i++ )
+    for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
     {
         if( erstellt->z( i )->getId() == id )
         {
-            spielErstelltAnzahl--;
-            SpielErstellt *zse = erstellt->get( i );
+            SpielErstellt* zse = erstellt->get( i );
             erstellt->remove( i );
             unlock();
             zse->release();
@@ -283,13 +275,13 @@ void SpielServer::removeSpielErstellt( int id )
         unlock();
 }
 
-bool SpielServer::registerKlient( SSKlient *klient )
+bool SpielServer::registerKlient( SSKlient* klient )
 {
     lock();
     bool gefunden = 0;
-    for( int i = 0; i < klientAnzahl; i++ )
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
     {
-        SSKlient *tmp = klients->z( i );
+        SSKlient* tmp = klients->z( i );
         if( tmp )
         {
             if( tmp->getAccountId() == klient->getAccountId() )
@@ -304,10 +296,7 @@ bool SpielServer::registerKlient( SSKlient *klient )
         }
     }
     if( !gefunden )
-    {
-        klients->set( klient, klientAnzahl );
-        klientAnzahl++;
-    }
+        klients->add( klient );
     unlock();
     return 0;
 }
@@ -315,8 +304,8 @@ bool SpielServer::registerKlient( SSKlient *klient )
 bool SpielServer::absturzKlient( int klientId )
 {
     lock();
-    SSKlient *zKlient = 0;
-    for( int i = 0; i < klientAnzahl; i++ )
+    SSKlient* zKlient = 0;
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
     {
         if( klients->z( i )->getKlientNummer() == klientId )
         {
@@ -334,23 +323,23 @@ bool SpielServer::absturzKlient( int klientId )
     switch( ak )
     {
     case 0: // Information Über Verwendung des Klient ist verlorengegangen (überall abmelden)
-        for( int i = 0; i < spielErstelltAnzahl; i++ )
+        for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
         {
-            SpielErstellt *tmp = erstellt->z( i );
+            SpielErstellt* tmp = erstellt->z( i );
             if( tmp )
                 tmp->klientGetrennt( zKlient );
         }
-        for( int i = 0; i < spielAnzahl; i++ )
+        for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
         {
-            Spiel *tmp = spiele->z( i );
+            Spiel* tmp = spiele->z( i );
             if( tmp )
                 tmp->klientGetrennt( zKlient );
         }
         break;
     case 1: // Spiel Erstellt
-        for( int i = 0; i < spielErstelltAnzahl; i++ )
+        for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
         {
-            SpielErstellt *tmp = erstellt->z( i );
+            SpielErstellt* tmp = erstellt->z( i );
             if( tmp )
             {
                 if( tmp->getId() == id )
@@ -362,9 +351,9 @@ bool SpielServer::absturzKlient( int klientId )
         }
         break;
     case 2: // Spielt
-        for( int i = 0; i < spielAnzahl; i++ )
+        for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
         {
-            Spiel *tmp = spiele->z( i );
+            Spiel* tmp = spiele->z( i );
             if( tmp && tmp->getId() == id )
             {
                 tmp->klientGetrennt( zKlient );
@@ -374,12 +363,11 @@ bool SpielServer::absturzKlient( int klientId )
         break;
     }
     bool gefunden = 0;
-    for( int i = 0; i < klientAnzahl; i++ )
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
     {
         if( klients->z( i ) == zKlient )
         {
             zKlient->absturz();
-            klientAnzahl--;
             zKlient->getThis();
             klients->remove( i );
             unlock();
@@ -393,7 +381,7 @@ bool SpielServer::absturzKlient( int klientId )
     return 1;
 }
 
-bool SpielServer::verteileKlient( SSKlient *klient )
+bool SpielServer::verteileKlient( SSKlient* klient )
 {
     lock();
     int id = 0;
@@ -405,14 +393,14 @@ bool SpielServer::verteileKlient( SSKlient *klient )
         return 0;
         break;
     case 1: // Spiel Erstellt
-        for( int i = 0; i < spielErstelltAnzahl; i++ )
+        for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
         {
-            SpielErstellt *tmp = erstellt->z( i );
+            SpielErstellt* tmp = erstellt->z( i );
             if( tmp )
             {
                 if( tmp->getId() == id )
                 {
-                    tmp->klientVerbunden( dynamic_cast<SSKlient *>( klient->getThis() ) );
+                    tmp->klientVerbunden( dynamic_cast<SSKlient*>(klient->getThis()) );
                     unlock();
                     return 1;
                 }
@@ -420,14 +408,14 @@ bool SpielServer::verteileKlient( SSKlient *klient )
         }
         break;
     case 2: // Spielt
-        for( int i = 0; i < spielAnzahl; i++ )
+        for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
         {
-            Spiel *tmp = spiele->z( i );
+            Spiel* tmp = spiele->z( i );
             if( tmp )
             {
                 if( tmp->getId() == id )
                 {
-                    tmp->klientVerbunden( dynamic_cast<SSKlient *>( klient->getThis() ) );
+                    tmp->klientVerbunden( dynamic_cast<SSKlient*>(klient->getThis()) );
                     unlock();
                     return 1;
                 }
@@ -439,7 +427,7 @@ bool SpielServer::verteileKlient( SSKlient *klient )
     return 0;
 }
 
-void SpielServer::unregisterKlient( SSKlient *zKlient )
+void SpielServer::unregisterKlient( SSKlient* zKlient )
 {
     lock();
     int id = 0;
@@ -447,23 +435,23 @@ void SpielServer::unregisterKlient( SSKlient *zKlient )
     switch( ak )
     {
     case 0: // Information Über Verwendung des Klient ist verlorengegangen (überall abmelden)
-        for( int i = 0; i < spielErstelltAnzahl; i++ )
+        for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
         {
-            SpielErstellt *tmp = erstellt->z( i );
+            SpielErstellt* tmp = erstellt->z( i );
             if( tmp )
                 tmp->klientGetrennt( zKlient );
         }
-        for( int i = 0; i < spielAnzahl; i++ )
+        for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
         {
-            Spiel *tmp = spiele->z( i );
+            Spiel* tmp = spiele->z( i );
             if( tmp )
                 tmp->klientGetrennt( zKlient );
         }
         break;
     case 1: // Spiel Erstellt
-        for( int i = 0; i < spielErstelltAnzahl; i++ )
+        for( int i = 0; i < erstellt->getEintragAnzahl(); i++ )
         {
-            SpielErstellt *tmp = erstellt->z( i );
+            SpielErstellt* tmp = erstellt->z( i );
             if( tmp )
             {
                 if( tmp->getId() == id )
@@ -475,9 +463,9 @@ void SpielServer::unregisterKlient( SSKlient *zKlient )
         }
         break;
     case 2: // Spielt
-        for( int i = 0; i < spielAnzahl; i++ )
+        for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
         {
-            Spiel *tmp = spiele->z( i );
+            Spiel* tmp = spiele->z( i );
             if( tmp && tmp->getId() == id )
             {
                 tmp->klientGetrennt( zKlient );
@@ -487,11 +475,10 @@ void SpielServer::unregisterKlient( SSKlient *zKlient )
         break;
     }
     bool gefunden = 0;
-    for( int i = 0; i < klientAnzahl; i++ )
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
     {
         if( klients->z( i ) == zKlient )
         {
-            klientAnzahl--;
             zKlient->getThis();
             klients->remove( i );
             unlock();
@@ -507,10 +494,10 @@ void SpielServer::unregisterKlient( SSKlient *zKlient )
     }
 }
 
-void SpielServer::klientsMM( SSKlient *k )
+void SpielServer::klientsMM( SSKlient* k )
 {
     lock();
-    for( int i = 0; i < klientAnzahl; i++ )
+    for( int i = 0; i < klients->getEintragAnzahl(); i++ )
     {
         if( klients->z( i ) == k )
         {
@@ -520,14 +507,12 @@ void SpielServer::klientsMM( SSKlient *k )
         }
     }
     unlock();
-    klientAnzahl2--;
 }
 
-void SpielServer::addSpiel( Spiel *spiel )
+void SpielServer::addSpiel( Spiel* spiel )
 {
     lock();
-    spiele->add( spiel, spielAnzahl );
-    spielAnzahl++;
+    spiele->add( spiel );
     unlock();
 }
 
@@ -535,12 +520,11 @@ void SpielServer::removeSpiel( int spielId )
 {
     lock();
     bool gefunden = 0;
-    for( int i = 0; i < spielAnzahl; i++ )
+    for( int i = 0; i < spiele->getEintragAnzahl(); i++ )
     {
         if( spiele->z( i ) && spiele->z( i )->getId() == spielId )
         {
-            spielAnzahl--;
-            Spiel *zs = spiele->get( i );
+            Spiel* zs = spiele->get( i );
             spiele->remove( i );
             unlock();
             zs->release();
@@ -607,24 +591,24 @@ bool SpielServer::istAn() const
     return db->serverIstNichtPausiert( id );
 }
 
-Server *SpielServer::zServer() const
+Server* SpielServer::zServer() const
 {
     return server;
 }
 
-SSDatenbank *SpielServer::zDB() const
+SSDatenbank* SpielServer::zDB() const
 {
     return db;
 }
 
-InitDatei *SpielServer::zInit() const
+InitDatei* SpielServer::zInit() const
 {
     return ini;
 }
 
 bool SpielServer::hatClients() const
 {
-    return klientAnzahl > 0;
+    return klients->hat( 0 );
 }
 
 int SpielServer::getId() const
@@ -632,12 +616,12 @@ int SpielServer::getId() const
     return id;
 }
 
-char *SpielServer::getLetzterFehler() const
+char* SpielServer::getLetzterFehler() const
 {
     return fehler->getText();
 }
 
-char *SpielServer::getIp() const
+char* SpielServer::getIp() const
 {
     return ini->zWert( "ServerIp" )->getText();
 }
@@ -652,7 +636,7 @@ int SpielServer::getPort() const
 
 // Inhalt der SSAKlient Klasse aus SpielServer.h
 // Konstruktor 
-SSAKlient::SSAKlient( SSLSKlient *klient, SpielServer *ss )
+SSAKlient::SSAKlient( SSLSKlient* klient, SpielServer* ss )
     : Thread()
 {
     this->klient = klient;
@@ -691,14 +675,14 @@ void SSAKlient::thread()
                 {
                     klient->sende( "\1", 1 );
                     unsigned char nLen = 0;
-                    klient->getNachricht( (char *)&nLen, 1 );
-                    char *n = new 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 );
-                    char *p = new char[ pLen + 1 ];
+                    klient->getNachricht( (char*)&pLen, 1 );
+                    char* p = new char[ pLen + 1 ];
                     p[ (int)pLen ] = 0;
                     if( pLen )
                         klient->getNachricht( p, pLen );
@@ -735,7 +719,7 @@ void SSAKlient::thread()
                     {
                         if( !ss->serverStarten() )
                         {
-                            Text *err = new Text();
+                            Text* err = new Text();
                             err->append( ss->getLetzterFehler() );
                             errorZuKlient( err->getText() );
                             err->release();
@@ -758,7 +742,7 @@ void SSAKlient::thread()
                             klient->sende( "\1", 1 );
                         else
                         {
-                            Text *err = new Text();
+                            Text* err = new Text();
                             err->append( ss->getLetzterFehler() );
                             errorZuKlient( err->getText() );
                             err->release();
@@ -782,7 +766,7 @@ void SSAKlient::thread()
                                 ok = 1;
                             else
                             {
-                                Text *err = new Text();
+                                Text* err = new Text();
                                 err->append( ss->getLetzterFehler() );
                                 errorZuKlient( err->getText() );
                                 err->release();
@@ -867,7 +851,7 @@ void SSAKlient::thread()
                             klient->sende( "\1", 1 );
                         else
                         {
-                            Text *err = new Text();
+                            Text* err = new Text();
                             err->append( ss->getLetzterFehler() );
                             errorZuKlient( err->getText() );
                             err->release();
@@ -889,14 +873,14 @@ void SSAKlient::thread()
                 {
                     klient->sende( "\1", 1 );
                     int maxS = 0;
-                    klient->getNachricht( (char *)&maxS, 4 );
+                    klient->getNachricht( (char*)&maxS, 4 );
                     if( ss->zDB()->adminHatRecht( adminId, Admin_Recht::SSMSChange ) )
                     {
                         if( ss->setMaxSpiele( maxS ) )
                             klient->sende( "\1", 1 );
                         else
                         {
-                            Text *err = new Text();
+                            Text* err = new Text();
                             err->append( ss->getLetzterFehler() );
                             errorZuKlient( err->getText() );
                             err->release();
@@ -913,13 +897,13 @@ void SSAKlient::thread()
                 {
                     klient->sende( "\1", 1 );
                     int spielId = 0;
-                    klient->getNachricht( (char *)&spielId, 4 );
+                    klient->getNachricht( (char*)&spielId, 4 );
                     if( !ss->hatSpielHistorieId( spielId ) )
                     {
                         errorZuKlient( "Zugriff auf Spiel-Historie verweigert." );
                         break;
                     }
-                    Text *pfad = new Text( "../spiel log/" );
+                    Text* pfad = new Text( "../spiel log/" );
                     *pfad += spielId;
                     *pfad += "/fertig";
                     if( !DateiExistiert( *pfad ) )
@@ -940,7 +924,7 @@ void SSAKlient::thread()
                 {
                     klient->sende( "\1", 1 );
                     int klientId = 0;
-                    klient->getNachricht( (char *)&klientId, 4 );
+                    klient->getNachricht( (char*)&klientId, 4 );
                     if( klientId && ss->absturzKlient( klientId ) )
                         klient->sende( "\1", 1 );
                     else
@@ -962,19 +946,19 @@ void SSAKlient::thread()
     delete this;
 }
 
-void SSAKlient::sendeVerzeichnisAnKlient( char *pfad, int gpl )
+void SSAKlient::sendeVerzeichnisAnKlient( char* pfad, int gpl )
 {
-    Datei *d = new Datei();
+    Datei* d = new Datei();
     d->setDatei( pfad );
     if( d->istOrdner() )
     {
         int dAnz = d->getUnterdateiAnzahl();
-        RCArray< Text > *list = d->getDateiListe();
+        RCArray< Text >* list = d->getDateiListe();
         for( int i = 0; i < dAnz; i++ )
         {
             if( list->z( i ) )
             {
-                Text *pf = new Text( pfad );
+                Text* pf = new Text( pfad );
                 pf->append( "/" );
                 pf->append( list->z( i )->getText() );
                 sendeVerzeichnisAnKlient( *pf, gpl );
@@ -988,11 +972,11 @@ void SSAKlient::sendeVerzeichnisAnKlient( char *pfad, int gpl )
         __int64 gr = d->getSize();
         if( gr && d->zPfad()->getLength() - gpl > 0 && d->open( Datei::Style::lesen ) )
         {
-            char pfLen = (char)( d->zPfad()->getLength() - gpl );
+            char pfLen = (char)(d->zPfad()->getLength() - gpl);
             klient->sende( &pfLen, 1 );
             klient->sende( d->zPfad()->getText() + gpl, pfLen );
-            klient->sende( (char *)&gr, 8 );
-            char *bytes = new char[ 2048 ];
+            klient->sende( (char*)&gr, 8 );
+            char* bytes = new char[ 2048 ];
             while( gr )
             {
                 short len = gr > 2048 ? 2048 : (short)gr;
@@ -1007,7 +991,7 @@ void SSAKlient::sendeVerzeichnisAnKlient( char *pfad, int gpl )
     d->release();
 }
 
-void SSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
+void SSAKlient::errorZuKlient( const char* nachricht ) const // sendet eine Fehlernachricht zum Klient
 {
     klient->sende( "\3", 1 );
     char len = (char)textLength( nachricht );
@@ -1018,13 +1002,13 @@ void SSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehl
 
 // Inhalt der SSKlient Klasse aus SpielServer.h
 // Konstruktor 
-SSKlient::SSKlient( SKlient *klient, SpielServer *ss )
+SSKlient::SSKlient( SKlient* klient, SpielServer* ss )
     : SSKlientV()
 {
     empfangen = klient;
     unsigned char key[ 20 ] = { 253, 234, 211, 132, 121, 230, 95, 145, 201, 13, 43, 77, 153, 223, 253, 69, 234, 43, 52, 99 };
-    klient->setSendeKey( (char *)key, 20 );
-    klient->setEmpfangKey( (char *)key, 20 );
+    klient->setSendeKey( (char*)key, 20 );
+    klient->setEmpfangKey( (char*)key, 20 );
     senden = 0;
     this->ss = ss;
     accountId = 0;
@@ -1101,12 +1085,12 @@ void SSKlient::absturz()
     empfangen->trenne();
 }
 
-void SSKlient::setSpielErstellt( SpielErstellt *zErstellt )
+void SSKlient::setSpielErstellt( SpielErstellt* zErstellt )
 {
     this->zErstellt = zErstellt;
 }
 
-void SSKlient::setSpiel( Spiel *zSpiel )
+void SSKlient::setSpiel( Spiel* zSpiel )
 {
     this->zSpiel = zSpiel;
 }
@@ -1122,7 +1106,7 @@ void SSKlient::spielGefunden( int karteId )
         return;
     lock();
     senden->sendeEncrypted( "\xB", 1 );
-    senden->sendeEncrypted( (char *)&karteId, 4 );
+    senden->sendeEncrypted( (char*)&karteId, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1140,7 +1124,7 @@ void SSKlient::zeitVerbleibend( char sekunden )
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::erstellungAbgebrochen( char *grund )
+void SSKlient::erstellungAbgebrochen( char* grund )
 {
     if( !senden )
         return;
@@ -1180,27 +1164,27 @@ void SSKlient::erstellungFortsetzen()
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::erstellungInitialisierung( SpielerTeamStruktur *sts )
+void SSKlient::erstellungInitialisierung( SpielerTeamStruktur* sts )
 {
     if( !senden )
         return;
     lock();
     senden->sendeEncrypted( "\6", 1 );
-    senden->sendeEncrypted( (char *)&sts->spielerAnzahl, 4 );
-    senden->sendeEncrypted( (char *)&sts->teamAnzahl, 4 );
+    senden->sendeEncrypted( (char*)&sts->spielerAnzahl, 4 );
+    senden->sendeEncrypted( (char*)&sts->teamAnzahl, 4 );
     for( int i = 0; i < sts->spielerAnzahl; i++ )
     {
         int f = sts->spielerFarbe->hat( i ) ? sts->spielerFarbe->get( i ) : 0;
-        senden->sendeEncrypted( (char *)&f, 4 );
+        senden->sendeEncrypted( (char*)&f, 4 );
     }
     for( int i = 0; i < sts->teamAnzahl; i++ )
     {
         int f = sts->teamFarbe->hat( i ) ? sts->teamFarbe->get( i ) : 0;
-        senden->sendeEncrypted( (char *)&f, 4 );
+        senden->sendeEncrypted( (char*)&f, 4 );
     }
     for( int i = 0; i < sts->teamAnzahl; i++ )
     {
-        Text *name = sts->teamName->z( i );
+        Text* name = sts->teamName->z( i );
         char len = (char)name->getLength();
         senden->sendeEncrypted( &len, 1 );
         if( len )
@@ -1209,7 +1193,7 @@ void SSKlient::erstellungInitialisierung( SpielerTeamStruktur *sts )
     for( int i = 0; i < sts->teamAnzahl; i++ )
     {
         int size = sts->teamSize->hat( i ) ? sts->teamSize->get( i ) : 0;
-        senden->sendeEncrypted( (char *)&size, 4 );
+        senden->sendeEncrypted( (char*)&size, 4 );
     }
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
@@ -1222,7 +1206,7 @@ void SSKlient::erstellungAddSpieler( int accountId )
         return;
     lock();
     senden->sendeEncrypted( "\7", 1 );
-    senden->sendeEncrypted( (char *)&accountId, 4 );
+    senden->sendeEncrypted( (char*)&accountId, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1234,7 +1218,7 @@ void SSKlient::erstellungRemoveSpieler( int accountId )
         return;
     lock();
     senden->sendeEncrypted( "\x8", 1 );
-    senden->sendeEncrypted( (char *)&accountId, 4 );
+    senden->sendeEncrypted( (char*)&accountId, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1246,14 +1230,14 @@ void SSKlient::erstellungSpielerTeam( int accountId, int spielerNummer )
         return;
     lock();
     senden->sendeEncrypted( "\x9", 1 );
-    senden->sendeEncrypted( (char *)&accountId, 4 );
-    senden->sendeEncrypted( (char *)&spielerNummer, 4 );
+    senden->sendeEncrypted( (char*)&accountId, 4 );
+    senden->sendeEncrypted( (char*)&spielerNummer, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::erstellungChatNachricht( char *nachricht )
+void SSKlient::erstellungChatNachricht( char* nachricht )
 {
     if( !senden )
         return;
@@ -1286,8 +1270,8 @@ void SSKlient::spielLadenSpielerAdd( int accId, int spielerNumer )
         return;
     lock();
     senden->sendeEncrypted( "\xD", 1 );
-    senden->sendeEncrypted( (char *)&accId, 4 );
-    senden->sendeEncrypted( (char *)&spielerNumer, 4 );
+    senden->sendeEncrypted( (char*)&accId, 4 );
+    senden->sendeEncrypted( (char*)&spielerNumer, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1299,8 +1283,8 @@ void SSKlient::spielLadenSetSpielerProzent( int accId, int prozent )
         return;
     lock();
     senden->sendeEncrypted( "\xE", 1 );
-    senden->sendeEncrypted( (char *)&accId, 4 );
-    senden->sendeEncrypted( (char *)&prozent, 4 );
+    senden->sendeEncrypted( (char*)&accId, 4 );
+    senden->sendeEncrypted( (char*)&prozent, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1312,8 +1296,8 @@ void SSKlient::spielLadenSetSpielerPing( int accId, int ping )
         return;
     lock();
     senden->sendeEncrypted( "\xF", 1 );
-    senden->sendeEncrypted( (char *)&accId, 4 );
-    senden->sendeEncrypted( (char *)&ping, 4 );
+    senden->sendeEncrypted( (char*)&accId, 4 );
+    senden->sendeEncrypted( (char*)&ping, 4 );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
@@ -1323,7 +1307,7 @@ double SSKlient::ping()
 {
     if( !senden )
         return 0;
-    ZeitMesser *zeit = new ZeitMesser();
+    ZeitMesser* zeit = new ZeitMesser();
     char ret = 0;
     lock();
     zeit->messungStart();
@@ -1349,26 +1333,26 @@ void SSKlient::spielLadenFertig()
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::spielNachricht( short len, char *bytes )
+void SSKlient::spielNachricht( short len, char* bytes )
 {
     if( !senden )
         return;
     lock();
     senden->sendeEncrypted( "\x12", 1 );
-    senden->sende( (char *)&len, 2 );
+    senden->sende( (char*)&len, 2 );
     senden->sende( bytes, len );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::statistikNachricht( short len, char *bytes )
+void SSKlient::statistikNachricht( short len, char* bytes )
 {
     if( !senden )
         return;
     lock();
     senden->sendeEncrypted( "\x13", 1 );
-    senden->sendeEncrypted( (char *)&len, 2 );
+    senden->sendeEncrypted( (char*)&len, 2 );
     senden->sendeEncrypted( bytes, len );
     unlock();
     ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
@@ -1401,10 +1385,10 @@ void SSKlient::trenne()
     ss->addGesendet( senden->getUploadBytes( 1 ) );
 }
 
-void SSKlient::setSenden( SSKlient *klient )
+void SSKlient::setSenden( SSKlient* klient )
 {
     senden = klient->getKlient();
-    Text *key = ss->zDB()->getKlientKey( klientNummer );
+    Text* key = ss->zDB()->getKlientKey( klientNummer );
     if( !key )
     {
         senden->sendeEncrypted( "\0", 1 );
@@ -1439,7 +1423,7 @@ void SSKlient::thread()
             switch( message )
             {
             case 1: // Klient Identifikation
-                empfangen->getNachrichtEncrypted( (char *)&klientNummer, 4 );
+                empfangen->getNachrichtEncrypted( (char*)&klientNummer, 4 );
                 if( !klientNummer )
                     errorZuKlientEmpfang( "Du besitzt noch keine Klient Nummer." );
                 else
@@ -1449,7 +1433,7 @@ void SSKlient::thread()
                     if( ss->registerKlient( this ) )
                         return;
                     termThread = 1;
-                    Text *key = ss->zDB()->getKlientKey( klientNummer );
+                    Text* key = ss->zDB()->getKlientKey( klientNummer );
                     if( !key )
                         errorZuKlientEmpfang( "Es konnte kein Key ermittelt werden." );
                     else
@@ -1472,7 +1456,7 @@ void SSKlient::thread()
                         if( 1 )
                         {
                             int klientId = 0;
-                            empfangen->getNachrichtEncrypted( (char *)&klientId, 4 );
+                            empfangen->getNachrichtEncrypted( (char*)&klientId, 4 );
                             if( klientId && ss->absturzKlient( klientId ) )
                                 empfangen->sendeEncrypted( "\1", 1 );
                             else
@@ -1529,7 +1513,7 @@ void SSKlient::thread()
                 {
                     empfangen->sendeEncrypted( "\1", 1 );
                     int team = 0;
-                    empfangen->getNachrichtEncrypted( (char *)&team, 4 );
+                    empfangen->getNachrichtEncrypted( (char*)&team, 4 );
                     if( zSpiel->klientWechseltTeam( accountId, team ) )
                         empfangen->sendeEncrypted( "\1", 1 );
                     else
@@ -1549,12 +1533,12 @@ void SSKlient::thread()
                 {
                     empfangen->sendeEncrypted( "\1", 1 );
                     unsigned char len = 0;
-                    empfangen->getNachrichtEncrypted( (char *)&len, 1 );
-                    char *nachricht = new char[ len + 1 ];
+                    empfangen->getNachrichtEncrypted( (char*)&len, 1 );
+                    char* nachricht = new char[ len + 1 ];
                     nachricht[ (int)len ] = 0;
                     if( len )
                         empfangen->getNachrichtEncrypted( nachricht, len );
-                    Text *msg = ss->zDB()->getAccountRufName( accountId );
+                    Text* msg = ss->zDB()->getAccountRufName( accountId );
                     msg->append( ": " );
                     msg->append( nachricht );
                     delete[] nachricht;
@@ -1590,7 +1574,7 @@ void SSKlient::thread()
                         {
                             empfangen->sendeEncrypted( "\1", 1 );
                             int spielErstelltId = 0;
-                            empfangen->getNachrichtEncrypted( (char *)&spielErstelltId, 4 );
+                            empfangen->getNachrichtEncrypted( (char*)&spielErstelltId, 4 );
                             ss->SpielErstelltAbbruch( spielErstelltId );
                             empfangen->sendeEncrypted( "\1", 1 );
                         }
@@ -1623,8 +1607,8 @@ void SSKlient::thread()
                 if( 1 )
                 {
                     unsigned short len = 0;
-                    empfangen->getNachricht( (char *)&len, 2 );
-                    char *bytes = new char[ len ];
+                    empfangen->getNachricht( (char*)&len, 2 );
+                    char* bytes = new char[ len ];
                     empfangen->getNachricht( bytes, len );
                     if( !zSpiel || !zSpiel->spielNachricht( accountId, len, bytes ) )
                         errorZuKlientSende( "Es ist ein unbekannter Fehler aufgetreten." );
@@ -1636,7 +1620,7 @@ void SSKlient::thread()
                 {
                     empfangen->sendeEncrypted( "\1", 1 );
                     int prozent = 0;
-                    empfangen->getNachrichtEncrypted( (char *)&prozent, 4 );
+                    empfangen->getNachrichtEncrypted( (char*)&prozent, 4 );
                     if( zSpiel && zSpiel->klientSpielLadenProzent( accountId, prozent ) )
                         empfangen->sendeEncrypted( "\1", 1 );
                     else
@@ -1651,8 +1635,8 @@ void SSKlient::thread()
                 {
                     empfangen->sendeEncrypted( "\1", 1 );
                     unsigned short len = 0;
-                    empfangen->getNachrichtEncrypted( (char *)&len, 2 );
-                    char *bytes = new char[ len ];
+                    empfangen->getNachrichtEncrypted( (char*)&len, 2 );
+                    char* bytes = new char[ len ];
                     empfangen->getNachrichtEncrypted( bytes, len );
                     if( zSpiel && zSpiel->statistikNachricht( accountId, len, bytes ) )
                         empfangen->sendeEncrypted( "\1", 1 );
@@ -1722,7 +1706,7 @@ void SSKlient::thread()
     }
 }
 
-void SSKlient::errorZuKlientEmpfang( const char *nachricht ) // sendet eine Fehlernachricht zum Klient
+void SSKlient::errorZuKlientEmpfang( const char* nachricht ) // sendet eine Fehlernachricht zum Klient
 {
     unsigned char len = (unsigned char)textLength( nachricht );
     if( !len )
@@ -1730,14 +1714,14 @@ void SSKlient::errorZuKlientEmpfang( const char *nachricht ) // sendet eine Fehl
     if( empfangen )
     {
         empfangen->sendeEncrypted( "\3", 1 );
-        empfangen->sendeEncrypted( (char *)&len, 1 );
+        empfangen->sendeEncrypted( (char*)&len, 1 );
         empfangen->sendeEncrypted( nachricht, len );
     }
     ss->addEmpfangen( empfangen->getDownloadBytes( 1 ) );
     ss->addGesendet( empfangen->getUploadBytes( 1 ) );
 }
 
-void SSKlient::errorZuKlientSende( const char *nachricht )
+void SSKlient::errorZuKlientSende( const char* nachricht )
 {
     unsigned char len = (unsigned char)textLength( nachricht );
     if( !len )
@@ -1746,7 +1730,7 @@ void SSKlient::errorZuKlientSende( const char *nachricht )
     {
         lock();
         senden->sendeEncrypted( "\3", 1 );
-        senden->sendeEncrypted( (char *)&len, 1 );
+        senden->sendeEncrypted( (char*)&len, 1 );
         senden->sendeEncrypted( nachricht, len );
         unlock();
         ss->addEmpfangen( senden->getDownloadBytes( 1 ) );
@@ -1765,7 +1749,7 @@ int SSKlient::getKlientNummer() const
     return klientNummer;
 }
 
-SKlient *SSKlient::getKlient() const
+SKlient* SSKlient::getKlient() const
 {
-    return dynamic_cast<SKlient *>( empfangen->getThis() );
+    return dynamic_cast<SKlient*>(empfangen->getThis());
 }

+ 0 - 4
SpielServer/SpielServer.h

@@ -35,14 +35,10 @@ private:
 	CRITICAL_SECTION cs;
 	SpielFinden *startSpielThread;
 	RCArray< SpielErstellt > *erstellt;
-	int spielErstelltAnzahl;
 	RCArray< Spiel > *spiele;
-	int spielAnzahl;
 	RCArray< SSKlient > *klients;
 	Array< int > *spielHistorieId;
 	Text *fehler;
-	int klientAnzahl;
-	int klientAnzahl2;
 	int id;
 	bool nichtPausiert;
 	int empfangen;