|
@@ -39,7 +39,7 @@ ShopServer::ShopServer( InitDatei *zIni )
|
|
serverStarten();
|
|
serverStarten();
|
|
serverFortsetzen();
|
|
serverFortsetzen();
|
|
}
|
|
}
|
|
- updater = new Updater( getThis() );
|
|
|
|
|
|
+ updater = new Updater( (ShopServer *)getThis() );
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
@@ -74,7 +74,7 @@ void ShopServer::runn()
|
|
}
|
|
}
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
- ShSAKlient *clHandle = new ShSAKlient( klient, getThis() );
|
|
|
|
|
|
+ ShSAKlient * clHandle = new ShSAKlient( klient, (ShopServer *)getThis() );
|
|
clHandle->start();
|
|
clHandle->start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -87,8 +87,8 @@ void ShopServer::thread()
|
|
klient = server->getKlient();
|
|
klient = server->getKlient();
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
- Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
|
|
- ShSKlient *clHandle = new ShSKlient( klient, getThis() );
|
|
|
|
|
|
+ Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
|
|
+ ShSKlient * clHandle = new ShSKlient( klient, (ShopServer *)getThis() );
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klientAnzahl++;
|
|
klientAnzahl++;
|
|
@@ -113,7 +113,7 @@ void ShopServer::close()
|
|
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();
|
|
@@ -226,7 +226,7 @@ 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 );
|
|
@@ -290,25 +290,10 @@ char *ShopServer::getLetzterFehler() const
|
|
return fehler->getText();
|
|
return fehler->getText();
|
|
}
|
|
}
|
|
|
|
|
|
-// Reference Counting
|
|
|
|
-ShopServer *ShopServer::getThis()
|
|
|
|
-{
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-ShopServer *ShopServer::release()
|
|
|
|
-{
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
|
|
// 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;
|
|
@@ -346,13 +331,13 @@ void ShSAKlient::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 )
|
|
@@ -448,7 +433,7 @@ void ShSAKlient::thread()
|
|
}
|
|
}
|
|
else
|
|
else
|
|
ok = 1;
|
|
ok = 1;
|
|
- if( ok && shs->hatClients() )
|
|
|
|
|
|
+ if( ok &&shs->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;
|
|
@@ -544,7 +529,7 @@ 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 ) )
|
|
@@ -566,8 +551,8 @@ void ShSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachricht( (char*)&klientId, 4 );
|
|
|
|
- if( klientId && shs->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachricht( (char *)& klientId, 4 );
|
|
|
|
+ if( klientId &&shs->absturzKlient( klientId ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sende( "\0", 1 );
|
|
klient->sende( "\0", 1 );
|
|
@@ -599,16 +584,15 @@ 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;
|
|
- ref = 1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
@@ -639,7 +623,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;
|
|
@@ -670,8 +654,8 @@ void ShSKlient::thread()
|
|
if( 1 )
|
|
if( 1 )
|
|
{
|
|
{
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&klientId, 4 );
|
|
|
|
- if( klientId && shs->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& klientId, 4 );
|
|
|
|
+ if( klientId &&shs->absturzKlient( klientId ) )
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
@@ -701,23 +685,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 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& len, 1 );
|
|
char *suche = new 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 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -734,7 +718,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 = "";
|
|
@@ -744,7 +728,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 );
|
|
@@ -767,7 +751,7 @@ void ShSKlient::thread()
|
|
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 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& gr, 8 );
|
|
char *bytes = new char[ 2048 ];
|
|
char *bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
@@ -788,7 +772,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 = "";
|
|
@@ -798,7 +782,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 );
|
|
@@ -830,7 +814,7 @@ 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() );
|
|
@@ -843,7 +827,7 @@ void ShSKlient::thread()
|
|
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 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& gr, 8 );
|
|
char *bytes = new char[ 2048 ];
|
|
char *bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
@@ -867,9 +851,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." );
|
|
@@ -879,9 +863,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." );
|
|
@@ -891,9 +875,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." );
|
|
@@ -903,11 +887,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." );
|
|
@@ -917,7 +901,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 );
|
|
@@ -934,25 +918,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 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& len, 1 );
|
|
char *suche = new 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 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -969,7 +953,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 = "";
|
|
@@ -979,7 +963,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 );
|
|
@@ -1002,7 +986,7 @@ void ShSKlient::thread()
|
|
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 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& gr, 8 );
|
|
char *bytes = new char[ 2048 ];
|
|
char *bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
@@ -1023,7 +1007,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 = "";
|
|
@@ -1033,7 +1017,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 );
|
|
@@ -1065,7 +1049,7 @@ 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() );
|
|
@@ -1078,7 +1062,7 @@ void ShSKlient::thread()
|
|
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 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& gr, 8 );
|
|
char *bytes = new char[ 2048 ];
|
|
char *bytes = new char[ 2048 ];
|
|
while( gr > 0 )
|
|
while( gr > 0 )
|
|
{
|
|
{
|
|
@@ -1102,9 +1086,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." );
|
|
@@ -1114,9 +1098,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." );
|
|
@@ -1126,9 +1110,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." );
|
|
@@ -1138,11 +1122,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." );
|
|
@@ -1152,7 +1136,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 );
|
|
@@ -1202,19 +1186,4 @@ void ShSKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehl
|
|
int ShSKlient::getKlientNummer() const // gibt die KlientId zurück
|
|
int ShSKlient::getKlientNummer() const // gibt die KlientId zurück
|
|
{
|
|
{
|
|
return klientNummer;
|
|
return klientNummer;
|
|
-}
|
|
|
|
-
|
|
|
|
-// Reference Counting
|
|
|
|
-ShSKlient *ShSKlient::getThis()
|
|
|
|
-{
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-ShSKlient *ShSKlient::release()
|
|
|
|
-{
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|