|
@@ -5,18 +5,17 @@
|
|
|
|
|
|
// Inhalt der ShopServer Klasse aus ShopServer.h
|
|
// Inhalt der ShopServer Klasse aus ShopServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-ShopServer::ShopServer( InitDatei *zIni )
|
|
|
|
|
|
+ShopServer::ShopServer( InitDatei* zIni )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
Network::Start( 100 );
|
|
Network::Start( 100 );
|
|
std::cout << "ShS: Verbindung mit Datenbank wird hergestellt...\n";
|
|
std::cout << "ShS: Verbindung mit Datenbank wird hergestellt...\n";
|
|
db = new ShSDatenbank( zIni );
|
|
db = new ShSDatenbank( zIni );
|
|
- klientAnzahl = 0;
|
|
|
|
klients = new RCArray< ShSKlient >();
|
|
klients = new RCArray< ShSKlient >();
|
|
empfangen = 0;
|
|
empfangen = 0;
|
|
gesendet = 0;
|
|
gesendet = 0;
|
|
fehler = new Text();
|
|
fehler = new Text();
|
|
- ini = dynamic_cast<InitDatei *>( zIni->getThis() );
|
|
|
|
|
|
+ ini = dynamic_cast<InitDatei*>(zIni->getThis());
|
|
id = *zIni->zWert( "ServerId" );
|
|
id = *zIni->zWert( "ServerId" );
|
|
server = new Server();
|
|
server = new Server();
|
|
aServer = new SSLServer();
|
|
aServer = new SSLServer();
|
|
@@ -38,7 +37,7 @@ ShopServer::ShopServer( InitDatei *zIni )
|
|
serverStarten();
|
|
serverStarten();
|
|
serverFortsetzen();
|
|
serverFortsetzen();
|
|
}
|
|
}
|
|
- updater = new Updater( dynamic_cast<ShopServer *>( getThis() ) );
|
|
|
|
|
|
+ updater = new Updater( dynamic_cast<ShopServer*>(getThis()) );
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
@@ -62,18 +61,18 @@ void ShopServer::runn()
|
|
{
|
|
{
|
|
while( !end && aServer->isConnected() )
|
|
while( !end && aServer->isConnected() )
|
|
{
|
|
{
|
|
- SSLSKlient *klient;
|
|
|
|
|
|
+ SSLSKlient* klient;
|
|
klient = aServer->getKlient();
|
|
klient = aServer->getKlient();
|
|
if( end && klient )
|
|
if( end && klient )
|
|
{
|
|
{
|
|
klient->trenne();
|
|
klient->trenne();
|
|
- klient = (SSLSKlient *)klient->release();
|
|
|
|
|
|
+ klient = (SSLSKlient*)klient->release();
|
|
Sleep( 1000 );
|
|
Sleep( 1000 );
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
- ShSAKlient *clHandle = new ShSAKlient( klient, dynamic_cast<ShopServer *>( getThis() ) );
|
|
|
|
|
|
+ ShSAKlient* clHandle = new ShSAKlient( klient, dynamic_cast<ShopServer*>(getThis()) );
|
|
clHandle->start();
|
|
clHandle->start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -82,15 +81,14 @@ void ShopServer::thread()
|
|
{
|
|
{
|
|
while( server->isConnected() )
|
|
while( server->isConnected() )
|
|
{
|
|
{
|
|
- SKlient *klient;
|
|
|
|
|
|
+ SKlient* klient;
|
|
klient = server->getKlient();
|
|
klient = server->getKlient();
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
- ShSKlient *clHandle = new ShSKlient( klient, dynamic_cast<ShopServer *>( getThis() ) );
|
|
|
|
|
|
+ ShSKlient* clHandle = new ShSKlient( klient, dynamic_cast<ShopServer*>(getThis()) );
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
- klients->set( clHandle, klientAnzahl );
|
|
|
|
- klientAnzahl++;
|
|
|
|
|
|
+ klients->add( clHandle );
|
|
LeaveCriticalSection( &cs );
|
|
LeaveCriticalSection( &cs );
|
|
clHandle->start();
|
|
clHandle->start();
|
|
}
|
|
}
|
|
@@ -104,15 +102,14 @@ void ShopServer::close()
|
|
warteAufThread( 1000 );
|
|
warteAufThread( 1000 );
|
|
#endif
|
|
#endif
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
klients->z( i )->absturz();
|
|
klients->z( i )->absturz();
|
|
- klients = ( RCArray<ShSKlient>* ) klients->release();
|
|
|
|
- klientAnzahl = 0;
|
|
|
|
|
|
+ klients = (RCArray<ShSKlient>*) klients->release();
|
|
LeaveCriticalSection( &cs );
|
|
LeaveCriticalSection( &cs );
|
|
ende();
|
|
ende();
|
|
run = 0;
|
|
run = 0;
|
|
end = 1;
|
|
end = 1;
|
|
- Klient *klient = new Klient();
|
|
|
|
|
|
+ Klient* klient = new Klient();
|
|
klient->verbinde( aServer->getPort(), "127.0.0.1" );
|
|
klient->verbinde( aServer->getPort(), "127.0.0.1" );
|
|
Sleep( 500 );
|
|
Sleep( 500 );
|
|
aServer->trenne();
|
|
aServer->trenne();
|
|
@@ -210,13 +207,12 @@ bool ShopServer::absturzKlient( int klientId )
|
|
{
|
|
{
|
|
bool gefunden = 0;
|
|
bool gefunden = 0;
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
{
|
|
{
|
|
if( klients->z( i )->getKlientNummer() == klientId )
|
|
if( klients->z( i )->getKlientNummer() == klientId )
|
|
{
|
|
{
|
|
klients->z( i )->absturz();
|
|
klients->z( i )->absturz();
|
|
klients->remove( i );
|
|
klients->remove( i );
|
|
- klientAnzahl--;
|
|
|
|
gefunden = 1;
|
|
gefunden = 1;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -225,16 +221,15 @@ bool ShopServer::absturzKlient( int klientId )
|
|
return gefunden;
|
|
return gefunden;
|
|
}
|
|
}
|
|
|
|
|
|
-bool ShopServer::removeKlient( ShSKlient *zKlient )
|
|
|
|
|
|
+bool ShopServer::removeKlient( ShSKlient* zKlient )
|
|
{
|
|
{
|
|
bool gefunden = 0;
|
|
bool gefunden = 0;
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
- for( int i = 0; i < klientAnzahl; i++ )
|
|
|
|
|
|
+ for( int i = 0; i < klients->getEintragAnzahl(); i++ )
|
|
{
|
|
{
|
|
if( klients->z( i ) == zKlient )
|
|
if( klients->z( i ) == zKlient )
|
|
{
|
|
{
|
|
klients->remove( i );
|
|
klients->remove( i );
|
|
- klientAnzahl--;
|
|
|
|
gefunden = 1;
|
|
gefunden = 1;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -259,22 +254,22 @@ bool ShopServer::istAn() const
|
|
return db->serverIstNichtPausiert( id );
|
|
return db->serverIstNichtPausiert( id );
|
|
}
|
|
}
|
|
|
|
|
|
-Server *ShopServer::zServer() const
|
|
|
|
|
|
+Server* ShopServer::zServer() const
|
|
{
|
|
{
|
|
return server;
|
|
return server;
|
|
}
|
|
}
|
|
|
|
|
|
-ShSDatenbank *ShopServer::zDB() const
|
|
|
|
|
|
+ShSDatenbank* ShopServer::zDB() const
|
|
{
|
|
{
|
|
return db;
|
|
return db;
|
|
}
|
|
}
|
|
|
|
|
|
bool ShopServer::hatClients() const
|
|
bool ShopServer::hatClients() const
|
|
{
|
|
{
|
|
- return klientAnzahl > 0;
|
|
|
|
|
|
+ return klients->hat( 0 );
|
|
}
|
|
}
|
|
|
|
|
|
-InitDatei *ShopServer::zInit() const
|
|
|
|
|
|
+InitDatei* ShopServer::zInit() const
|
|
{
|
|
{
|
|
return ini;
|
|
return ini;
|
|
}
|
|
}
|
|
@@ -284,7 +279,7 @@ int ShopServer::getId() const
|
|
return id;
|
|
return id;
|
|
}
|
|
}
|
|
|
|
|
|
-char *ShopServer::getLetzterFehler() const
|
|
|
|
|
|
+char* ShopServer::getLetzterFehler() const
|
|
{
|
|
{
|
|
return fehler->getText();
|
|
return fehler->getText();
|
|
}
|
|
}
|
|
@@ -292,7 +287,7 @@ char *ShopServer::getLetzterFehler() const
|
|
|
|
|
|
// Inhalt der ShSAKlient Klasse aus ShopServer.h
|
|
// Inhalt der ShSAKlient Klasse aus ShopServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-ShSAKlient::ShSAKlient( SSLSKlient *klient, ShopServer *shs )
|
|
|
|
|
|
+ShSAKlient::ShSAKlient( SSLSKlient* klient, ShopServer* shs )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
@@ -330,14 +325,14 @@ void ShSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
unsigned char nLen = 0;
|
|
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;
|
|
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 );
|
|
|
|
- char *p = new char[ pLen + 1 ];
|
|
|
|
|
|
+ klient->getNachricht( (char*)&pLen, 1 );
|
|
|
|
+ char* p = new char[ pLen + 1 ];
|
|
p[ (int)pLen ] = 0;
|
|
p[ (int)pLen ] = 0;
|
|
if( pLen )
|
|
if( pLen )
|
|
klient->getNachricht( p, pLen );
|
|
klient->getNachricht( p, pLen );
|
|
@@ -374,7 +369,7 @@ void ShSAKlient::thread()
|
|
{
|
|
{
|
|
if( !shs->serverStarten() )
|
|
if( !shs->serverStarten() )
|
|
{
|
|
{
|
|
- Text *err = new Text();
|
|
|
|
|
|
+ Text* err = new Text();
|
|
err->append( shs->getLetzterFehler() );
|
|
err->append( shs->getLetzterFehler() );
|
|
errorZuKlient( err->getText() );
|
|
errorZuKlient( err->getText() );
|
|
err->release();
|
|
err->release();
|
|
@@ -397,7 +392,7 @@ void ShSAKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Text *err = new Text();
|
|
|
|
|
|
+ Text* err = new Text();
|
|
err->append( shs->getLetzterFehler() );
|
|
err->append( shs->getLetzterFehler() );
|
|
errorZuKlient( err->getText() );
|
|
errorZuKlient( err->getText() );
|
|
err->release();
|
|
err->release();
|
|
@@ -421,7 +416,7 @@ void ShSAKlient::thread()
|
|
ok = 1;
|
|
ok = 1;
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Text *err = new Text();
|
|
|
|
|
|
+ Text* err = new Text();
|
|
err->append( shs->getLetzterFehler() );
|
|
err->append( shs->getLetzterFehler() );
|
|
errorZuKlient( err->getText() );
|
|
errorZuKlient( err->getText() );
|
|
err->release();
|
|
err->release();
|
|
@@ -506,7 +501,7 @@ void ShSAKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Text *err = new Text();
|
|
|
|
|
|
+ Text* err = new Text();
|
|
err->append( shs->getLetzterFehler() );
|
|
err->append( shs->getLetzterFehler() );
|
|
errorZuKlient( err->getText() );
|
|
errorZuKlient( err->getText() );
|
|
err->release();
|
|
err->release();
|
|
@@ -528,14 +523,14 @@ void ShSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int maxK = 0;
|
|
int maxK = 0;
|
|
- klient->getNachricht( (char *)&maxK, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char*)&maxK, 4 );
|
|
if( shs->zDB()->adminHatRecht( adminId, Admin_Recht::ShSMKChange ) )
|
|
if( shs->zDB()->adminHatRecht( adminId, Admin_Recht::ShSMKChange ) )
|
|
{
|
|
{
|
|
if( shs->setMaxKarten( maxK ) )
|
|
if( shs->setMaxKarten( maxK ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Text *err = new Text();
|
|
|
|
|
|
+ Text* err = new Text();
|
|
err->append( shs->getLetzterFehler() );
|
|
err->append( shs->getLetzterFehler() );
|
|
errorZuKlient( err->getText() );
|
|
errorZuKlient( err->getText() );
|
|
err->release();
|
|
err->release();
|
|
@@ -550,7 +545,7 @@ void ShSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachricht( (char *)&klientId, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char*)&klientId, 4 );
|
|
if( klientId && shs->absturzKlient( klientId ) )
|
|
if( klientId && shs->absturzKlient( klientId ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
@@ -572,7 +567,7 @@ void ShSAKlient::thread()
|
|
delete this;
|
|
delete this;
|
|
}
|
|
}
|
|
|
|
|
|
-void ShSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
|
|
|
+void ShSAKlient::errorZuKlient( const char* nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
{
|
|
{
|
|
klient->sende( "\3", 1 );
|
|
klient->sende( "\3", 1 );
|
|
char len = (char)textLength( nachricht );
|
|
char len = (char)textLength( nachricht );
|
|
@@ -583,13 +578,13 @@ void ShSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Feh
|
|
|
|
|
|
// Inhalt der ShSKlient aus ShopServer.h
|
|
// Inhalt der ShSKlient aus ShopServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-ShSKlient::ShSKlient( SKlient *klient, ShopServer *shs )
|
|
|
|
|
|
+ShSKlient::ShSKlient( SKlient* klient, ShopServer* shs )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
unsigned char key[ 20 ] = { 218, 226, 231, 216, 68, 63, 132, 155, 49, 235, 239, 0, 19, 23, 116, 244, 235, 21, 189, 53 };
|
|
unsigned char key[ 20 ] = { 218, 226, 231, 216, 68, 63, 132, 155, 49, 235, 239, 0, 19, 23, 116, 244, 235, 21, 189, 53 };
|
|
- klient->setSendeKey( (char *)key, 20 );
|
|
|
|
- klient->setEmpfangKey( (char *)key, 20 );
|
|
|
|
|
|
+ klient->setSendeKey( (char*)key, 20 );
|
|
|
|
+ klient->setEmpfangKey( (char*)key, 20 );
|
|
klientNummer = 0;
|
|
klientNummer = 0;
|
|
this->shs = shs;
|
|
this->shs = shs;
|
|
}
|
|
}
|
|
@@ -622,7 +617,7 @@ void ShSKlient::thread()
|
|
switch( c )
|
|
switch( c )
|
|
{
|
|
{
|
|
case 1: // Klient identifikation
|
|
case 1: // Klient identifikation
|
|
- klient->getNachrichtEncrypted( (char *)&klientNummer, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&klientNummer, 4 );
|
|
if( !shs->zDB()->proveKlient( klientNummer, shs->getId() ) )
|
|
if( !shs->zDB()->proveKlient( klientNummer, shs->getId() ) )
|
|
{
|
|
{
|
|
klientNummer = 0;
|
|
klientNummer = 0;
|
|
@@ -630,7 +625,7 @@ void ShSKlient::thread()
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Text *key = shs->zDB()->getKlientKey( klientNummer );
|
|
|
|
|
|
+ Text* key = shs->zDB()->getKlientKey( klientNummer );
|
|
if( !key )
|
|
if( !key )
|
|
errorZuKlient( "Es konnte kein Key ermittelt werden." );
|
|
errorZuKlient( "Es konnte kein Key ermittelt werden." );
|
|
else
|
|
else
|
|
@@ -653,7 +648,7 @@ void ShSKlient::thread()
|
|
if( 1 )
|
|
if( 1 )
|
|
{
|
|
{
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&klientId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&klientId, 4 );
|
|
if( klientId && shs->absturzKlient( klientId ) )
|
|
if( klientId && shs->absturzKlient( klientId ) )
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
else
|
|
else
|
|
@@ -684,23 +679,23 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
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;
|
|
suche[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
klient->getNachrichtEncrypted( suche, len );
|
|
klient->getNachrichtEncrypted( suche, len );
|
|
- Array< int > *list = new Array< int >();
|
|
|
|
|
|
+ Array< int >* list = new Array< int >();
|
|
if( shs->zDB()->getSpielArtListe( klientNummer, suche, list ) )
|
|
if( shs->zDB()->getSpielArtListe( klientNummer, suche, list ) )
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int anz = list->getEintragAnzahl();
|
|
int anz = list->getEintragAnzahl();
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
if( anz )
|
|
if( anz )
|
|
{
|
|
{
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
int w = list->get( i );
|
|
int w = list->get( i );
|
|
- klient->sendeEncrypted( (char *)&w, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&w, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -717,7 +712,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
if( !shs->zDB()->proveSpiel( shs->getId(), spielId ) )
|
|
if( !shs->zDB()->proveSpiel( shs->getId(), spielId ) )
|
|
{
|
|
{
|
|
Text ip = "";
|
|
Text ip = "";
|
|
@@ -727,7 +722,7 @@ void ShSKlient::thread()
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
char len = (char)ip.getLength();
|
|
char len = (char)ip.getLength();
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
@@ -735,7 +730,7 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Text *pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
|
|
|
|
+ Text* pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
pfad->append( "/spiele/" );
|
|
pfad->append( "/spiele/" );
|
|
pfad->append( spielId );
|
|
pfad->append( spielId );
|
|
pfad->append( "/titelbg.ltdb" );
|
|
pfad->append( "/titelbg.ltdb" );
|
|
@@ -746,12 +741,12 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
- Datei *dat = new Datei();
|
|
|
|
|
|
+ Datei* dat = new Datei();
|
|
dat->setDatei( pfad );
|
|
dat->setDatei( pfad );
|
|
dat->open( Datei::Style::lesen );
|
|
dat->open( Datei::Style::lesen );
|
|
__int64 gr = dat->getSize();
|
|
__int64 gr = dat->getSize();
|
|
- klient->sendeEncrypted( (char *)&gr, 8 );
|
|
|
|
- char *bytes = new char[ 2048 ];
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&gr, 8 );
|
|
|
|
+ char* bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
@@ -771,7 +766,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
if( !shs->zDB()->proveSpiel( shs->getId(), spielId ) )
|
|
if( !shs->zDB()->proveSpiel( shs->getId(), spielId ) )
|
|
{
|
|
{
|
|
Text ip = "";
|
|
Text ip = "";
|
|
@@ -781,7 +776,7 @@ void ShSKlient::thread()
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
char len = (char)ip.getLength();
|
|
char len = (char)ip.getLength();
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
@@ -789,7 +784,7 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Text *pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
|
|
|
|
+ Text* pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
pfad->append( "/spiele/" );
|
|
pfad->append( "/spiele/" );
|
|
pfad->append( spielId );
|
|
pfad->append( spielId );
|
|
pfad->append( "/seite" );
|
|
pfad->append( "/seite" );
|
|
@@ -800,9 +795,9 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
- Datei *dat = new Datei();
|
|
|
|
|
|
+ Datei* dat = new Datei();
|
|
dat->setDatei( pfad );
|
|
dat->setDatei( pfad );
|
|
- RCArray< Text > *list = dat->getDateiListe();
|
|
|
|
|
|
+ RCArray< Text >* list = dat->getDateiListe();
|
|
int dAnz = list->getEintragAnzahl();
|
|
int dAnz = list->getEintragAnzahl();
|
|
for( int i = 0; i < dAnz; i++ )
|
|
for( int i = 0; i < dAnz; i++ )
|
|
{
|
|
{
|
|
@@ -813,21 +808,21 @@ void ShSKlient::thread()
|
|
i--;
|
|
i--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- klient->sendeEncrypted( (char *)&dAnz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&dAnz, 4 );
|
|
for( int i = 0; i < dAnz; i++ )
|
|
for( int i = 0; i < dAnz; i++ )
|
|
{
|
|
{
|
|
- Text *pf = new Text( dat->zPfad()->getText() );
|
|
|
|
|
|
+ Text* pf = new Text( dat->zPfad()->getText() );
|
|
pf->append( "/" );
|
|
pf->append( "/" );
|
|
pf->append( list->z( i )->getText() );
|
|
pf->append( list->z( i )->getText() );
|
|
- Datei *d = new Datei();
|
|
|
|
|
|
+ Datei* d = new Datei();
|
|
d->setDatei( pf );
|
|
d->setDatei( pf );
|
|
d->open( Datei::Style::lesen );
|
|
d->open( Datei::Style::lesen );
|
|
char nl = (char)list->z( i )->getLength();
|
|
char nl = (char)list->z( i )->getLength();
|
|
klient->sendeEncrypted( &nl, 1 );
|
|
klient->sendeEncrypted( &nl, 1 );
|
|
klient->sendeEncrypted( list->z( i )->getText(), nl );
|
|
klient->sendeEncrypted( list->z( i )->getText(), nl );
|
|
__int64 gr = d->getSize();
|
|
__int64 gr = d->getSize();
|
|
- klient->sendeEncrypted( (char *)&gr, 8 );
|
|
|
|
- char *bytes = new char[ 2048 ];
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&gr, 8 );
|
|
|
|
+ char* bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
@@ -850,9 +845,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
int status = shs->zDB()->getSpielBesitzStatus( klientNummer, spielId );
|
|
int status = shs->zDB()->getSpielBesitzStatus( klientNummer, spielId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -862,9 +857,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
int status = shs->zDB()->getSpielTestversionStatus( klientNummer, spielId );
|
|
int status = shs->zDB()->getSpielTestversionStatus( klientNummer, spielId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -874,9 +869,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
int status = shs->zDB()->getSpielErwerbbarStatus( klientNummer, spielId );
|
|
int status = shs->zDB()->getSpielErwerbbarStatus( klientNummer, spielId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -886,11 +881,11 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
char testVersion = 0;
|
|
char testVersion = 0;
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
int status = shs->zDB()->getSpielPreis( spielId, testVersion == 1 );
|
|
int status = shs->zDB()->getSpielPreis( spielId, testVersion == 1 );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -900,7 +895,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
char testVersion = 0;
|
|
char testVersion = 0;
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
bool ok = shs->zDB()->spielKaufen( klientNummer, spielId, testVersion == 1 );
|
|
bool ok = shs->zDB()->spielKaufen( klientNummer, spielId, testVersion == 1 );
|
|
@@ -917,25 +912,25 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int spielId = 0;
|
|
int spielId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&spielId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&spielId, 4 );
|
|
unsigned char len = 0;
|
|
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;
|
|
suche[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
klient->getNachrichtEncrypted( suche, len );
|
|
klient->getNachrichtEncrypted( suche, len );
|
|
- Array< int > *list = new Array< int >();
|
|
|
|
|
|
+ Array< int >* list = new Array< int >();
|
|
if( shs->zDB()->getKarteListe( klientNummer, spielId, suche, list ) )
|
|
if( shs->zDB()->getKarteListe( klientNummer, spielId, suche, list ) )
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int anz = list->getEintragAnzahl();
|
|
int anz = list->getEintragAnzahl();
|
|
- klient->sendeEncrypted( (char *)&anz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&anz, 4 );
|
|
if( anz )
|
|
if( anz )
|
|
{
|
|
{
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
int w = list->get( i );
|
|
int w = list->get( i );
|
|
- klient->sendeEncrypted( (char *)&w, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&w, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -952,7 +947,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
if( !shs->zDB()->proveKarte( shs->getId(), karteId ) )
|
|
if( !shs->zDB()->proveKarte( shs->getId(), karteId ) )
|
|
{
|
|
{
|
|
Text ip = "";
|
|
Text ip = "";
|
|
@@ -962,7 +957,7 @@ void ShSKlient::thread()
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
char len = (char)ip.getLength();
|
|
char len = (char)ip.getLength();
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
@@ -970,7 +965,7 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Text *pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
|
|
|
|
+ Text* pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
pfad->append( "/karten/" );
|
|
pfad->append( "/karten/" );
|
|
pfad->append( karteId );
|
|
pfad->append( karteId );
|
|
pfad->append( "/titelbg.ltdb" );
|
|
pfad->append( "/titelbg.ltdb" );
|
|
@@ -981,12 +976,12 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
- Datei *dat = new Datei();
|
|
|
|
|
|
+ Datei* dat = new Datei();
|
|
dat->setDatei( pfad );
|
|
dat->setDatei( pfad );
|
|
dat->open( Datei::Style::lesen );
|
|
dat->open( Datei::Style::lesen );
|
|
__int64 gr = dat->getSize();
|
|
__int64 gr = dat->getSize();
|
|
- klient->sendeEncrypted( (char *)&gr, 8 );
|
|
|
|
- char *bytes = new char[ 2048 ];
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&gr, 8 );
|
|
|
|
+ char* bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
@@ -1006,7 +1001,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
if( !shs->zDB()->proveKarte( shs->getId(), karteId ) )
|
|
if( !shs->zDB()->proveKarte( shs->getId(), karteId ) )
|
|
{
|
|
{
|
|
Text ip = "";
|
|
Text ip = "";
|
|
@@ -1016,7 +1011,7 @@ void ShSKlient::thread()
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)&port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&port, 4 );
|
|
char len = (char)ip.getLength();
|
|
char len = (char)ip.getLength();
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( &len, 1 );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
klient->sendeEncrypted( ip.getText(), len );
|
|
@@ -1024,7 +1019,7 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Text *pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
|
|
|
|
+ Text* pfad = new Text( shs->zInit()->zWert( "ShopSeitenPfad" )->getText() );
|
|
pfad->append( "/karten/" );
|
|
pfad->append( "/karten/" );
|
|
pfad->append( karteId );
|
|
pfad->append( karteId );
|
|
pfad->append( "/seite" );
|
|
pfad->append( "/seite" );
|
|
@@ -1035,9 +1030,9 @@ void ShSKlient::thread()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
- Datei *dat = new Datei();
|
|
|
|
|
|
+ Datei* dat = new Datei();
|
|
dat->setDatei( pfad );
|
|
dat->setDatei( pfad );
|
|
- RCArray< Text > *list = dat->getDateiListe();
|
|
|
|
|
|
+ RCArray< Text >* list = dat->getDateiListe();
|
|
int dAnz = list->getEintragAnzahl();
|
|
int dAnz = list->getEintragAnzahl();
|
|
for( int i = 0; i < dAnz; i++ )
|
|
for( int i = 0; i < dAnz; i++ )
|
|
{
|
|
{
|
|
@@ -1048,21 +1043,21 @@ void ShSKlient::thread()
|
|
i--;
|
|
i--;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- klient->sendeEncrypted( (char *)&dAnz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&dAnz, 4 );
|
|
for( int i = 0; i < dAnz; i++ )
|
|
for( int i = 0; i < dAnz; i++ )
|
|
{
|
|
{
|
|
- Text *pf = new Text( dat->zPfad()->getText() );
|
|
|
|
|
|
+ Text* pf = new Text( dat->zPfad()->getText() );
|
|
pf->append( "/" );
|
|
pf->append( "/" );
|
|
pf->append( list->z( i )->getText() );
|
|
pf->append( list->z( i )->getText() );
|
|
- Datei *d = new Datei();
|
|
|
|
|
|
+ Datei* d = new Datei();
|
|
d->setDatei( pf );
|
|
d->setDatei( pf );
|
|
d->open( Datei::Style::lesen );
|
|
d->open( Datei::Style::lesen );
|
|
char nl = (char)list->z( i )->getLength();
|
|
char nl = (char)list->z( i )->getLength();
|
|
klient->sendeEncrypted( &nl, 1 );
|
|
klient->sendeEncrypted( &nl, 1 );
|
|
klient->sendeEncrypted( list->z( i )->getText(), nl );
|
|
klient->sendeEncrypted( list->z( i )->getText(), nl );
|
|
__int64 gr = d->getSize();
|
|
__int64 gr = d->getSize();
|
|
- klient->sendeEncrypted( (char *)&gr, 8 );
|
|
|
|
- char *bytes = new char[ 2048 ];
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&gr, 8 );
|
|
|
|
+ char* bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
int len = gr > 2048 ? 2048 : (int)gr;
|
|
@@ -1085,9 +1080,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
int status = shs->zDB()->getKarteBesitzStatus( klientNummer, karteId );
|
|
int status = shs->zDB()->getKarteBesitzStatus( klientNummer, karteId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1097,9 +1092,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
int status = shs->zDB()->getKarteTestversionStatus( klientNummer, karteId );
|
|
int status = shs->zDB()->getKarteTestversionStatus( klientNummer, karteId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1109,9 +1104,9 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
int status = shs->zDB()->getKarteErwerbbarStatus( klientNummer, karteId );
|
|
int status = shs->zDB()->getKarteErwerbbarStatus( klientNummer, karteId );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1121,11 +1116,11 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
char testVersion = 0;
|
|
char testVersion = 0;
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
int status = shs->zDB()->getKartePreis( karteId, testVersion == 1 );
|
|
int status = shs->zDB()->getKartePreis( karteId, testVersion == 1 );
|
|
- klient->sendeEncrypted( (char *)&status, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char*)&status, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
errorZuKlient( "Du bist nicht Identifiziert." );
|
|
@@ -1135,7 +1130,7 @@ void ShSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int karteId = 0;
|
|
int karteId = 0;
|
|
- klient->getNachrichtEncrypted( (char *)&karteId, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char*)&karteId, 4 );
|
|
char testVersion = 0;
|
|
char testVersion = 0;
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
klient->getNachrichtEncrypted( &testVersion, 1 );
|
|
bool ok = shs->zDB()->karteKaufen( klientNummer, karteId, testVersion == 1 );
|
|
bool ok = shs->zDB()->karteKaufen( klientNummer, karteId, testVersion == 1 );
|
|
@@ -1174,7 +1169,7 @@ void ShSKlient::thread()
|
|
}
|
|
}
|
|
|
|
|
|
// constant
|
|
// constant
|
|
-void ShSKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
|
|
|
|
+void ShSKlient::errorZuKlient( const char* nachricht ) const // sendet eine Fehlernachricht zum Klient
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\3", 1 );
|
|
klient->sendeEncrypted( "\3", 1 );
|
|
char len = (char)textLength( nachricht );
|
|
char len = (char)textLength( nachricht );
|