|
@@ -6,18 +6,17 @@
|
|
|
|
|
|
// Inhalt der InformationServer Klasse aus InformationServer.h
|
|
|
// Konstruktor
|
|
|
-InformationServer::InformationServer( InitDatei *zIni )
|
|
|
+InformationServer::InformationServer( InitDatei* zIni )
|
|
|
: Thread()
|
|
|
{
|
|
|
Network::Start( 100 );
|
|
|
std::cout << "IS: Verbindung mit Datenbank wird hergestellt...\n";
|
|
|
db = new ISDatenbank( zIni );
|
|
|
- klientAnzahl = 0;
|
|
|
klients = new RCArray< ISKlient >();
|
|
|
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();
|
|
@@ -61,18 +60,18 @@ void InformationServer::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;
|
|
|
- ISAKlient *clHandle = new ISAKlient( klient, dynamic_cast<InformationServer *>( getThis() ) );
|
|
|
+ ISAKlient* clHandle = new ISAKlient( klient, dynamic_cast<InformationServer*>(getThis()) );
|
|
|
clHandle->start();
|
|
|
}
|
|
|
}
|
|
@@ -81,15 +80,14 @@ void InformationServer::thread()
|
|
|
{
|
|
|
while( server->isConnected() )
|
|
|
{
|
|
|
- SKlient *klient;
|
|
|
+ SKlient* klient;
|
|
|
klient = server->getKlient();
|
|
|
if( !klient )
|
|
|
continue;
|
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
|
- ISKlient *clHandle = new ISKlient( klient, dynamic_cast<InformationServer *>( getThis() ) );
|
|
|
+ ISKlient* clHandle = new ISKlient( klient, dynamic_cast<InformationServer*>(getThis()) );
|
|
|
EnterCriticalSection( &cs );
|
|
|
- klients->set( clHandle, klientAnzahl );
|
|
|
- klientAnzahl++;
|
|
|
+ klients->add( clHandle );
|
|
|
LeaveCriticalSection( &cs );
|
|
|
clHandle->start();
|
|
|
}
|
|
@@ -103,15 +101,14 @@ void InformationServer::close()
|
|
|
warteAufThread( 1000 );
|
|
|
#endif
|
|
|
EnterCriticalSection( &cs );
|
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
|
klients->z( i )->absturz();
|
|
|
- klients = ( RCArray<ISKlient>* )klients->release();
|
|
|
- klientAnzahl = 0;
|
|
|
+ klients = (RCArray<ISKlient>*)klients->release();
|
|
|
LeaveCriticalSection( &cs );
|
|
|
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();
|
|
@@ -209,13 +206,12 @@ bool InformationServer::absturzKlient( int klientId )
|
|
|
{
|
|
|
bool gefunden = 0;
|
|
|
EnterCriticalSection( &cs );
|
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
|
{
|
|
|
if( klients->z( i )->getKlientNummer() == klientId )
|
|
|
{
|
|
|
klients->z( i )->absturz();
|
|
|
klients->remove( i );
|
|
|
- klientAnzahl--;
|
|
|
gefunden = 1;
|
|
|
break;
|
|
|
}
|
|
@@ -224,16 +220,15 @@ bool InformationServer::absturzKlient( int klientId )
|
|
|
return gefunden;
|
|
|
}
|
|
|
|
|
|
-bool InformationServer::removeKlient( ISKlient *zKlient )
|
|
|
+bool InformationServer::removeKlient( ISKlient* zKlient )
|
|
|
{
|
|
|
bool gefunden = 0;
|
|
|
EnterCriticalSection( &cs );
|
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
|
{
|
|
|
if( klients->z( i ) == zKlient )
|
|
|
{
|
|
|
klients->remove( i );
|
|
|
- klientAnzahl--;
|
|
|
gefunden = 1;
|
|
|
break;
|
|
|
}
|
|
@@ -258,19 +253,19 @@ bool InformationServer::istAn() const
|
|
|
return db->serverIstNichtPausiert( id );
|
|
|
}
|
|
|
|
|
|
-Server *InformationServer::zServer() const
|
|
|
+Server* InformationServer::zServer() const
|
|
|
{
|
|
|
return server;
|
|
|
}
|
|
|
|
|
|
-ISDatenbank *InformationServer::zDB() const
|
|
|
+ISDatenbank* InformationServer::zDB() const
|
|
|
{
|
|
|
return db;
|
|
|
}
|
|
|
|
|
|
bool InformationServer::hatClients() const
|
|
|
{
|
|
|
- return klientAnzahl > 0;
|
|
|
+ return klients->hat( 0 );
|
|
|
}
|
|
|
|
|
|
int InformationServer::getId() const
|
|
@@ -278,7 +273,7 @@ int InformationServer::getId() const
|
|
|
return id;
|
|
|
}
|
|
|
|
|
|
-char *InformationServer::getLetzterFehler() const
|
|
|
+char* InformationServer::getLetzterFehler() const
|
|
|
{
|
|
|
return fehler->getText();
|
|
|
}
|
|
@@ -286,7 +281,7 @@ char *InformationServer::getLetzterFehler() const
|
|
|
|
|
|
// Inhalt der ISAKlient Klasse aus InformationServer.h
|
|
|
// Konstruktor
|
|
|
-ISAKlient::ISAKlient( SSLSKlient *klient, InformationServer *is )
|
|
|
+ISAKlient::ISAKlient( SSLSKlient* klient, InformationServer* is )
|
|
|
: Thread()
|
|
|
{
|
|
|
this->klient = klient;
|
|
@@ -324,14 +319,14 @@ void ISAKlient::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 );
|
|
@@ -368,7 +363,7 @@ void ISAKlient::thread()
|
|
|
{
|
|
|
if( !is->serverStarten() )
|
|
|
{
|
|
|
- Text *err = new Text();
|
|
|
+ Text* err = new Text();
|
|
|
err->append( is->getLetzterFehler() );
|
|
|
errorZuKlient( err->getText() );
|
|
|
err->release();
|
|
@@ -391,7 +386,7 @@ void ISAKlient::thread()
|
|
|
klient->sende( "\1", 1 );
|
|
|
else
|
|
|
{
|
|
|
- Text *err = new Text();
|
|
|
+ Text* err = new Text();
|
|
|
err->append( is->getLetzterFehler() );
|
|
|
errorZuKlient( err->getText() );
|
|
|
err->release();
|
|
@@ -415,7 +410,7 @@ void ISAKlient::thread()
|
|
|
ok = 1;
|
|
|
else
|
|
|
{
|
|
|
- Text *err = new Text();
|
|
|
+ Text* err = new Text();
|
|
|
err->append( is->getLetzterFehler() );
|
|
|
errorZuKlient( err->getText() );
|
|
|
err->release();
|
|
@@ -500,7 +495,7 @@ void ISAKlient::thread()
|
|
|
klient->sende( "\1", 1 );
|
|
|
else
|
|
|
{
|
|
|
- Text *err = new Text();
|
|
|
+ Text* err = new Text();
|
|
|
err->append( is->getLetzterFehler() );
|
|
|
errorZuKlient( err->getText() );
|
|
|
err->release();
|
|
@@ -522,14 +517,14 @@ void ISAKlient::thread()
|
|
|
{
|
|
|
klient->sende( "\1", 1 );
|
|
|
int maxC = 0;
|
|
|
- klient->getNachricht( (char *)&maxC, 4 );
|
|
|
+ klient->getNachricht( (char*)&maxC, 4 );
|
|
|
if( is->zDB()->adminHatRecht( adminId, Admin_Recht::ISMCChange ) )
|
|
|
{
|
|
|
if( is->setMaxKlients( maxC ) )
|
|
|
klient->sende( "\1", 1 );
|
|
|
else
|
|
|
{
|
|
|
- Text *err = new Text();
|
|
|
+ Text* err = new Text();
|
|
|
err->append( is->getLetzterFehler() );
|
|
|
errorZuKlient( err->getText() );
|
|
|
err->release();
|
|
@@ -544,7 +539,7 @@ void ISAKlient::thread()
|
|
|
{
|
|
|
klient->sende( "\1", 1 );
|
|
|
int klientId = 0;
|
|
|
- klient->getNachricht( (char *)&klientId, 4 );
|
|
|
+ klient->getNachricht( (char*)&klientId, 4 );
|
|
|
if( klientId && is->absturzKlient( klientId ) )
|
|
|
klient->sende( "\1", 1 );
|
|
|
else
|
|
@@ -566,7 +561,7 @@ void ISAKlient::thread()
|
|
|
delete this;
|
|
|
}
|
|
|
|
|
|
-void ISAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
+void ISAKlient::errorZuKlient( const char* nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
{
|
|
|
klient->sende( "\3", 1 );
|
|
|
char len = (char)textLength( nachricht );
|
|
@@ -577,13 +572,13 @@ void ISAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehl
|
|
|
|
|
|
// Inhalt der ISKlient aus InformationServer.h
|
|
|
// Konstruktor
|
|
|
-ISKlient::ISKlient( SKlient *klient, InformationServer *is )
|
|
|
+ISKlient::ISKlient( SKlient* klient, InformationServer* is )
|
|
|
: Thread()
|
|
|
{
|
|
|
this->klient = klient;
|
|
|
unsigned char key[ 20 ] = { 231, 246, 125, 32, 88, 172, 229, 223, 246, 138, 74, 64, 142, 245, 217, 218, 162, 62, 103, 50 };
|
|
|
- klient->setSendeKey( (char *)key, 20 );
|
|
|
- klient->setEmpfangKey( (char *)key, 20 );
|
|
|
+ klient->setSendeKey( (char*)key, 20 );
|
|
|
+ klient->setEmpfangKey( (char*)key, 20 );
|
|
|
klientNummer = 0;
|
|
|
this->is = is;
|
|
|
}
|
|
@@ -616,7 +611,7 @@ void ISKlient::thread()
|
|
|
switch( c )
|
|
|
{
|
|
|
case 1: // Klient identifikation
|
|
|
- klient->getNachrichtEncrypted( (char *)&klientNummer, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&klientNummer, 4 );
|
|
|
if( !is->zDB()->proveKlient( klientNummer, is->getId() ) )
|
|
|
{
|
|
|
klientNummer = 0;
|
|
@@ -624,7 +619,7 @@ void ISKlient::thread()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Text *key = is->zDB()->getKlientKey( klientNummer );
|
|
|
+ Text* key = is->zDB()->getKlientKey( klientNummer );
|
|
|
if( !key )
|
|
|
errorZuKlient( "Es konnte kein Schlüssel ermittelt werden." );
|
|
|
else
|
|
@@ -647,7 +642,7 @@ void ISKlient::thread()
|
|
|
if( 1 )
|
|
|
{
|
|
|
int klientId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&klientId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&klientId, 4 );
|
|
|
if( klientId && is->absturzKlient( klientId ) )
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
else
|
|
@@ -683,9 +678,9 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
char typ = 0;
|
|
|
- Text *info = is->zDB()->getInformationsText( &typ );
|
|
|
+ Text* info = is->zDB()->getInformationsText( &typ );
|
|
|
unsigned short len = info ? (unsigned short)info->getLength() : (unsigned short)0;
|
|
|
- klient->sendeEncrypted( (char *)&len, 2 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 2 );
|
|
|
if( len > 0 )
|
|
|
klient->sendeEncrypted( info->getText(), len );
|
|
|
klient->sendeEncrypted( &typ, 1 );
|
|
@@ -703,7 +698,7 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
if( is->zDB()->istSpielErlaubt( spielId ) )
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
else
|
|
@@ -720,7 +715,7 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int karteId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
|
if( is->zDB()->istKarteErlaubt( karteId ) )
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
else
|
|
@@ -737,12 +732,12 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
- char *name = new char[ len + 1 ];
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
+ char* name = new char[ len + 1 ];
|
|
|
name[ (int)len ] = 0;
|
|
|
klient->getNachrichtEncrypted( name, len );
|
|
|
int id = is->zDB()->getSpielId( name );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
delete[] name;
|
|
|
}
|
|
|
break;
|
|
@@ -756,12 +751,12 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
- char *name = new char[ len + 1 ];
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
+ char* name = new char[ len + 1 ];
|
|
|
name[ (int)len ] = 0;
|
|
|
klient->getNachrichtEncrypted( name, len );
|
|
|
int id = is->zDB()->getKarteId( name );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
delete[] name;
|
|
|
}
|
|
|
break;
|
|
@@ -775,8 +770,8 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int accountId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&accountId, 4 );
|
|
|
- Text *rName = is->zDB()->getAccountRufName( accountId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&accountId, 4 );
|
|
|
+ Text* rName = is->zDB()->getAccountRufName( accountId );
|
|
|
if( rName )
|
|
|
{
|
|
|
char len = (char)rName->getLength();
|
|
@@ -799,13 +794,13 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int accountId = 0;
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&accountId, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
- Array< int > *values = is->zDB()->getAccountSpielStatistik( accountId, spielId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&accountId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
+ Array< int >* values = is->zDB()->getAccountSpielStatistik( accountId, spielId );
|
|
|
for( int i = 0; i < 10; i++ )
|
|
|
{
|
|
|
int tmp = values ? values->get( i ) : 0;
|
|
|
- klient->sendeEncrypted( (char *)&tmp, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&tmp, 4 );
|
|
|
}
|
|
|
if( values )
|
|
|
values->release();
|
|
@@ -821,12 +816,12 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
- char *suche = new char[ len + 1 ];
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
+ char* suche = new char[ len + 1 ];
|
|
|
suche[ (int)len ] = 0;
|
|
|
klient->getNachrichtEncrypted( suche, len );
|
|
|
int seite = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&seite, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&seite, 4 );
|
|
|
char sortSpalte = 0;
|
|
|
char backwords = 0;
|
|
|
klient->getNachrichtEncrypted( &sortSpalte, 1 );
|
|
@@ -834,27 +829,27 @@ void ISKlient::thread()
|
|
|
int maxSeite = 0;
|
|
|
Result list = is->zDB()->getSpielerListe( suche, &seite, &maxSeite, sortSpalte, backwords != 0 );
|
|
|
delete[] suche;
|
|
|
- klient->sendeEncrypted( (char *)&seite, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&maxSeite, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&list.zeilenAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&seite, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&maxSeite, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&list.zeilenAnzahl, 4 );
|
|
|
for( int i = 0; i < list.zeilenAnzahl; i++ )
|
|
|
{
|
|
|
int accId = list.values[ i * 6 ];
|
|
|
- klient->sendeEncrypted( (char *)&accId, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&accId, 4 );
|
|
|
len = (char)list.values[ i * 6 + 1 ].getLength();
|
|
|
- klient->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 1 );
|
|
|
klient->sendeEncrypted( list.values[ i * 6 + 1 ], len );
|
|
|
len = (char)list.values[ i * 6 + 2 ].getLength();
|
|
|
- klient->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 1 );
|
|
|
klient->sendeEncrypted( list.values[ i * 6 + 2 ], len );
|
|
|
len = (char)list.values[ i * 6 + 3 ].getLength();
|
|
|
- klient->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 1 );
|
|
|
klient->sendeEncrypted( list.values[ i * 6 + 3 ], len );
|
|
|
len = (char)list.values[ i * 6 + 4 ].getLength();
|
|
|
- klient->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 1 );
|
|
|
klient->sendeEncrypted( list.values[ i * 6 + 4 ], len );
|
|
|
len = (char)list.values[ i * 6 + 5 ].getLength();
|
|
|
- klient->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ klient->sendeEncrypted( (char*)&len, 1 );
|
|
|
klient->sendeEncrypted( list.values[ i * 6 + 5 ], len );
|
|
|
}
|
|
|
list.destroy();
|
|
@@ -870,9 +865,9 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int gruppeId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&gruppeId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&gruppeId, 4 );
|
|
|
int karteId = is->zDB()->getGruppenKarteId( gruppeId );
|
|
|
- klient->sendeEncrypted( (char *)&karteId, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&karteId, 4 );
|
|
|
}
|
|
|
break;
|
|
|
case 0xE: // Frage nach Karten Name
|
|
@@ -885,8 +880,8 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int karteId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
- Text *name = is->zDB()->getKarteName( karteId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
|
+ Text* name = is->zDB()->getKarteName( karteId );
|
|
|
if( !name )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
@@ -908,8 +903,8 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
- Text *name = is->zDB()->getSpielName( spielId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
+ Text* name = is->zDB()->getSpielName( spielId );
|
|
|
if( !name )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
@@ -931,8 +926,8 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int chatroomId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&chatroomId, 4 );
|
|
|
- Text *name = is->zDB()->getChatroomName( chatroomId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&chatroomId, 4 );
|
|
|
+ Text* name = is->zDB()->getChatroomName( chatroomId );
|
|
|
if( !name )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
@@ -954,9 +949,9 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int karteId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
|
int spielId = is->zDB()->getSpielId( karteId );
|
|
|
- klient->sendeEncrypted( (char *)&spielId, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spielId, 4 );
|
|
|
}
|
|
|
break;
|
|
|
case 0x12: // Frage nach Spieler Id
|
|
@@ -969,14 +964,14 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
if( len )
|
|
|
{
|
|
|
- char *name = new char[ len + 1 ];
|
|
|
+ char* name = new char[ len + 1 ];
|
|
|
name[ (int)len ] = 0;
|
|
|
klient->getNachrichtEncrypted( name, len );
|
|
|
int id = is->zDB()->getAccountId( name );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
delete[]name;
|
|
|
}
|
|
|
}
|
|
@@ -991,14 +986,14 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
if( len )
|
|
|
{
|
|
|
- char *name = new char[ len + 1 ];
|
|
|
+ char* name = new char[ len + 1 ];
|
|
|
name[ (int)len ] = 0;
|
|
|
klient->getNachrichtEncrypted( name, len );
|
|
|
int id = is->zDB()->getChatroomId( name );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
delete[]name;
|
|
|
}
|
|
|
}
|
|
@@ -1014,10 +1009,10 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
int accountId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&accountId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&accountId, 4 );
|
|
|
int ret = is->zDB()->getSpielerPunkte( spielId, accountId );
|
|
|
- klient->sendeEncrypted( (char *)&ret, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&ret, 4 );
|
|
|
}
|
|
|
break;
|
|
|
case 0x15: // Frage nach Gruppe Administrator
|
|
@@ -1030,27 +1025,27 @@ void ISKlient::thread()
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int gruppeId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&gruppeId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&gruppeId, 4 );
|
|
|
int ret = is->zDB()->getGruppeAdminId( gruppeId );
|
|
|
- klient->sendeEncrypted( (char *)&ret, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&ret, 4 );
|
|
|
}
|
|
|
break;
|
|
|
case 0x16: // Frage nach Spiel Liste
|
|
|
if( klientNummer )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
- Array< int > *list = is->zDB()->getAccountSpielArtListe( klientNummer );
|
|
|
+ Array< int >* list = is->zDB()->getAccountSpielArtListe( klientNummer );
|
|
|
if( !list )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\0\0\0\0", 4 );
|
|
|
break;
|
|
|
}
|
|
|
int anz = list->getEintragAnzahl();
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
int id = list->get( i );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1061,9 +1056,9 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int id = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&id, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&id, 4 );
|
|
|
int v = is->zDB()->getNeusteSpielVersion( id );
|
|
|
- klient->sendeEncrypted( (char *)&v, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&v, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1073,7 +1068,7 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int k = is->zDB()->getKupfer( klientNummer );
|
|
|
- klient->sendeEncrypted( (char *)&k, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&k, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1083,9 +1078,9 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
int dgId = is->zDB()->getDateiGruppeVonSpiel( spielId );
|
|
|
- klient->sendeEncrypted( (char *)&dgId, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&dgId, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1095,8 +1090,8 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int dgId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&dgId, 4 );
|
|
|
- Text *pf = is->zDB()->getDateiGruppePfad( dgId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&dgId, 4 );
|
|
|
+ Text* pf = is->zDB()->getDateiGruppePfad( dgId );
|
|
|
if( !pf )
|
|
|
errorZuKlient( "Die Dateigruppe wurde nicht gefunden." );
|
|
|
else
|
|
@@ -1117,19 +1112,19 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
- Array< int > *list = is->zDB()->getAccountKarteListe( klientNummer, spielId );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
+ Array< int >* list = is->zDB()->getAccountKarteListe( klientNummer, spielId );
|
|
|
if( !list )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\0\0\0\0", 4 );
|
|
|
break;
|
|
|
}
|
|
|
int anz = list->getEintragAnzahl();
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
int id = list->get( i );
|
|
|
- klient->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&id, 4 );
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1140,7 +1135,7 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int gruppeId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&gruppeId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&gruppeId, 4 );
|
|
|
char gSH = (char)is->zDB()->getGruppeSpielerAdd( gruppeId );
|
|
|
klient->sendeEncrypted( &gSH, 1 );
|
|
|
}
|
|
@@ -1152,12 +1147,12 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- RCArray< Text > *datum = new RCArray< Text >();
|
|
|
- Array< double > *stOnline = new Array< double >();
|
|
|
- Array< double > *stSpiel = new Array< double >();
|
|
|
- Array< int > *anzSpiele = new Array< int >();
|
|
|
- Array< int > *anzGewonnen = new Array< int >();
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ RCArray< Text >* datum = new RCArray< Text >();
|
|
|
+ Array< double >* stOnline = new Array< double >();
|
|
|
+ Array< double >* stSpiel = new Array< double >();
|
|
|
+ Array< int >* anzSpiele = new Array< int >();
|
|
|
+ Array< int >* anzGewonnen = new Array< int >();
|
|
|
if( is->zDB()->getSpielerAktivity( acc, datum, stOnline, stSpiel, anzSpiele, anzGewonnen ) )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
@@ -1172,13 +1167,13 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
klient->sendeEncrypted( datum->z( i )->getText(), len );
|
|
|
double sto = stOnline->hat( i ) ? stOnline->get( i ) : 0;
|
|
|
- klient->sendeEncrypted( (char *)&sto, 8 );
|
|
|
+ klient->sendeEncrypted( (char*)&sto, 8 );
|
|
|
double sts = stSpiel->hat( i ) ? stSpiel->get( i ) : 0;
|
|
|
- klient->sendeEncrypted( (char *)&sts, 8 );
|
|
|
+ klient->sendeEncrypted( (char*)&sts, 8 );
|
|
|
int anzs = anzSpiele->hat( i ) ? anzSpiele->get( i ) : 0;
|
|
|
- klient->sendeEncrypted( (char *)&anzs, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anzs, 4 );
|
|
|
int anzg = anzGewonnen->hat( i ) ? anzGewonnen->get( i ) : 0;
|
|
|
- klient->sendeEncrypted( (char *)&anzg, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anzg, 4 );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1201,10 +1196,10 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
int karte = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&karte, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karte, 4 );
|
|
|
int anz = is->zDB()->getAccountKarteSpiele( acc, karte );
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1215,10 +1210,10 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
int karte = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&karte, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karte, 4 );
|
|
|
int anz = is->zDB()->getAccountKarteSpieleGewonnen( acc, karte );
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1229,8 +1224,8 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
int karte = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&karte, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karte, 4 );
|
|
|
char status = (char)is->zDB()->hatAccountKarte( acc, karte );
|
|
|
klient->sendeEncrypted( &status, 1 );
|
|
|
}
|
|
@@ -1243,8 +1238,8 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
int spiel = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&spiel, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spiel, 4 );
|
|
|
char status = (char)is->zDB()->hatAccountSpiel( acc, spiel );
|
|
|
klient->sendeEncrypted( &status, 1 );
|
|
|
}
|
|
@@ -1257,17 +1252,17 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
int spiel = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- klient->getNachrichtEncrypted( (char *)&spiel, 4 );
|
|
|
- Array< int > *res = is->zDB()->getAccountKarteGespieltListe( acc, spiel );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spiel, 4 );
|
|
|
+ Array< int >* res = is->zDB()->getAccountKarteGespieltListe( acc, spiel );
|
|
|
if( res )
|
|
|
{
|
|
|
int anz = res->getEintragAnzahl();
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
int val = res->get( i );
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
}
|
|
|
res->release();
|
|
|
}
|
|
@@ -1282,16 +1277,16 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- Array< int > *res = is->zDB()->getAccountSpielGespieltListe( acc );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ Array< int >* res = is->zDB()->getAccountSpielGespieltListe( acc );
|
|
|
if( res )
|
|
|
{
|
|
|
int anz = res->getEintragAnzahl();
|
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
int val = res->get( i );
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
}
|
|
|
res->release();
|
|
|
}
|
|
@@ -1306,17 +1301,17 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
Result res = is->zDB()->getSpielPartnerListe( acc );
|
|
|
- klient->sendeEncrypted( (char *)&res.zeilenAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&res.zeilenAnzahl, 4 );
|
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
|
{
|
|
|
int spieler = res.values[ i * 3 ];
|
|
|
int anzahl = res.values[ i * 3 + 1 ];
|
|
|
int karte = res.values[ i * 3 + 2 ];
|
|
|
- klient->sendeEncrypted( (char *)&spieler, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&karte, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&anzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spieler, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&karte, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&anzahl, 4 );
|
|
|
}
|
|
|
res.destroy();
|
|
|
}
|
|
@@ -1328,19 +1323,19 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
int seite = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&seite, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&seite, 4 );
|
|
|
char sortSpalte = 0;
|
|
|
char backwords = 0;
|
|
|
klient->getNachrichtEncrypted( &sortSpalte, 1 );
|
|
|
klient->getNachrichtEncrypted( &backwords, 1 );
|
|
|
int maxSeite = 0;
|
|
|
Result list = is->zDB()->getSpielStatistikListe( acc, &seite, &maxSeite, sortSpalte, backwords != 0 );
|
|
|
- klient->sendeEncrypted( (char *)&seite, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&maxSeite, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&list.zeilenAnzahl, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&list.feldAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&seite, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&maxSeite, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&list.zeilenAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&list.feldAnzahl, 4 );
|
|
|
for( int i = 0; i < list.zeilenAnzahl; i++ )
|
|
|
{
|
|
|
for( int j = 0; j < list.feldAnzahl; j++ )
|
|
@@ -1348,11 +1343,11 @@ void ISKlient::thread()
|
|
|
if( j != 1 )
|
|
|
{
|
|
|
int val = list.values[ j + i * list.feldAnzahl ];
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- char len = (char)( list.values[ j + i * list.feldAnzahl ].getLength() );
|
|
|
+ char len = (char)(list.values[ j + i * list.feldAnzahl ].getLength());
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( list.values[ j + i * list.feldAnzahl ], len );
|
|
@@ -1369,17 +1364,17 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int acc = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&acc, 4 );
|
|
|
- AHDaten *daten = is->zDB()->getSpielHistorie( acc, is );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
+ AHDaten* daten = is->zDB()->getSpielHistorie( acc, is );
|
|
|
if( daten )
|
|
|
{
|
|
|
char anz = (char)daten->spiele->getEintragAnzahl();
|
|
|
klient->sendeEncrypted( &anz, 1 );
|
|
|
for( char i = 0; i < anz; i++ )
|
|
|
{
|
|
|
- AHSpielDaten *spiel = daten->spiele->z( i );
|
|
|
- klient->sendeEncrypted( (char *)&spiel->id, 4 );
|
|
|
- klient->sendeEncrypted( (char *)&spiel->karteId, 4 );
|
|
|
+ AHSpielDaten* spiel = daten->spiele->z( i );
|
|
|
+ klient->sendeEncrypted( (char*)&spiel->id, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spiel->karteId, 4 );
|
|
|
char len = (char)spiel->spiel->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
@@ -1408,37 +1403,37 @@ void ISKlient::thread()
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( *spiel->gewinner, len );
|
|
|
- klient->sendeEncrypted( (char *)&spiel->sAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spiel->sAnzahl, 4 );
|
|
|
char tAnz = (char)spiel->teams->getEintragAnzahl();
|
|
|
klient->sendeEncrypted( &tAnz, 1 );
|
|
|
for( char j = 0; j < tAnz; j++ )
|
|
|
{
|
|
|
- AHSpielTeamDaten *team = spiel->teams->z( j );
|
|
|
+ AHSpielTeamDaten* team = spiel->teams->z( j );
|
|
|
char len = (char)team->name->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( *team->name, len );
|
|
|
- klient->sendeEncrypted( (char *)&team->sAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&team->sAnzahl, 4 );
|
|
|
len = (char)team->status->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( *team->status, len );
|
|
|
- klient->sendeEncrypted( (char *)&team->farbe, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&team->farbe, 4 );
|
|
|
char sAnz = (char)team->spieler->getEintragAnzahl();
|
|
|
klient->sendeEncrypted( &sAnz, 1 );
|
|
|
for( char k = 0; k < sAnz; k++ )
|
|
|
{
|
|
|
- AHSpielSpielerDaten *spieler = team->spieler->z( k );
|
|
|
+ AHSpielSpielerDaten* spieler = team->spieler->z( k );
|
|
|
char len = (char)spieler->name->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( *spieler->name, len );
|
|
|
- klient->sendeEncrypted( (char *)&spieler->punkte, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spieler->punkte, 4 );
|
|
|
len = (char)spieler->status->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( *spieler->status, len );
|
|
|
- klient->sendeEncrypted( (char *)&spieler->farbe, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&spieler->farbe, 4 );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1455,13 +1450,13 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int spielId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
|
int port = 0;
|
|
|
- Text *ip = new Text();
|
|
|
+ Text* ip = new Text();
|
|
|
if( is->zDB()->getHistorieServerPortIp( klientNummer, spielId, &port, ip ) )
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
|
char len = (char)ip->getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
klient->sendeEncrypted( *ip, len );
|
|
@@ -1478,13 +1473,13 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char len = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
- char *pf = new char[ len + 1 ];
|
|
|
+ klient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
+ char* pf = new char[ len + 1 ];
|
|
|
pf[ (int)len ] = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)pf, len );
|
|
|
+ klient->getNachrichtEncrypted( (char*)pf, len );
|
|
|
int dgId = is->zDB()->getDateiGruppeVonPfad( pf );
|
|
|
delete[] pf;
|
|
|
- klient->sendeEncrypted( (char *)&dgId, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&dgId, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1494,9 +1489,9 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int dg = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&dg, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&dg, 4 );
|
|
|
int v = is->zDB()->getNeusteDateiGruppe( dg );
|
|
|
- klient->sendeEncrypted( (char *)&v, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&v, 4 );
|
|
|
}
|
|
|
else
|
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1522,7 +1517,7 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int recht = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&recht, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&recht, 4 );
|
|
|
if( is->zDB()->hatKlientRecht( klientNummer, recht ) )
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
else
|
|
@@ -1539,8 +1534,8 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
unsigned char filterLen = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&filterLen, 1 );
|
|
|
- char *filter = new char[ filterLen + 1 ];
|
|
|
+ klient->getNachrichtEncrypted( (char*)&filterLen, 1 );
|
|
|
+ char* filter = new char[ filterLen + 1 ];
|
|
|
filter[ (int)filterLen ] = 0;
|
|
|
if( filterLen )
|
|
|
klient->getNachrichtEncrypted( filter, filterLen );
|
|
@@ -1550,11 +1545,11 @@ void ISKlient::thread()
|
|
|
klient->getNachrichtEncrypted( &sortRichtung, 1 );
|
|
|
Result res = is->zDB()->getKartenListe( klientNummer, filter, sortSpalte, sortRichtung );
|
|
|
delete[] filter;
|
|
|
- klient->sendeEncrypted( (char *)&res.zeilenAnzahl, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&res.zeilenAnzahl, 4 );
|
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
|
{
|
|
|
int val = res.values[ i * 6 ];
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
char len = (char)res.values[ i * 6 + 1 ].getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
if( len )
|
|
@@ -1564,11 +1559,11 @@ void ISKlient::thread()
|
|
|
if( len )
|
|
|
klient->sendeEncrypted( res.values[ i * 6 + 2 ], len );
|
|
|
val = res.values[ i * 6 + 3 ];
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
val = res.values[ i * 6 + 4 ];
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
val = res.values[ i * 6 + 5 ];
|
|
|
- klient->sendeEncrypted( (char *)&val, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&val, 4 );
|
|
|
}
|
|
|
res.destroy();
|
|
|
}
|
|
@@ -1583,7 +1578,7 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int karteId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
|
int port = 0;
|
|
|
Text ip;
|
|
|
if( !is->zDB()->getEditorServerPortIp( klientNummer, karteId, &port, &ip ) )
|
|
@@ -1592,7 +1587,7 @@ void ISKlient::thread()
|
|
|
break;
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
|
char len = (char)ip.getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
klient->sendeEncrypted( ip, len );
|
|
@@ -1608,7 +1603,7 @@ void ISKlient::thread()
|
|
|
{
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
int karteId = 0;
|
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
|
int port = 0;
|
|
|
Text ip;
|
|
|
if( !is->zDB()->getKartenServerPortIp( klientNummer, karteId, &port, &ip ) )
|
|
@@ -1617,7 +1612,7 @@ void ISKlient::thread()
|
|
|
break;
|
|
|
}
|
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
|
char len = (char)ip.getLength();
|
|
|
klient->sendeEncrypted( &len, 1 );
|
|
|
klient->sendeEncrypted( ip, len );
|
|
@@ -1639,7 +1634,7 @@ void ISKlient::thread()
|
|
|
}
|
|
|
|
|
|
// constant
|
|
|
-void ISKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
+void ISKlient::errorZuKlient( const char* nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
{
|
|
|
klient->sendeEncrypted( "\3", 1 );
|
|
|
char len = (char)textLength( nachricht );
|