|
@@ -16,7 +16,7 @@ PatchServer::PatchServer( InitDatei *zIni )
|
|
empfangen = 0;
|
|
empfangen = 0;
|
|
gesendet = 0;
|
|
gesendet = 0;
|
|
fehler = new Text();
|
|
fehler = new Text();
|
|
- ini = zIni->getThis();
|
|
|
|
|
|
+ ini = dynamic_cast<InitDatei *>( zIni->getThis() );
|
|
id = *zIni->zWert( "ServerId" );
|
|
id = *zIni->zWert( "ServerId" );
|
|
Text *dgInitPfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
Text *dgInitPfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
dgInitPfad->append( "/datei_gruppe.ini" );
|
|
dgInitPfad->append( "/datei_gruppe.ini" );
|
|
@@ -75,13 +75,13 @@ void PatchServer::runn()
|
|
if( end && klient )
|
|
if( end && klient )
|
|
{
|
|
{
|
|
klient->trenne();
|
|
klient->trenne();
|
|
- klient = klient->release();
|
|
|
|
|
|
+ klient = (SSLSKlient *)klient->release();
|
|
Sleep( 1000 );
|
|
Sleep( 1000 );
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
- PSAKlient * clHandle = new PSAKlient( klient, (PatchServer *)getThis(), ini->getThis() );
|
|
|
|
|
|
+ PSAKlient *clHandle = new PSAKlient( klient, dynamic_cast<PatchServer *>( getThis() ), dynamic_cast<InitDatei *>( ini->getThis() ) );
|
|
clHandle->start();
|
|
clHandle->start();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -95,7 +95,7 @@ void PatchServer::thread()
|
|
if( !klient )
|
|
if( !klient )
|
|
continue;
|
|
continue;
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
Framework::getThreadRegister()->cleanUpClosedThreads();
|
|
- PSKlient * clHandle = new PSKlient( klient, (PatchServer *)getThis(), ini->getThis() );
|
|
|
|
|
|
+ PSKlient *clHandle = new PSKlient( klient, dynamic_cast<PatchServer *>( getThis() ), dynamic_cast<InitDatei *>( ini->getThis() ) );
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klients->set( clHandle, klientAnzahl );
|
|
klientAnzahl++;
|
|
klientAnzahl++;
|
|
@@ -114,13 +114,13 @@ void PatchServer::close()
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
for( int i = 0; i < klientAnzahl; i++ )
|
|
for( int i = 0; i < klientAnzahl; i++ )
|
|
klients->z( i )->absturz();
|
|
klients->z( i )->absturz();
|
|
- klients = klients->release();
|
|
|
|
|
|
+ klients = ( RCArray<PSKlient>* ) klients->release();
|
|
klientAnzahl = 0;
|
|
klientAnzahl = 0;
|
|
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();
|
|
@@ -233,7 +233,7 @@ bool PatchServer::absturzKlient( int klientId )
|
|
return gefunden;
|
|
return gefunden;
|
|
}
|
|
}
|
|
|
|
|
|
-bool PatchServer::removeKlient( PSKlient * zKlient )
|
|
|
|
|
|
+bool PatchServer::removeKlient( PSKlient *zKlient )
|
|
{
|
|
{
|
|
bool gefunden = 0;
|
|
bool gefunden = 0;
|
|
EnterCriticalSection( &cs );
|
|
EnterCriticalSection( &cs );
|
|
@@ -280,7 +280,7 @@ bool PatchServer::beginnUpdate( int gruppe )
|
|
}
|
|
}
|
|
if( !db->setDateiGruppe( id, gruppe, true ) )
|
|
if( !db->setDateiGruppe( id, gruppe, true ) )
|
|
return 0;
|
|
return 0;
|
|
- Text * gruppeN = db->getDateiGruppeName( gruppe );
|
|
|
|
|
|
+ Text *gruppeN = db->getDateiGruppeName( gruppe );
|
|
if( !gruppeN )
|
|
if( !gruppeN )
|
|
return 0;
|
|
return 0;
|
|
Result systemT = db->getSystemListe();
|
|
Result systemT = db->getSystemListe();
|
|
@@ -292,7 +292,7 @@ bool PatchServer::beginnUpdate( int gruppe )
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( "/version.ini" );
|
|
pfad->append( "/version.ini" );
|
|
- InitDatei * vIni = new InitDatei( pfad->getText() );
|
|
|
|
|
|
+ InitDatei *vIni = new InitDatei( pfad->getText() );
|
|
vIni->laden();
|
|
vIni->laden();
|
|
pfad->remove( pfad->getLength() - 11, pfad->getLength() );
|
|
pfad->remove( pfad->getLength() - 11, pfad->getLength() );
|
|
Result dateiT = db->getDeletedFiles( TextZuInt( systemT.values[ i * 2 ].getText(), 10 ), gruppe );
|
|
Result dateiT = db->getDeletedFiles( TextZuInt( systemT.values[ i * 2 ].getText(), 10 ), gruppe );
|
|
@@ -402,13 +402,13 @@ bool PatchServer::proveVersion( int gruppe ) const
|
|
Text *gruppeN = db->getDateiGruppeName( gruppe );
|
|
Text *gruppeN = db->getDateiGruppeName( gruppe );
|
|
if( !gruppeN )
|
|
if( !gruppeN )
|
|
continue;
|
|
continue;
|
|
- Text * pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
|
|
|
|
+ Text *pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( gruppeN );
|
|
pfad->append( gruppeN );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( "/version.ini" );
|
|
pfad->append( "/version.ini" );
|
|
- InitDatei * vIni = new InitDatei( pfad );
|
|
|
|
|
|
+ InitDatei *vIni = new InitDatei( pfad );
|
|
vIni->laden();
|
|
vIni->laden();
|
|
int dAnz = vIni->getWertAnzahl();
|
|
int dAnz = vIni->getWertAnzahl();
|
|
if( dAnz != dateiT.zeilenAnzahl ) // nicht aktuell
|
|
if( dAnz != dateiT.zeilenAnzahl ) // nicht aktuell
|
|
@@ -468,13 +468,13 @@ bool PatchServer::proveVersion() const
|
|
Text *gruppeN = db->getDateiGruppeName( gruppe );
|
|
Text *gruppeN = db->getDateiGruppeName( gruppe );
|
|
if( !gruppeN )
|
|
if( !gruppeN )
|
|
continue;
|
|
continue;
|
|
- Text * pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
|
|
|
|
+ Text *pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( gruppeN );
|
|
pfad->append( gruppeN );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( "/version.ini" );
|
|
pfad->append( "/version.ini" );
|
|
- InitDatei * vIni = new InitDatei( pfad );
|
|
|
|
|
|
+ InitDatei *vIni = new InitDatei( pfad );
|
|
vIni->laden();
|
|
vIni->laden();
|
|
int dAnz = vIni->getWertAnzahl();
|
|
int dAnz = vIni->getWertAnzahl();
|
|
if( dAnz != dateiT.zeilenAnzahl ) // nicht aktuell
|
|
if( dAnz != dateiT.zeilenAnzahl ) // nicht aktuell
|
|
@@ -540,7 +540,7 @@ bool PatchServer::proveVersion() const
|
|
|
|
|
|
// Inhalt der PSAKlient Klasse aus PatchServer.h
|
|
// Inhalt der PSAKlient Klasse aus PatchServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-PSAKlient::PSAKlient( SSLSKlient * klient, PatchServer * ps, InitDatei * ini )
|
|
|
|
|
|
+PSAKlient::PSAKlient( SSLSKlient *klient, PatchServer *ps, InitDatei *ini )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
@@ -584,13 +584,13 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- klient->getNachricht( (char *)& len, 1 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 1 );
|
|
char *n = new char[ len + 1 ];
|
|
char *n = new char[ len + 1 ];
|
|
n[ (int)len ] = 0;
|
|
n[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
klient->getNachricht( n, len );
|
|
klient->getNachricht( n, len );
|
|
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 )
|
|
@@ -686,7 +686,7 @@ void PSAKlient::thread()
|
|
}
|
|
}
|
|
else
|
|
else
|
|
ok = 1;
|
|
ok = 1;
|
|
- if( ok &&ps->hatClients() )
|
|
|
|
|
|
+ if( ok && ps->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;
|
|
@@ -784,7 +784,7 @@ void PSAKlient::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( ps->zDB()->adminHatRecht( adminId, Admin_Recht::PSMCChange ) )
|
|
if( ps->zDB()->adminHatRecht( adminId, Admin_Recht::PSMCChange ) )
|
|
{
|
|
{
|
|
if( ps->setMaxKlients( maxC ) )
|
|
if( ps->setMaxKlients( maxC ) )
|
|
@@ -814,16 +814,16 @@ void PSAKlient::thread()
|
|
for( int i = 0; i < systemT.zeilenAnzahl; i++ )
|
|
for( int i = 0; i < systemT.zeilenAnzahl; i++ )
|
|
{
|
|
{
|
|
int len = systemT.values[ i * 2 + 1 ].getLength();
|
|
int len = systemT.values[ i * 2 + 1 ].getLength();
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( systemT.values[ i * 2 + 1 ].getText(), len );
|
|
klient->sende( systemT.values[ i * 2 + 1 ].getText(), len );
|
|
Result dateiT = ps->zDB()->getDateiListeOhneOrdner( TextZuInt( systemT.values[ i * 2 ].getText(), 10 ), updateGruppe );
|
|
Result dateiT = ps->zDB()->getDateiListeOhneOrdner( TextZuInt( systemT.values[ i * 2 ].getText(), 10 ), updateGruppe );
|
|
- Text * pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
|
|
|
|
+ Text *pfad = new Text( ini->zWert( "SystemPfad" )->getText() );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( gruppeN->getText() );
|
|
pfad->append( gruppeN->getText() );
|
|
pfad->append( "/" );
|
|
pfad->append( "/" );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( systemT.values[ i * 2 + 1 ].getText() );
|
|
pfad->append( "/version.ini" );
|
|
pfad->append( "/version.ini" );
|
|
- InitDatei * vIni = new InitDatei( pfad );
|
|
|
|
|
|
+ InitDatei *vIni = new InitDatei( pfad );
|
|
vIni->laden();
|
|
vIni->laden();
|
|
for( int j = 0; j < dateiT.zeilenAnzahl; j++ )
|
|
for( int j = 0; j < dateiT.zeilenAnzahl; j++ )
|
|
{
|
|
{
|
|
@@ -835,7 +835,7 @@ void PSAKlient::thread()
|
|
if( veraltet )
|
|
if( veraltet )
|
|
{
|
|
{
|
|
int len = dateiT.values[ j * 2 ].getLength();
|
|
int len = dateiT.values[ j * 2 ].getLength();
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( dateiT.values[ j * 2 ].getText(), len );
|
|
klient->sende( dateiT.values[ j * 2 ].getText(), len );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -862,7 +862,7 @@ void PSAKlient::thread()
|
|
ps->endUpdate( updateGruppe );
|
|
ps->endUpdate( updateGruppe );
|
|
updateGruppe = 0;
|
|
updateGruppe = 0;
|
|
if( gruppeN )
|
|
if( gruppeN )
|
|
- gruppeN = gruppeN->release();
|
|
|
|
|
|
+ gruppeN = (Text *)gruppeN->release();
|
|
std::cout << "PS: Update erfolgreich abgeschlossen.\n";
|
|
std::cout << "PS: Update erfolgreich abgeschlossen.\n";
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
}
|
|
}
|
|
@@ -879,7 +879,7 @@ void PSAKlient::thread()
|
|
}
|
|
}
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int dg = 0;
|
|
int dg = 0;
|
|
- klient->getNachricht( (char *)& dg, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&dg, 4 );
|
|
gruppeN = ps->zDB()->getDateiGruppeName( dg );
|
|
gruppeN = ps->zDB()->getDateiGruppeName( dg );
|
|
if( !gruppeN )
|
|
if( !gruppeN )
|
|
{
|
|
{
|
|
@@ -919,12 +919,12 @@ void PSAKlient::thread()
|
|
}
|
|
}
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int system = 0;
|
|
int system = 0;
|
|
- klient->getNachricht( (char *)& system, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&system, 4 );
|
|
int version = 0;
|
|
int version = 0;
|
|
- klient->getNachricht( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&version, 4 );
|
|
Text *sName = ps->zDB()->getSystemName( system );
|
|
Text *sName = ps->zDB()->getSystemName( system );
|
|
unsigned short len = 0;
|
|
unsigned short len = 0;
|
|
- klient->getNachricht( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 2 );
|
|
char *pfad = new char[ len + 1 ];
|
|
char *pfad = new char[ len + 1 ];
|
|
pfad[ len ] = 0;
|
|
pfad[ len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -954,14 +954,14 @@ void PSAKlient::thread()
|
|
if( d->open( Datei::Style::schreiben ) )
|
|
if( d->open( Datei::Style::schreiben ) )
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
- klient->getNachricht( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 2 );
|
|
while( len )
|
|
while( len )
|
|
{
|
|
{
|
|
char *buff = new char[ len ];
|
|
char *buff = new char[ len ];
|
|
klient->getNachricht( buff, len );
|
|
klient->getNachricht( buff, len );
|
|
d->schreibe( buff, len );
|
|
d->schreibe( buff, len );
|
|
delete[] buff;
|
|
delete[] buff;
|
|
- klient->getNachricht( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 2 );
|
|
ps->addEmpfangen( klient->getDownloadBytes( 1 ) );
|
|
ps->addEmpfangen( klient->getDownloadBytes( 1 ) );
|
|
ps->addGesendet( klient->getUploadBytes( 1 ) );
|
|
ps->addGesendet( klient->getUploadBytes( 1 ) );
|
|
}
|
|
}
|
|
@@ -990,8 +990,8 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
- klient->getNachricht( (char *)& klientId, 4 );
|
|
|
|
- if( klientId &&ps->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachricht( (char *)&klientId, 4 );
|
|
|
|
+ if( klientId && ps->absturzKlient( klientId ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sende( "\0", 1 );
|
|
klient->sende( "\0", 1 );
|
|
@@ -1011,21 +1011,21 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int anz = list.getEintragAnzahl();
|
|
int anz = list.getEintragAnzahl();
|
|
- klient->sende( (char *)& anz, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
FileGroupInfo *info = list.get( i );
|
|
FileGroupInfo *info = list.get( i );
|
|
- klient->sende( (char *)& info->id, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&info->id, 4 );
|
|
unsigned char len = (unsigned char)info->name.getLength();
|
|
unsigned char len = (unsigned char)info->name.getLength();
|
|
- klient->sende( (char *)& len, 1 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 1 );
|
|
klient->sende( info->name, len );
|
|
klient->sende( info->name, len );
|
|
len = (unsigned char)info->status.getLength();
|
|
len = (unsigned char)info->status.getLength();
|
|
- klient->sende( (char *)& len, 1 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 1 );
|
|
klient->sende( info->status, len );
|
|
klient->sende( info->status, len );
|
|
unsigned short l = (unsigned short)info->pfad.getLength();
|
|
unsigned short l = (unsigned short)info->pfad.getLength();
|
|
- klient->sende( (char *)& l, 2 );
|
|
|
|
|
|
+ klient->sende( (char *)&l, 2 );
|
|
klient->sende( info->pfad, l );
|
|
klient->sende( info->pfad, l );
|
|
- klient->sende( (char *)& info->version, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&info->version, 4 );
|
|
delete info;
|
|
delete info;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1045,13 +1045,13 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
Result res = ps->zDB()->getSystemListe();
|
|
Result res = ps->zDB()->getSystemListe();
|
|
- klient->sende( (char *)& res.zeilenAnzahl, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&res.zeilenAnzahl, 4 );
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
{
|
|
{
|
|
int id = res.values[ i * 2 ];
|
|
int id = res.values[ i * 2 ];
|
|
- klient->sende( (char *)& id, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&id, 4 );
|
|
unsigned char len = (unsigned char)res.values[ i * 2 + 1 ].getLength();
|
|
unsigned char len = (unsigned char)res.values[ i * 2 + 1 ].getLength();
|
|
- klient->sende( (char *)& len, 1 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 1 );
|
|
klient->sende( res.values[ i * 2 + 1 ], len );
|
|
klient->sende( res.values[ i * 2 + 1 ], len );
|
|
}
|
|
}
|
|
res.destroy();
|
|
res.destroy();
|
|
@@ -1069,21 +1069,21 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int system, group;
|
|
int system, group;
|
|
- klient->getNachricht( (char *)& system, 4 );
|
|
|
|
- klient->getNachricht( (char *)& group, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&system, 4 );
|
|
|
|
+ klient->getNachricht( (char *)&group, 4 );
|
|
Result res = ps->zDB()->getDateiListeSMP( system, group );
|
|
Result res = ps->zDB()->getDateiListeSMP( system, group );
|
|
- klient->sende( (char *)& res.zeilenAnzahl, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&res.zeilenAnzahl, 4 );
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
{
|
|
{
|
|
int id = res.values[ i * 4 ];
|
|
int id = res.values[ i * 4 ];
|
|
- klient->sende( (char *)& id, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&id, 4 );
|
|
unsigned short len = (unsigned short)res.values[ i * 4 + 1 ].getLength();
|
|
unsigned short len = (unsigned short)res.values[ i * 4 + 1 ].getLength();
|
|
- klient->sende( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 2 );
|
|
klient->sende( res.values[ i * 4 + 1 ], len );
|
|
klient->sende( res.values[ i * 4 + 1 ], len );
|
|
int version = res.values[ i * 4 + 2 ];
|
|
int version = res.values[ i * 4 + 2 ];
|
|
- klient->sende( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&version, 4 );
|
|
unsigned char l = (unsigned char)res.values[ i * 4 + 3 ].getLength();
|
|
unsigned char l = (unsigned char)res.values[ i * 4 + 3 ].getLength();
|
|
- klient->sende( (char *)& l, 1 );
|
|
|
|
|
|
+ klient->sende( (char *)&l, 1 );
|
|
klient->sende( res.values[ i * 4 + 3 ], l );
|
|
klient->sende( res.values[ i * 4 + 3 ], l );
|
|
}
|
|
}
|
|
res.destroy();
|
|
res.destroy();
|
|
@@ -1102,15 +1102,15 @@ void PSAKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int group, system;
|
|
int group, system;
|
|
unsigned short len;
|
|
unsigned short len;
|
|
- klient->getNachricht( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 2 );
|
|
char *path = new char[ len + 1 ];
|
|
char *path = new char[ len + 1 ];
|
|
klient->getNachricht( path, len );
|
|
klient->getNachricht( path, len );
|
|
path[ len ] = 0;
|
|
path[ len ] = 0;
|
|
- klient->getNachricht( (char *)& group, 4 );
|
|
|
|
- klient->getNachricht( (char *)& system, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&group, 4 );
|
|
|
|
+ klient->getNachricht( (char *)&system, 4 );
|
|
int version = ps->zDB()->getDateiVersion( path, system, group );
|
|
int version = ps->zDB()->getDateiVersion( path, system, group );
|
|
delete[] path;
|
|
delete[] path;
|
|
- klient->sende( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&version, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -1125,14 +1125,14 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
unsigned short len;
|
|
unsigned short len;
|
|
- klient->getNachricht( (char *)& len, 2 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 2 );
|
|
char *path = new char[ len + 1 ];
|
|
char *path = new char[ len + 1 ];
|
|
klient->getNachricht( path, len );
|
|
klient->getNachricht( path, len );
|
|
path[ len ] = 0;
|
|
path[ len ] = 0;
|
|
char status = 0; // 0: delete, 1: update, 2: new
|
|
char status = 0; // 0: delete, 1: update, 2: new
|
|
klient->getNachricht( &status, 1 );
|
|
klient->getNachricht( &status, 1 );
|
|
unsigned char l;
|
|
unsigned char l;
|
|
- klient->getNachricht( (char *)& l, 1 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&l, 1 );
|
|
char *time = 0;
|
|
char *time = 0;
|
|
if( l > 0 )
|
|
if( l > 0 )
|
|
{
|
|
{
|
|
@@ -1141,8 +1141,8 @@ void PSAKlient::thread()
|
|
time[ l ] = 0;
|
|
time[ l ] = 0;
|
|
}
|
|
}
|
|
int system, gruppe;
|
|
int system, gruppe;
|
|
- klient->getNachricht( (char *)& system, 4 );
|
|
|
|
- klient->getNachricht( (char *)& gruppe, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&system, 4 );
|
|
|
|
+ klient->getNachricht( (char *)&gruppe, 4 );
|
|
if( ps->zDB()->updateDatei( path, status, time, system, gruppe ) )
|
|
if( ps->zDB()->updateDatei( path, status, time, system, gruppe ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
@@ -1161,7 +1161,7 @@ void PSAKlient::thread()
|
|
{
|
|
{
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int gruppe;
|
|
int gruppe;
|
|
- klient->getNachricht( (char *)& gruppe, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&gruppe, 4 );
|
|
if( ps->zDB()->dateiGruppeUpdate( gruppe ) )
|
|
if( ps->zDB()->dateiGruppeUpdate( gruppe ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
@@ -1197,7 +1197,7 @@ void PSAKlient::errorZuKlient( const char *nachricht ) const // sendet eine Fehl
|
|
|
|
|
|
// Inhalt der PSKlient aus PatchServer.h
|
|
// Inhalt der PSKlient aus PatchServer.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
-PSKlient::PSKlient( SKlient * klient, PatchServer * ps, InitDatei * ini )
|
|
|
|
|
|
+PSKlient::PSKlient( SKlient *klient, PatchServer *ps, InitDatei *ini )
|
|
: Thread()
|
|
: Thread()
|
|
{
|
|
{
|
|
this->klient = klient;
|
|
this->klient = klient;
|
|
@@ -1246,13 +1246,13 @@ void PSKlient::thread()
|
|
case 1: // Klient identifikation
|
|
case 1: // Klient identifikation
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
- klient->getNachrichtEncrypted( (char *)& klientNummer, 4 );
|
|
|
|
- klient->getNachrichtEncrypted( (char *)& system, 1 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&klientNummer, 4 );
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&system, 1 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- klient->getNachricht( (char *)& klientNummer, 4 );
|
|
|
|
- klient->getNachricht( (char *)& system, 1 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&klientNummer, 4 );
|
|
|
|
+ klient->getNachricht( (char *)&system, 1 );
|
|
}
|
|
}
|
|
if( !ps->zDB()->proveKlient( klientNummer, ps->getId() ) )
|
|
if( !ps->zDB()->proveKlient( klientNummer, ps->getId() ) )
|
|
{
|
|
{
|
|
@@ -1294,16 +1294,16 @@ void PSKlient::thread()
|
|
int klientId = 0;
|
|
int klientId = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
- klient->getNachrichtEncrypted( (char *)& klientId, 4 );
|
|
|
|
- if( klientId &&ps->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&klientId, 4 );
|
|
|
|
+ if( klientId && ps->absturzKlient( klientId ) )
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
klient->sendeEncrypted( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
klient->sendeEncrypted( "\0", 1 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- klient->getNachricht( (char *)& klientId, 4 );
|
|
|
|
- if( klientId &&ps->absturzKlient( klientId ) )
|
|
|
|
|
|
+ klient->getNachricht( (char *)&klientId, 4 );
|
|
|
|
+ if( klientId && ps->absturzKlient( klientId ) )
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
else
|
|
else
|
|
klient->sende( "\0", 1 );
|
|
klient->sende( "\0", 1 );
|
|
@@ -1419,18 +1419,18 @@ void PSKlient::thread()
|
|
}
|
|
}
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
unsigned char byte = 0;
|
|
unsigned char byte = 0;
|
|
- klient->getNachricht( (char *)& byte, 1 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&byte, 1 );
|
|
Text *pfad = new Text( "" );
|
|
Text *pfad = new Text( "" );
|
|
pfad->fillText( ' ', byte );
|
|
pfad->fillText( ' ', byte );
|
|
klient->getNachricht( pfad->getText(), byte );
|
|
klient->getNachricht( pfad->getText(), byte );
|
|
__int64 pos = 0;
|
|
__int64 pos = 0;
|
|
- klient->getNachricht( (char *)& pos, 8 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&pos, 8 );
|
|
if( system )
|
|
if( system )
|
|
pfad->insert( 0, "../versions/x64/live/" );
|
|
pfad->insert( 0, "../versions/x64/live/" );
|
|
else
|
|
else
|
|
pfad->insert( 0, "../versions/x32/live/" );
|
|
pfad->insert( 0, "../versions/x32/live/" );
|
|
pfad->ersetzen( "ü", "ue" );
|
|
pfad->ersetzen( "ü", "ue" );
|
|
- Datei * datei = new Datei();
|
|
|
|
|
|
+ Datei *datei = new Datei();
|
|
datei->setDatei( pfad );
|
|
datei->setDatei( pfad );
|
|
datei->open( Datei::Style::lesen );
|
|
datei->open( Datei::Style::lesen );
|
|
if( pos )
|
|
if( pos )
|
|
@@ -1449,14 +1449,14 @@ void PSKlient::thread()
|
|
byteLen = 2048;
|
|
byteLen = 2048;
|
|
if( length < 2048 )
|
|
if( length < 2048 )
|
|
byteLen = (unsigned short)length;
|
|
byteLen = (unsigned short)length;
|
|
- klient->sende( (char *)& byteLen, 2 );
|
|
|
|
|
|
+ klient->sende( (char *)&byteLen, 2 );
|
|
datei->lese( bytes, byteLen );
|
|
datei->lese( bytes, byteLen );
|
|
klient->sende( bytes, byteLen );
|
|
klient->sende( bytes, byteLen );
|
|
length -= byteLen;
|
|
length -= byteLen;
|
|
char ret = 0;
|
|
char ret = 0;
|
|
if( byteLen != 2048 )
|
|
if( byteLen != 2048 )
|
|
break;
|
|
break;
|
|
- klient->getNachricht( (char *)& ret, 1 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&ret, 1 );
|
|
ps->addEmpfangen( klient->getDownloadBytes( 1 ) );
|
|
ps->addEmpfangen( klient->getDownloadBytes( 1 ) );
|
|
ps->addGesendet( klient->getUploadBytes( 1 ) );
|
|
ps->addGesendet( klient->getUploadBytes( 1 ) );
|
|
if( ret == 1 )
|
|
if( ret == 1 )
|
|
@@ -1466,7 +1466,7 @@ void PSKlient::thread()
|
|
if( ret == 2 )
|
|
if( ret == 2 )
|
|
{
|
|
{
|
|
pos = 0;
|
|
pos = 0;
|
|
- klient->getNachricht( (char *)& pos, 8 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&pos, 8 );
|
|
if( pos > length )
|
|
if( pos > length )
|
|
pos = length;
|
|
pos = length;
|
|
datei->setLPosition( pos, 0 );
|
|
datei->setLPosition( pos, 0 );
|
|
@@ -1489,7 +1489,7 @@ void PSKlient::thread()
|
|
}
|
|
}
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int version = 30;
|
|
int version = 30;
|
|
- klient->sende( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&version, 4 );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 8: // Frage nach Dateigröße ****Altes Update System
|
|
case 8: // Frage nach Dateigröße ****Altes Update System
|
|
@@ -1511,11 +1511,11 @@ void PSKlient::thread()
|
|
else
|
|
else
|
|
pfad->insert( 0, "../versions/x32/live/" );
|
|
pfad->insert( 0, "../versions/x32/live/" );
|
|
pfad->ersetzen( "ü", "ue" );
|
|
pfad->ersetzen( "ü", "ue" );
|
|
- Datei * datei = new Datei();
|
|
|
|
|
|
+ Datei *datei = new Datei();
|
|
datei->setDatei( pfad );
|
|
datei->setDatei( pfad );
|
|
__int64 size = datei->getSize();
|
|
__int64 size = datei->getSize();
|
|
datei->release();
|
|
datei->release();
|
|
- klient->sende( (char *)& size, 8 );
|
|
|
|
|
|
+ klient->sende( (char *)&size, 8 );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 9: // Frage nach Dateiliste ****Neues Update System
|
|
case 9: // Frage nach Dateiliste ****Neues Update System
|
|
@@ -1532,9 +1532,9 @@ void PSKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int updateGruppe = 0;
|
|
int updateGruppe = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&updateGruppe, 4 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&updateGruppe, 4 );
|
|
Result dateien = ps->zDB()->getDateiListeOhneOrdner( system, updateGruppe );
|
|
Result dateien = ps->zDB()->getDateiListeOhneOrdner( system, updateGruppe );
|
|
if( !dateien.zeilenAnzahl )
|
|
if( !dateien.zeilenAnzahl )
|
|
{
|
|
{
|
|
@@ -1554,17 +1554,17 @@ void PSKlient::thread()
|
|
break;
|
|
break;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
- klient->sendeEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&len, 4 );
|
|
klient->sendeEncrypted( dateien.values[ i * 2 ].getText(), len );
|
|
klient->sendeEncrypted( dateien.values[ i * 2 ].getText(), len );
|
|
int version = TextZuInt( dateien.values[ i * 2 + 1 ].getText(), 10 );
|
|
int version = TextZuInt( dateien.values[ i * 2 + 1 ].getText(), 10 );
|
|
- klient->sendeEncrypted( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&version, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( dateien.values[ i * 2 ].getText(), len );
|
|
klient->sende( dateien.values[ i * 2 ].getText(), len );
|
|
int version = TextZuInt( dateien.values[ i * 2 + 1 ].getText(), 10 );
|
|
int version = TextZuInt( dateien.values[ i * 2 + 1 ].getText(), 10 );
|
|
- klient->sende( (char *)& version, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&version, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if( encrypted )
|
|
if( encrypted )
|
|
@@ -1578,12 +1578,12 @@ void PSKlient::thread()
|
|
break;
|
|
break;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
- klient->sendeEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&len, 4 );
|
|
klient->sendeEncrypted( deleted.values[ i ].getText(), len );
|
|
klient->sendeEncrypted( deleted.values[ i ].getText(), len );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( deleted.values[ i ].getText(), len );
|
|
klient->sende( deleted.values[ i ].getText(), len );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1609,9 +1609,9 @@ void PSKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int updateGruppe = 0;
|
|
int updateGruppe = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&updateGruppe, 4 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&updateGruppe, 4 );
|
|
if( !ps->zDB()->supportedDateiGruppe( ps->getId(), updateGruppe ) )
|
|
if( !ps->zDB()->supportedDateiGruppe( ps->getId(), updateGruppe ) )
|
|
{
|
|
{
|
|
int s = ps->zDB()->getDateiGruppePatchServer( klientNummer, updateGruppe );
|
|
int s = ps->zDB()->getDateiGruppePatchServer( klientNummer, updateGruppe );
|
|
@@ -1625,17 +1625,17 @@ void PSKlient::thread()
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)& port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&port, 4 );
|
|
int len = ip->getLength();
|
|
int len = ip->getLength();
|
|
- klient->sendeEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&len, 4 );
|
|
klient->sendeEncrypted( (char *)ip->getText(), len );
|
|
klient->sendeEncrypted( (char *)ip->getText(), len );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sende( "\2", 1 );
|
|
klient->sende( "\2", 1 );
|
|
- klient->sende( (char *)& port, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&port, 4 );
|
|
int len = ip->getLength();
|
|
int len = ip->getLength();
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( (char *)ip->getText(), len );
|
|
klient->sende( (char *)ip->getText(), len );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1667,9 +1667,9 @@ void PSKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int len = 0;
|
|
int len = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&len, 4 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 4 );
|
|
char *pf = new char[ len + 1 ];
|
|
char *pf = new char[ len + 1 ];
|
|
pf[ len ] = 0;
|
|
pf[ len ] = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
@@ -1678,14 +1678,14 @@ void PSKlient::thread()
|
|
klient->getNachricht( pf, len );
|
|
klient->getNachricht( pf, len );
|
|
pfad->append( pf );
|
|
pfad->append( pf );
|
|
delete[] pf;
|
|
delete[] pf;
|
|
- Datei * datei = new Datei();
|
|
|
|
|
|
+ Datei *datei = new Datei();
|
|
datei->setDatei( pfad );
|
|
datei->setDatei( pfad );
|
|
__int64 size = datei->getSize();
|
|
__int64 size = datei->getSize();
|
|
datei->release();
|
|
datei->release();
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->sendeEncrypted( (char *)& size, 8 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&size, 8 );
|
|
else
|
|
else
|
|
- klient->sende( (char *)& size, 8 );
|
|
|
|
|
|
+ klient->sende( (char *)&size, 8 );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 11: // Frage nach Datei ****Neues Update System
|
|
case 11: // Frage nach Datei ****Neues Update System
|
|
@@ -1702,9 +1702,9 @@ void PSKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int updateGruppe = 0;
|
|
int updateGruppe = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&updateGruppe, 4 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& updateGruppe, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&updateGruppe, 4 );
|
|
if( !ps->zDB()->supportedDateiGruppe( ps->getId(), updateGruppe ) )
|
|
if( !ps->zDB()->supportedDateiGruppe( ps->getId(), updateGruppe ) )
|
|
{
|
|
{
|
|
int s = ps->zDB()->getDateiGruppePatchServer( klientNummer, updateGruppe );
|
|
int s = ps->zDB()->getDateiGruppePatchServer( klientNummer, updateGruppe );
|
|
@@ -1718,17 +1718,17 @@ void PSKlient::thread()
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
klient->sendeEncrypted( "\2", 1 );
|
|
- klient->sendeEncrypted( (char *)& port, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&port, 4 );
|
|
int len = ip->getLength();
|
|
int len = ip->getLength();
|
|
- klient->sendeEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&len, 4 );
|
|
klient->sendeEncrypted( (char *)ip->getText(), len );
|
|
klient->sendeEncrypted( (char *)ip->getText(), len );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
klient->sende( "\2", 1 );
|
|
klient->sende( "\2", 1 );
|
|
- klient->sende( (char *)& port, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&port, 4 );
|
|
int len = ip->getLength();
|
|
int len = ip->getLength();
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
klient->sende( (char *)ip->getText(), len );
|
|
klient->sende( (char *)ip->getText(), len );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1760,9 +1760,9 @@ void PSKlient::thread()
|
|
klient->sende( "\1", 1 );
|
|
klient->sende( "\1", 1 );
|
|
int len = 0;
|
|
int len = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&len, 4 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->getNachricht( (char *)&len, 4 );
|
|
char *pf = new char[ len + 1 ];
|
|
char *pf = new char[ len + 1 ];
|
|
pf[ len ] = 0;
|
|
pf[ len ] = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
@@ -1773,10 +1773,10 @@ void PSKlient::thread()
|
|
delete[] pf;
|
|
delete[] pf;
|
|
__int64 pos = 0;
|
|
__int64 pos = 0;
|
|
if( encrypted )
|
|
if( encrypted )
|
|
- klient->getNachrichtEncrypted( (char *)& pos, 8 );
|
|
|
|
|
|
+ klient->getNachrichtEncrypted( (char *)&pos, 8 );
|
|
else
|
|
else
|
|
- klient->getNachricht( (char *)& pos, 8 );
|
|
|
|
- Datei * datei = new Datei();
|
|
|
|
|
|
+ klient->getNachricht( (char *)&pos, 8 );
|
|
|
|
+ Datei *datei = new Datei();
|
|
datei->setDatei( pfad );
|
|
datei->setDatei( pfad );
|
|
datei->open( Datei::Style::lesen );
|
|
datei->open( Datei::Style::lesen );
|
|
if( pos )
|
|
if( pos )
|
|
@@ -1834,24 +1834,24 @@ void PSKlient::thread()
|
|
if( encrypted )
|
|
if( encrypted )
|
|
{
|
|
{
|
|
int id = TextZuInt( dgl.values[ i * 3 ].getText(), 10 );
|
|
int id = TextZuInt( dgl.values[ i * 3 ].getText(), 10 );
|
|
- klient->sendeEncrypted( (char *)& id, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&id, 4 );
|
|
int len = dgl.values[ i * 3 + 1 ].getLength();
|
|
int len = dgl.values[ i * 3 + 1 ].getLength();
|
|
- klient->sendeEncrypted( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&len, 4 );
|
|
if( len )
|
|
if( len )
|
|
klient->sendeEncrypted( dgl.values[ i * 3 + 1 ].getText(), len );
|
|
klient->sendeEncrypted( dgl.values[ i * 3 + 1 ].getText(), len );
|
|
int vs = TextZuInt( dgl.values[ i * 3 + 2 ].getText(), 10 );
|
|
int vs = TextZuInt( dgl.values[ i * 3 + 2 ].getText(), 10 );
|
|
- klient->sendeEncrypted( (char *)& vs, 4 );
|
|
|
|
|
|
+ klient->sendeEncrypted( (char *)&vs, 4 );
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
int id = TextZuInt( dgl.values[ i * 3 ].getText(), 10 );
|
|
int id = TextZuInt( dgl.values[ i * 3 ].getText(), 10 );
|
|
- klient->sende( (char *)& id, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&id, 4 );
|
|
int len = dgl.values[ i * 3 + 1 ].getLength();
|
|
int len = dgl.values[ i * 3 + 1 ].getLength();
|
|
- klient->sende( (char *)& len, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&len, 4 );
|
|
if( len )
|
|
if( len )
|
|
klient->sende( dgl.values[ i * 3 + 1 ].getText(), len );
|
|
klient->sende( dgl.values[ i * 3 + 1 ].getText(), len );
|
|
int vs = TextZuInt( dgl.values[ i * 3 + 2 ].getText(), 10 );
|
|
int vs = TextZuInt( dgl.values[ i * 3 + 2 ].getText(), 10 );
|
|
- klient->sende( (char *)& vs, 4 );
|
|
|
|
|
|
+ klient->sende( (char *)&vs, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if( encrypted )
|
|
if( encrypted )
|