Explorar el Código

Debug info entfernt

Kolja Strohm hace 5 años
padre
commit
7c2aa646a9
Se han modificado 1 ficheros con 0 adiciones y 160 borrados
  1. 0 160
      Asteroids/Spiel/SpielKlasse.cpp

+ 0 - 160
Asteroids/Spiel/SpielKlasse.cpp

@@ -448,10 +448,6 @@ void SpielKlasse::stknVerarbeitung()
 		län--;
 		int sNum = 0;
         int presence = spielZeit;
-        Vertex pos;
-        Vertex speed;
-        float rot;
-        float rotS;
         if( presence > zeit + 10 )
             presence = zeit + 10; // maximale zeitdifferenz von client und server
 		switch( bytes[ 0 ] )
@@ -459,38 +455,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 0: // spieler drückt gas
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
 			län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
-            län -= 4;
             goBackInTime( zeit );
 			for( auto i = spieler->getIterator(); i; i++ )
 			{
 				if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_GAS, 1 );
                 }
 			}
@@ -499,38 +469,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 1: // spieler lässt gas los
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
             län -= 4;
             goBackInTime( zeit );
             for( auto i = spieler->getIterator(); i; i++ )
             {
                 if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_GAS, 0 );
                 }
             }
@@ -539,38 +483,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 2: // spieler drückt rotl
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
             län -= 4;
             goBackInTime( zeit );
             for( auto i = spieler->getIterator(); i; i++ )
             {
                 if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_ROT_L, 1 );
                 }
             }
@@ -579,38 +497,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 3: // spieler lässt rotl los
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
             län -= 4;
             goBackInTime( zeit );
             for( auto i = spieler->getIterator(); i; i++ )
             {
                 if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_ROT_L, 0 );
                 }
             }
@@ -619,38 +511,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 4: // spieler drückt rotr
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
             län -= 4;
             goBackInTime( zeit );
             for( auto i = spieler->getIterator(); i; i++ )
             {
                 if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_ROT_R, 1 );
                 }
             }
@@ -659,38 +525,12 @@ void SpielKlasse::stknVerarbeitung()
 		case 5: // spieler lässt rotr los
 			bytes++;
 			sNum = *(int*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            pos.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.x = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            speed.y = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rot = *(float*)bytes;
-            bytes += 4;
-            län -= 4;
-            rotS = *(float*)bytes;
             län -= 4;
             goBackInTime( zeit );
             for( auto i = spieler->getIterator(); i; i++ )
             {
                 if( i->getSpielerNummer() == sNum )
                 {
-                    if( i->getPosition() != pos )
-                        chat->addNachricht( Text( "asynchrony detected, position difference: " ) += ( i->getPosition() - pos ).getLength(), 0xFFFF0000 );
-                    if( i->getSpeed() != speed )
-                        chat->addNachricht( Text( "asynchrony detected, speed difference: " ) += ( i->getSpeed() - speed ).getLength(), 0xFFFF0000 );
-                    if( i->getDrehung() != rot )
-                        chat->addNachricht( Text( "asynchrony detected, rot difference: " ) += ( i->getDrehung() - rot ), 0xFFFF0000 );
-                    if( i->getDrehungSpeed() != rotS )
-                        chat->addNachricht( Text( "asynchrony detected, rotS difference: " ) += ( i->getDrehungSpeed() - rotS ), 0xFFFF0000 );
                     i->setTastataturStatus( T_ROT_R, 0 );
                 }
             }