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