|
@@ -33,7 +33,6 @@ MinigameServer::MinigameServer( InitDatei *zIni )
|
|
end = 0;
|
|
end = 0;
|
|
nichtPausiert = 0;
|
|
nichtPausiert = 0;
|
|
InitializeCriticalSection( &cs );
|
|
InitializeCriticalSection( &cs );
|
|
- ref = 1;
|
|
|
|
if( zIni->zWert( "Aktiv" )->istGleich( "TRUE" ) )
|
|
if( zIni->zWert( "Aktiv" )->istGleich( "TRUE" ) )
|
|
{
|
|
{
|
|
serverStarten();
|
|
serverStarten();
|
|
@@ -72,7 +71,7 @@ void MinigameServer::runn()
|
|
}
|
|
}
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
- MSAKlient *clHandle = new MSAKlient( klient, getThis() );
|
|
|
|
|
|
+ MSAKlient * clHandle = new MSAKlient( klient, (MinigameServer *)getThis() );
|
|
clHandle->start();
|
|
clHandle->start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -86,7 +85,7 @@ void MinigameServer::thread()
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
- MSKlient *clHandle = new MSKlient( klient, getThis() );
|
|
|
|
|
|
+ MSKlient * clHandle = new MSKlient( klient, (MinigameServer *)getThis() );
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klientAnzahl++;
|
|
klientAnzahl++;
|
|
@@ -111,7 +110,7 @@ void MinigameServer::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();
|
|
@@ -224,7 +223,7 @@ bool MinigameServer::absturzKlient( int klientId )
|
|
return gefunden;
|
|
return gefunden;
|
|
}
|
|
}
|
|
|
|
|
|
-bool MinigameServer::removeKlient( MSKlient *zKlient )
|
|
|
|
|
|
+bool MinigameServer::removeKlient( MSKlient * zKlient )
|
|
{
|
|
{
|
|
bool gefunden = 0;
|
|
bool gefunden = 0;
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
@@ -288,25 +287,10 @@ InitDatei *MinigameServer::zInit() const
|
|
return ini;
|
|
return ini;
|
|
}
|
|
}
|
|
|
|
|
|
-// Reference Counting
|
|
|
|
-MinigameServer *MinigameServer::getThis()
|
|
|
|
-{
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-MinigameServer *MinigameServer::release()
|
|
|
|
-{
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
|
|
// Inhalt der LSAKlient Klasse aus LoginServer.h
|
|
// Inhalt der LSAKlient Klasse aus LoginServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-MSAKlient::MSAKlient( SSLSKlient *klient, MinigameServer *ls )
|
|
|
|
|
|
+MSAKlient::MSAKlient( SSLSKlient * klient, MinigameServer * ls )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
@@ -345,13 +329,13 @@ void MSAKlient::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 )
|
|
@@ -447,7 +431,7 @@ void MSAKlient::thread()
|
|
}
|
|
}
|
|
else
|
|
else
|
|
ok = 1;
|
|
ok = 1;
|
|
- if( ok && ms->hatClients() )
|
|
|
|
|
|
+ if( ok &&ms->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;
|
|
@@ -543,7 +527,7 @@ void MSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int maxC = 0;
|
|
int maxC = 0;
|
|
- klient->getNachricht( (char*)&maxC, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)& maxC, 4 );
|
|
if( ms->zDB()->adminHatRecht( adminId, Admin_Recht::MSMCChange ) )
|
|
if( ms->zDB()->adminHatRecht( adminId, Admin_Recht::MSMCChange ) )
|
|
{
|
|
{
|
|
if( ms->setMaxKlients( maxC ) )
|
|
if( ms->setMaxKlients( maxC ) )
|
|
@@ -565,8 +549,8 @@ void MSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachricht( (char*)&klientId, 4 );
|
|
|
|
- if( klientId && ms->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachricht( (char *)& klientId, 4 );
|
|
|
|
+ if( klientId &&ms->absturzKlient( klientId ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sende( "\0", 1 );
|
|
klient->sende( "\0", 1 );
|
|
@@ -598,16 +582,15 @@ void MSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehl
|
|
|
|
|
|
// Inhalt der LSKlient aus LoginServer.h
|
|
// Inhalt der LSKlient aus LoginServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-MSKlient::MSKlient( SKlient *klient, MinigameServer *ls )
|
|
|
|
|
|
+MSKlient::MSKlient( SKlient * klient, MinigameServer * ls )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
unsigned char key[ 20 ] = { 88, 103, 192, 232, 69, 54, 57, 3, 239, 138, 234, 172, 126, 72, 81, 55, 205, 97, 59, 255 };
|
|
unsigned char key[ 20 ] = { 88, 103, 192, 232, 69, 54, 57, 3, 239, 138, 234, 172, 126, 72, 81, 55, 205, 97, 59, 255 };
|
|
- 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->ms = ls;
|
|
this->ms = ls;
|
|
- ref = 1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
@@ -638,7 +621,7 @@ void MSKlient::thread()
|
|
switch( c )
|
|
switch( c )
|
|
{
|
|
{
|
|
case 1: // Klient identifikation
|
|
case 1: // Klient identifikation
|
|
- klient->getNachrichtEncrypted( (char*)&klientNummer, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& klientNummer, 4 );
|
|
if( !ms->zDB()->proveKlient( klientNummer, ms->getId() ) )
|
|
if( !ms->zDB()->proveKlient( klientNummer, ms->getId() ) )
|
|
{
|
|
{
|
|
klientNummer = 0;
|
|
klientNummer = 0;
|
|
@@ -669,8 +652,8 @@ void MSKlient::thread()
|
|
if( 1 )
|
|
if( 1 )
|
|
{
|
|
{
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&klientId, 4 );
|
|
|
|
- if( klientId && ms->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& klientId, 4 );
|
|
|
|
+ if( klientId &&ms->absturzKlient( klientId ) )
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
@@ -707,18 +690,18 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char l = 0;
|
|
unsigned char l = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *mName = new char[ l ];
|
|
char *mName = new char[ l ];
|
|
mName[ (int)l ] = 0;
|
|
mName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
RCArray< Text > oList;
|
|
RCArray< Text > oList;
|
|
int anz = ms->zDB()->getMinigameOptionList( mName, &oList );
|
|
int anz = ms->zDB()->getMinigameOptionList( mName, &oList );
|
|
delete[] mName;
|
|
delete[] mName;
|
|
- klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& anz, 4 );
|
|
for( auto t = oList.getIterator(); t && t._; t++ )
|
|
for( auto t = oList.getIterator(); t && t._; t++ )
|
|
{
|
|
{
|
|
l = (char)t->getLength();
|
|
l = (char)t->getLength();
|
|
- klient->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& l, 1 );
|
|
klient->sendeEncrypted( t->getText(), l );
|
|
klient->sendeEncrypted( t->getText(), l );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -727,7 +710,7 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char l = 0;
|
|
unsigned char l = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *mName = new char[ l ];
|
|
char *mName = new char[ l ];
|
|
mName[ (int)l ] = 0;
|
|
mName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
@@ -736,16 +719,16 @@ void MSKlient::thread()
|
|
RCArray< Text > oList;
|
|
RCArray< Text > oList;
|
|
int anz = ms->zDB()->getMinigameBestscore( mName, &sList, &pList, &oList );
|
|
int anz = ms->zDB()->getMinigameBestscore( mName, &sList, &pList, &oList );
|
|
delete[] mName;
|
|
delete[] mName;
|
|
- klient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
int s = sList.get( i );
|
|
int s = sList.get( i );
|
|
- klient->sendeEncrypted( (char*)&s, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& s, 4 );
|
|
l = (char)pList.z( i )->getLength();
|
|
l = (char)pList.z( i )->getLength();
|
|
- klient->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& l, 1 );
|
|
klient->sendeEncrypted( pList.z( i )->getText(), l );
|
|
klient->sendeEncrypted( pList.z( i )->getText(), l );
|
|
l = (char)oList.z( i )->getLength();
|
|
l = (char)oList.z( i )->getLength();
|
|
- klient->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& l, 1 );
|
|
klient->sendeEncrypted( oList.z( i )->getText(), l );
|
|
klient->sendeEncrypted( oList.z( i )->getText(), l );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -754,11 +737,11 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char l = 0;
|
|
unsigned char l = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *mName = new char[ l ];
|
|
char *mName = new char[ l ];
|
|
mName[ (int)l ] = 0;
|
|
mName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *oName = new char[ l ];
|
|
char *oName = new char[ l ];
|
|
oName[ (int)l ] = 0;
|
|
oName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
@@ -766,11 +749,11 @@ void MSKlient::thread()
|
|
int score = ms->zDB()->getMinigameBestscore( oName, mName, &player );
|
|
int score = ms->zDB()->getMinigameBestscore( oName, mName, &player );
|
|
delete[] mName;
|
|
delete[] mName;
|
|
delete[] oName;
|
|
delete[] oName;
|
|
- klient->sendeEncrypted( (char*)&score, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& score, 4 );
|
|
if( score )
|
|
if( score )
|
|
{
|
|
{
|
|
l = (char)player.getLength();
|
|
l = (char)player.getLength();
|
|
- klient->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& l, 1 );
|
|
klient->sendeEncrypted( player.getText(), l );
|
|
klient->sendeEncrypted( player.getText(), l );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -784,16 +767,16 @@ void MSKlient::thread()
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char l = 0;
|
|
unsigned char l = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *mName = new char[ l ];
|
|
char *mName = new char[ l ];
|
|
mName[ (int)l ] = 0;
|
|
mName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *oName = new char[ l ];
|
|
char *oName = new char[ l ];
|
|
oName[ (int)l ] = 0;
|
|
oName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
int score;
|
|
int score;
|
|
- klient->getNachrichtEncrypted( (char*)&score, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& score, 4 );
|
|
Text fName;
|
|
Text fName;
|
|
if( ms->zDB()->updateMinigameScore( score, oName, klientNummer, mName, ms->getId(), &fName ) )
|
|
if( ms->zDB()->updateMinigameScore( score, oName, klientNummer, mName, ms->getId(), &fName ) )
|
|
{
|
|
{
|
|
@@ -801,7 +784,7 @@ void MSKlient::thread()
|
|
Text path = ms->zInit()->zWert( "MGC_Pfad" )->getText();
|
|
Text path = ms->zInit()->zWert( "MGC_Pfad" )->getText();
|
|
if( path.getText()[ path.getLength() - 1 ] != '/' )
|
|
if( path.getText()[ path.getLength() - 1 ] != '/' )
|
|
path += "/";
|
|
path += "/";
|
|
- path += (char*)fName;
|
|
|
|
|
|
+ path += (char *)fName;
|
|
Datei d;
|
|
Datei d;
|
|
d.setDatei( path );
|
|
d.setDatei( path );
|
|
d.erstellen();
|
|
d.erstellen();
|
|
@@ -809,7 +792,7 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int size;
|
|
int size;
|
|
- klient->getNachrichtEncrypted( (char*)&size, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& size, 4 );
|
|
char *buffer = new char[ 2048 ];
|
|
char *buffer = new char[ 2048 ];
|
|
while( size > 0 )
|
|
while( size > 0 )
|
|
{
|
|
{
|
|
@@ -835,11 +818,11 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
unsigned char l = 0;
|
|
unsigned char l = 0;
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *mName = new char[ l ];
|
|
char *mName = new char[ l ];
|
|
mName[ (int)l ] = 0;
|
|
mName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
klient->getNachrichtEncrypted( mName, l );
|
|
- klient->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *oName = new char[ l ];
|
|
char *oName = new char[ l ];
|
|
oName[ (int)l ] = 0;
|
|
oName[ (int)l ] = 0;
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
klient->getNachrichtEncrypted( oName, l );
|
|
@@ -859,7 +842,7 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int size = (int)d.getSize();
|
|
int size = (int)d.getSize();
|
|
- klient->sendeEncrypted( (char*)&size, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& size, 4 );
|
|
char *buffer = new char[ 2048 ];
|
|
char *buffer = new char[ 2048 ];
|
|
while( size > 0 )
|
|
while( size > 0 )
|
|
{
|
|
{
|
|
@@ -882,9 +865,9 @@ void MSKlient::thread()
|
|
{
|
|
{
|
|
Klient *k = new Klient();
|
|
Klient *k = new Klient();
|
|
unsigned char key[ 20 ] = { 88, 103, 192, 232, 69, 54, 57, 3, 239, 138, 234, 172, 126, 72, 81, 55, 205, 97, 59, 255 };
|
|
unsigned char key[ 20 ] = { 88, 103, 192, 232, 69, 54, 57, 3, 239, 138, 234, 172, 126, 72, 81, 55, 205, 97, 59, 255 };
|
|
- k->setSendeKey( (char*)key, 20 );
|
|
|
|
- k->setEmpfangKey( (char*)key, 20 );
|
|
|
|
- if( k->verbinde( (unsigned short)(int)port, (char*)ip ) )
|
|
|
|
|
|
+ k->setSendeKey( (char *)key, 20 );
|
|
|
|
+ k->setEmpfangKey( (char *)key, 20 );
|
|
|
|
+ if( k->verbinde( (unsigned short)(int)port, (char *)ip ) )
|
|
{
|
|
{
|
|
k->sendeEncrypted( "\xA", 1 );
|
|
k->sendeEncrypted( "\xA", 1 );
|
|
char ret;
|
|
char ret;
|
|
@@ -892,18 +875,18 @@ void MSKlient::thread()
|
|
if( ret == 1 )
|
|
if( ret == 1 )
|
|
{
|
|
{
|
|
l = (char)textLength( mName );
|
|
l = (char)textLength( mName );
|
|
- k->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ k->sendeEncrypted( (char *)& l, 1 );
|
|
k->sendeEncrypted( mName, l );
|
|
k->sendeEncrypted( mName, l );
|
|
l = (char)textLength( oName );
|
|
l = (char)textLength( oName );
|
|
- k->sendeEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ k->sendeEncrypted( (char *)& l, 1 );
|
|
k->sendeEncrypted( oName, l );
|
|
k->sendeEncrypted( oName, l );
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
if( ret == 1 )
|
|
if( ret == 1 )
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int size;
|
|
int size;
|
|
- k->getNachrichtEncrypted( (char*)&size, 4 );
|
|
|
|
- klient->sendeEncrypted( (char*)&size, 4 );
|
|
|
|
|
|
+ k->getNachrichtEncrypted( (char *)& size, 4 );
|
|
|
|
+ klient->sendeEncrypted( (char *)& size, 4 );
|
|
char *buffer = new char[ 2048 ];
|
|
char *buffer = new char[ 2048 ];
|
|
while( size > 0 )
|
|
while( size > 0 )
|
|
{
|
|
{
|
|
@@ -917,7 +900,7 @@ void MSKlient::thread()
|
|
}
|
|
}
|
|
if( ret == 3 )
|
|
if( ret == 3 )
|
|
{
|
|
{
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
|
|
+ k->getNachrichtEncrypted( (char *)& l, 1 );
|
|
char *error = new char[ l + 1 ];
|
|
char *error = new char[ l + 1 ];
|
|
error[ (int)l ] = 0;
|
|
error[ (int)l ] = 0;
|
|
k->getNachrichtEncrypted( error, l );
|
|
k->getNachrichtEncrypted( error, l );
|
|
@@ -952,7 +935,7 @@ void MSKlient::thread()
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int acc = ms->zDB()->getAccountId( klientNummer );
|
|
int acc = ms->zDB()->getAccountId( klientNummer );
|
|
- klient->sendeEncrypted( (char*)&acc, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)& acc, 4 );
|
|
}
|
|
}
|
|
case 0xC:
|
|
case 0xC:
|
|
{
|
|
{
|
|
@@ -963,7 +946,7 @@ void MSKlient::thread()
|
|
}
|
|
}
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
int acc;
|
|
int acc;
|
|
- klient->getNachrichtEncrypted( (char*)&acc, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)& acc, 4 );
|
|
Text *name = ms->zDB()->getAccountName( acc );
|
|
Text *name = ms->zDB()->getAccountName( acc );
|
|
if( !name )
|
|
if( !name )
|
|
errorZuKlient( "Der Acount existiert nicht." );
|
|
errorZuKlient( "Der Acount existiert nicht." );
|
|
@@ -1022,19 +1005,4 @@ void MSKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehle
|
|
int MSKlient::getKlientNummer() const // gibt die KlientId zurück
|
|
int MSKlient::getKlientNummer() const // gibt die KlientId zurück
|
|
{
|
|
{
|
|
return klientNummer;
|
|
return klientNummer;
|
|
-}
|
|
|
|
-
|
|
|
|
-// Reference Counting
|
|
|
|
-MSKlient *MSKlient::getThis()
|
|
|
|
-{
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-MSKlient *MSKlient::release()
|
|
|
|
-{
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|