|
@@ -379,6 +379,66 @@ void MSAKlient::thread()
|
|
klient->sende( &status, 1 );
|
|
klient->sende( &status, 1 );
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+ case 9: // Patch Server Liste
|
|
|
|
+ if( adminId )
|
|
|
|
+ {
|
|
|
|
+ Array< ServerData* > d;
|
|
|
|
+ if( ms->zDB()->getPatchServerList( &d ) )
|
|
|
|
+ klient->sende( "\1", 1 );
|
|
|
|
+ else
|
|
|
|
+ errorZuKlient( "Fehler beim Abruf der Patch Server Tabelle." );
|
|
|
|
+ int anz = d.getEintragAnzahl();
|
|
|
|
+ klient->sende( (char*)&anz, 4 );
|
|
|
|
+ for( int i = 0; i < anz; i++ )
|
|
|
|
+ {
|
|
|
|
+ ServerData *s = d.get( i );
|
|
|
|
+ klient->sende( (char*)&s->id, 4 );
|
|
|
|
+ klient->sende( (char*)&s->port, 2 );
|
|
|
|
+ klient->sende( (char*)&s->adminPort, 2 );
|
|
|
|
+ unsigned char len = (unsigned char)s->name.getLength();
|
|
|
|
+ klient->sende( (char*)&len, 1 );
|
|
|
|
+ klient->sende( s->name, len );
|
|
|
|
+ len = (unsigned char)s->ip.getLength();
|
|
|
|
+ klient->sende( (char*)&len, 1 );
|
|
|
|
+ klient->sende( s->ip, len );
|
|
|
|
+ len = (unsigned char)s->status.getLength();
|
|
|
|
+ klient->sende( (char*)&len, 1 );
|
|
|
|
+ klient->sende( s->status, len );
|
|
|
|
+ delete s;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ errorZuKlient( "Du musst dich einloggen." );
|
|
|
|
+ break;
|
|
|
|
+ case 10: // get Patch Server Details
|
|
|
|
+ {
|
|
|
|
+ if( adminId )
|
|
|
|
+ {
|
|
|
|
+ klient->sende( "\1", 1 );
|
|
|
|
+ int id = 0;
|
|
|
|
+ klient->getNachricht( (char*)&id, 4 );
|
|
|
|
+ ServerDetails d;
|
|
|
|
+ if( ms->zDB()->getPatchServerDetails( id, &d ) )
|
|
|
|
+ {
|
|
|
|
+ klient->sende( "\1", 1 );
|
|
|
|
+ unsigned char len = (unsigned char)d.name.getLength();
|
|
|
|
+ klient->sende( (char*)&len, 1 );
|
|
|
|
+ klient->sende( d.name, len );
|
|
|
|
+ len = (unsigned char)d.ip.getLength();
|
|
|
|
+ klient->sende( (char*)&len, 1 );
|
|
|
|
+ klient->sende( d.ip, len );
|
|
|
|
+ klient->sende( (char*)&d.port, 2 );
|
|
|
|
+ klient->sende( (char*)&d.adminPort, 2 );
|
|
|
|
+ klient->sende( (char*)&d.tasks, 4 );
|
|
|
|
+ klient->sende( (char*)&d.maxTasks, 4 );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ errorZuKlient( "Fehler beim abrufen der Server Details." );
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ errorZuKlient( "Du musst dich einloggen." );
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
default:
|
|
default:
|
|
errorZuKlient( "Unbekannte Nachricht!" );
|
|
errorZuKlient( "Unbekannte Nachricht!" );
|
|
break;
|
|
break;
|