|
@@ -141,7 +141,7 @@ bool MSDatenbank::proveRegisteredClient( unsigned int num )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-int *MSDatenbank::unregisterClient( unsigned int num )
|
|
|
+int *MSDatenbank::unregisterClient( unsigned int num, int *len )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT unregister_client( " );
|
|
|
befehl->append( num );
|
|
@@ -156,6 +156,13 @@ int *MSDatenbank::unregisterClient( unsigned int num )
|
|
|
Result res = datenbank->getResult();
|
|
|
unlock();
|
|
|
befehl->release();
|
|
|
+ if( len )
|
|
|
+ *len = res.zeilenAnzahl;
|
|
|
+ if( !res.zeilenAnzahl )
|
|
|
+ {
|
|
|
+ res.destroy();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
int *ret = new int[ res.zeilenAnzahl ];
|
|
|
for( int i = 0; i < res.zeilenAnzahl; i++ )
|
|
|
ret[ i ] = TextZuInt( res.values[ i ].getText(), 10 );
|
|
@@ -183,40 +190,6 @@ int MSDatenbank::suchPatchServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getPatchServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchRegisterServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -237,40 +210,6 @@ int MSDatenbank::suchRegisterServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getRegisterServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchLoginServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -291,40 +230,6 @@ int MSDatenbank::suchLoginServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getLoginServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchInformationServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -345,40 +250,6 @@ int MSDatenbank::suchInformationServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getInformationServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchChatServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -399,40 +270,6 @@ int MSDatenbank::suchChatServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getChatServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchAnmeldungServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -453,40 +290,6 @@ int MSDatenbank::suchAnmeldungServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getAnmeldungServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchErhaltungServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -507,40 +310,6 @@ int MSDatenbank::suchErhaltungServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getErhaltungServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchShopServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -561,40 +330,6 @@ int MSDatenbank::suchShopServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getShopServerPortIp( int num )
|
|
|
-{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
int MSDatenbank::suchNewsServer( unsigned int client )
|
|
|
{
|
|
|
Text *befehl = new Text( "SELECT such_server( " );
|
|
@@ -615,38 +350,58 @@ int MSDatenbank::suchNewsServer( unsigned int client )
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-unsigned char *MSDatenbank::getNewsServerPortIp( int num )
|
|
|
+int MSDatenbank::suchMinigameServer( unsigned int client )
|
|
|
{
|
|
|
- Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
- befehl->append( num );
|
|
|
- lock();
|
|
|
- if( !datenbank->befehl( befehl->getText() ) )
|
|
|
- {
|
|
|
- unlock();
|
|
|
- befehl->release();
|
|
|
- return 0;
|
|
|
- }
|
|
|
- befehl->release();
|
|
|
- Result res = datenbank->getResult();
|
|
|
- unlock();
|
|
|
- unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
- Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
- Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
- Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
- Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
- res.destroy();
|
|
|
- unsigned char *ret = new unsigned char[ 6 ];
|
|
|
- ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
- ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
- ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
- ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
- ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
- ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
- ip1->release();
|
|
|
- ip2->release();
|
|
|
- ip3->release();
|
|
|
- ip4->release();
|
|
|
- return ret;
|
|
|
+ Text *befehl = new Text( "SELECT such_server( " );
|
|
|
+ befehl->append( client );
|
|
|
+ befehl->append( ", 'minigame' )" );
|
|
|
+ lock();
|
|
|
+ if( !datenbank->befehl( befehl->getText() ) )
|
|
|
+ {
|
|
|
+ unlock();
|
|
|
+ befehl->release();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ befehl->release();
|
|
|
+ Result res = datenbank->getResult();
|
|
|
+ unlock();
|
|
|
+ int ret = TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
+ res.destroy();
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+unsigned char *MSDatenbank::getServerPortIp( int sId )
|
|
|
+{
|
|
|
+ Text *befehl = new Text( "SELECT port, ip FROM server WHERE id = " );
|
|
|
+ befehl->append( sId );
|
|
|
+ lock();
|
|
|
+ if( !datenbank->befehl( befehl->getText() ) )
|
|
|
+ {
|
|
|
+ unlock();
|
|
|
+ befehl->release();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ befehl->release();
|
|
|
+ Result res = datenbank->getResult();
|
|
|
+ unlock();
|
|
|
+ unsigned short port = (unsigned short)TextZuInt( res.values[ 0 ].getText(), 10 );
|
|
|
+ Text *ip1 = res.values[ 1 ].getTeilText( 0, res.values[ 1 ].positionVon( '.', 0 ) );
|
|
|
+ Text *ip2 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 0 ) + 1, res.values[ 1 ].positionVon( '.', 1 ) );
|
|
|
+ Text *ip3 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 1 ) + 1, res.values[ 1 ].positionVon( '.', 2 ) );
|
|
|
+ Text *ip4 = res.values[ 1 ].getTeilText( res.values[ 1 ].positionVon( '.', 2 ) + 1 );
|
|
|
+ res.destroy();
|
|
|
+ unsigned char *ret = new unsigned char[ 6 ];
|
|
|
+ ret[ 0 ] = (unsigned char)TextZuInt( ip1->getText(), 10 );
|
|
|
+ ret[ 1 ] = (unsigned char)TextZuInt( ip2->getText(), 10 );
|
|
|
+ ret[ 2 ] = (unsigned char)TextZuInt( ip3->getText(), 10 );
|
|
|
+ ret[ 3 ] = (unsigned char)TextZuInt( ip4->getText(), 10 );
|
|
|
+ ret[ 4 ] = (unsigned char)( port & 0xFF );
|
|
|
+ ret[ 5 ] = (unsigned char)( port >> 8 );
|
|
|
+ ip1->release();
|
|
|
+ ip2->release();
|
|
|
+ ip3->release();
|
|
|
+ ip4->release();
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
int MSDatenbank::logoutKlient( int klientId, Array< int > *ret )
|