|
@@ -26,13 +26,13 @@ SpielerTeamStruktur::~SpielerTeamStruktur()
|
|
|
teamSize->release();
|
|
|
}
|
|
|
|
|
|
-SpielerTeamStrukturV *SpielerTeamStruktur::getThis()
|
|
|
+SpielerTeamStrukturV* SpielerTeamStruktur::getThis()
|
|
|
{
|
|
|
ref++;
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
-SpielerTeamStrukturV *SpielerTeamStruktur::release()
|
|
|
+SpielerTeamStrukturV* SpielerTeamStruktur::release()
|
|
|
{
|
|
|
ref--;
|
|
|
if( !ref )
|
|
@@ -44,7 +44,7 @@ SpielerTeamStrukturV *SpielerTeamStruktur::release()
|
|
|
// Inhalt der EditorKlient Klasse aus EditorKlient.h
|
|
|
// Konstruktor
|
|
|
// k: Der zu verwendende Klient
|
|
|
-EditorKlient::EditorKlient( KSGClient::EditorServerClient *k )
|
|
|
+EditorKlient::EditorKlient( KSGClient::EditorServerClient* k )
|
|
|
: ReferenceCounter()
|
|
|
{
|
|
|
klient = k;
|
|
@@ -62,7 +62,7 @@ EditorKlient::~EditorKlient()
|
|
|
// 0, sonnst
|
|
|
int EditorKlient::init()
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -77,8 +77,8 @@ int EditorKlient::init()
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -92,7 +92,7 @@ int EditorKlient::init()
|
|
|
// Verwirft die vorhandene Sitzung und erstellt eine neue
|
|
|
bool EditorKlient::sitzungVerwerfen()
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -105,8 +105,8 @@ bool EditorKlient::sitzungVerwerfen()
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -120,7 +120,7 @@ bool EditorKlient::sitzungVerwerfen()
|
|
|
// Speichert Sitzung und beendet Editor
|
|
|
bool EditorKlient::sitzungBeenden()
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -133,8 +133,8 @@ bool EditorKlient::sitzungBeenden()
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -145,9 +145,9 @@ bool EditorKlient::sitzungBeenden()
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveTeam( const TeamDaten *team )
|
|
|
+bool EditorKlient::saveTeam( const TeamDaten* team )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -159,28 +159,28 @@ bool EditorKlient::saveTeam( const TeamDaten *team )
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
- k->sendeEncrypted( (char *)&team->id, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->maxPunkte, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->beschleunigung, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->maxStabilität, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->maxEnergie, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->reparatur, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->akkuLeistung, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->laserIntensität, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->laserEffizienz, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->laserTempo, 4 );
|
|
|
- k->sendeEncrypted( (char *)&team->wendigkeit, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->antriebEffizienz, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->energieSchild, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->energieSchildEffizienz, 8 );
|
|
|
- k->sendeEncrypted( (char *)&team->punkte, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->id, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->maxPunkte, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->beschleunigung, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->maxStabilität, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->maxEnergie, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->reparatur, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->akkuLeistung, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->laserIntensität, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->laserEffizienz, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->laserTempo, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&team->wendigkeit, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->antriebEffizienz, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->energieSchild, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->energieSchildEffizienz, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&team->punkte, 4 );
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -191,9 +191,9 @@ bool EditorKlient::saveTeam( const TeamDaten *team )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveSpieler( const SpielerDaten *spieler )
|
|
|
+bool EditorKlient::saveSpieler( const SpielerDaten* spieler )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -205,33 +205,33 @@ bool EditorKlient::saveSpieler( const SpielerDaten *spieler )
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
- k->sendeEncrypted( (char *)&spieler->id, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->pos.x, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->pos.y, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->rot, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->beschleunigung, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->maxStabilität, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->maxEnergie, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->reparatur, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->akkuLeistung, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->laserIntensität, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->laserEffizienz, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->laserTempo, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->wendigkeit, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->antriebEffizienz, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->energieSchild, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->energieSchildEffizienz, 8 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->netzwerk, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->skillPunkte, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->m2d, 4 );
|
|
|
- k->sendeEncrypted( (char *)&spieler->bild, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->id, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->pos.x, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->pos.y, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->rot, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->beschleunigung, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->maxStabilität, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->maxEnergie, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->reparatur, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->akkuLeistung, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->laserIntensität, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->laserEffizienz, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->laserTempo, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->wendigkeit, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->antriebEffizienz, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->energieSchild, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->energieSchildEffizienz, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->netzwerk, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->skillPunkte, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->m2d, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&spieler->bild, 4 );
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -242,9 +242,9 @@ bool EditorKlient::saveSpieler( const SpielerDaten *spieler )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveObjekt( const ObjektDaten *objekt )
|
|
|
+bool EditorKlient::saveObjekt( const ObjektDaten* objekt )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -256,27 +256,27 @@ bool EditorKlient::saveObjekt( const ObjektDaten *objekt )
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
- k->sendeEncrypted( (char *)&objekt->pos.x, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->pos.y, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->rot, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->scale, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->id, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->m2d, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->bild, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->style, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->maxStabilität, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->maxEnergie, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->energieRadius, 4 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->reparatur, 8 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->akkuLeistung, 8 );
|
|
|
- k->sendeEncrypted( (char *)&objekt->team, 1 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->pos.x, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->pos.y, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->rot, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->scale, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->id, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->m2d, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->bild, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->style, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->maxStabilität, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->maxEnergie, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->energieRadius, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->reparatur, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->akkuLeistung, 8 );
|
|
|
+ k->sendeEncrypted( (char*)&objekt->team, 1 );
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -289,7 +289,7 @@ bool EditorKlient::saveObjekt( const ObjektDaten *objekt )
|
|
|
|
|
|
bool EditorKlient::deleteObjekt( int id )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -301,14 +301,14 @@ bool EditorKlient::deleteObjekt( int id )
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
- k->sendeEncrypted( (char *)&id, 4 );
|
|
|
+ k->sendeEncrypted( (char*)&id, 4 );
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -319,9 +319,9 @@ bool EditorKlient::deleteObjekt( int id )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadResources( Array< ResourceDaten * > &resources )
|
|
|
+bool EditorKlient::loadResources( Array< ResourceDaten* >& resources )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -334,14 +334,14 @@ bool EditorKlient::loadResources( Array< ResourceDaten * > &resources )
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
int anz = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&anz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
- ResourceDaten *resource = new ResourceDaten();
|
|
|
- k->getNachrichtEncrypted( (char *)&resource->id, 4 );
|
|
|
+ ResourceDaten* resource = new ResourceDaten();
|
|
|
+ k->getNachrichtEncrypted( (char*)&resource->id, 4 );
|
|
|
char len = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&len, 1 );
|
|
|
- char *path = new char[ len + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
+ char* path = new char[ len + 1 ];
|
|
|
path[ len ] = 0;
|
|
|
k->getNachrichtEncrypted( path, len );
|
|
|
resource->path = path;
|
|
@@ -352,8 +352,8 @@ bool EditorKlient::loadResources( Array< ResourceDaten * > &resources )
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -364,9 +364,9 @@ bool EditorKlient::loadResources( Array< ResourceDaten * > &resources )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-int EditorKlient::addResource( const char *path )
|
|
|
+int EditorKlient::addResource( const char* path )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -379,13 +379,13 @@ int EditorKlient::addResource( const char *path )
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
unsigned char len = (unsigned char)strlen( path );
|
|
|
- k->sendeEncrypted( (char *)&len, 1 );
|
|
|
+ k->sendeEncrypted( (char*)&len, 1 );
|
|
|
k->sendeEncrypted( path, len );
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
int id = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&id, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&id, 4 );
|
|
|
klient->endEditorMessage();
|
|
|
return id;
|
|
|
}
|
|
@@ -393,8 +393,8 @@ int EditorKlient::addResource( const char *path )
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -405,9 +405,9 @@ int EditorKlient::addResource( const char *path )
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadSpieler( Array< SpielerDaten * > &spieler )
|
|
|
+bool EditorKlient::loadSpieler( Array< SpielerDaten* >& spieler )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -420,38 +420,38 @@ bool EditorKlient::loadSpieler( Array< SpielerDaten * > &spieler )
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
int anz = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&anz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
- SpielerDaten *player = new SpielerDaten();
|
|
|
- k->getNachrichtEncrypted( (char *)&player->id, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->pos.x, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->pos.y, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->rot, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->beschleunigung, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->maxStabilität, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->maxEnergie, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->reparatur, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->akkuLeistung, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->laserIntensität, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->laserEffizienz, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->laserTempo, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->wendigkeit, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->antriebEffizienz, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->energieSchild, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->energieSchildEffizienz, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->netzwerk, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->skillPunkte, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->m2d, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&player->bild, 4 );
|
|
|
+ SpielerDaten* player = new SpielerDaten();
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->id, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->pos.x, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->pos.y, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->rot, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->beschleunigung, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->maxStabilität, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->maxEnergie, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->reparatur, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->akkuLeistung, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->laserIntensität, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->laserEffizienz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->laserTempo, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->wendigkeit, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->antriebEffizienz, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->energieSchild, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->energieSchildEffizienz, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->netzwerk, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->skillPunkte, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->m2d, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&player->bild, 4 );
|
|
|
spieler.add( player );
|
|
|
}
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -462,9 +462,9 @@ bool EditorKlient::loadSpieler( Array< SpielerDaten * > &spieler )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadTeams( Array< TeamDaten * > &teams )
|
|
|
+bool EditorKlient::loadTeams( Array< TeamDaten* >& teams )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -477,33 +477,33 @@ bool EditorKlient::loadTeams( Array< TeamDaten * > &teams )
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
int anz = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&anz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
- TeamDaten *team = new TeamDaten();
|
|
|
- k->getNachrichtEncrypted( (char *)&team->id, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->maxPunkte, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->beschleunigung, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->maxStabilität, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->maxEnergie, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->reparatur, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->akkuLeistung, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->laserIntensität, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->laserEffizienz, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->laserTempo, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->wendigkeit, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->antriebEffizienz, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->energieSchild, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->energieSchildEffizienz, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&team->punkte, 4 );
|
|
|
+ TeamDaten* team = new TeamDaten();
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->id, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->maxPunkte, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->beschleunigung, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->maxStabilität, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->maxEnergie, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->reparatur, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->akkuLeistung, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->laserIntensität, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->laserEffizienz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->laserTempo, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->wendigkeit, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->antriebEffizienz, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->energieSchild, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->energieSchildEffizienz, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&team->punkte, 4 );
|
|
|
teams.add( team );
|
|
|
}
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -514,9 +514,9 @@ bool EditorKlient::loadTeams( Array< TeamDaten * > &teams )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadObjekte( Array< ObjektDaten * > &objekte )
|
|
|
+bool EditorKlient::loadObjekte( Array< ObjektDaten* >& objekte )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -529,32 +529,32 @@ bool EditorKlient::loadObjekte( Array< ObjektDaten * > &objekte )
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
int anz = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&anz, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
for( int i = 0; i < anz; i++ )
|
|
|
{
|
|
|
- ObjektDaten *objekt = new ObjektDaten();
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->pos.x, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->pos.y, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->rot, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->scale, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->id, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->m2d, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->bild, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->style, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->maxStabilität, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->maxEnergie, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->energieRadius, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->reparatur, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->akkuLeistung, 8 );
|
|
|
- k->getNachrichtEncrypted( (char *)&objekt->team, 1 );
|
|
|
+ ObjektDaten* objekt = new ObjektDaten();
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->pos.x, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->pos.y, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->rot, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->scale, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->id, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->m2d, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->bild, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->style, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->maxStabilität, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->maxEnergie, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->energieRadius, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->reparatur, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->akkuLeistung, 8 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&objekt->team, 1 );
|
|
|
objekte.add( objekt );
|
|
|
}
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -565,7 +565,7 @@ bool EditorKlient::loadObjekte( Array< ObjektDaten * > &objekte )
|
|
|
return ret == 1;
|
|
|
}
|
|
|
|
|
|
-Bild *EditorKlient::loadBild( const char *templatePath )
|
|
|
+Bild* EditorKlient::loadBild( const char* templatePath )
|
|
|
{
|
|
|
Text txt( templatePath );
|
|
|
Text pfad;
|
|
@@ -592,14 +592,14 @@ Bild *EditorKlient::loadBild( const char *templatePath )
|
|
|
{
|
|
|
while( pfad.anzahlVon( "/" ) > 1 )
|
|
|
{
|
|
|
- Text *name = pfad.getTeilText( 0, pfad.positionVon( "/" ) );
|
|
|
+ Text* name = pfad.getTeilText( 0, pfad.positionVon( "/" ) );
|
|
|
klient->deOrdnerÖffnen( name );
|
|
|
pfad.remove( 0, name->getLength() + 1 );
|
|
|
name->release();
|
|
|
}
|
|
|
- Text *datei = pfad.getTeilText( 0, pfad.positionVon( ".ltdb/" ) + 5 );
|
|
|
- Text *bild = pfad.getTeilText( pfad.positionVon( ".ltdb/" ) + 6 );
|
|
|
- Bild *res = klient->deBildLaden( datei, bild, 0 );
|
|
|
+ Text* datei = pfad.getTeilText( 0, pfad.positionVon( ".ltdb/" ) + 5 );
|
|
|
+ Text* bild = pfad.getTeilText( pfad.positionVon( ".ltdb/" ) + 6 );
|
|
|
+ Bild* res = klient->deBildLaden( datei, bild, 0 );
|
|
|
datei->release();
|
|
|
bild->release();
|
|
|
cs.unlock();
|
|
@@ -612,7 +612,7 @@ Bild *EditorKlient::loadBild( const char *templatePath )
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-Model2DData *EditorKlient::loadModel( const char *templatePath )
|
|
|
+Model2DData* EditorKlient::loadModel( const char* templatePath )
|
|
|
{
|
|
|
Text txt( templatePath );
|
|
|
Text pfad;
|
|
@@ -624,7 +624,7 @@ Model2DData *EditorKlient::loadModel( const char *templatePath )
|
|
|
{
|
|
|
int pos = pfad.positionVon( ".m2/", pfad.anzahlVon( ".m2/" ) - 1 );
|
|
|
M2Datei datei;
|
|
|
- Text *file = pfad.getTeilText( 0, pos + 3 );
|
|
|
+ Text* file = pfad.getTeilText( 0, pos + 3 );
|
|
|
datei.setPfad( file->getText() );
|
|
|
file->release();
|
|
|
datei.leseDaten();
|
|
@@ -641,14 +641,14 @@ Model2DData *EditorKlient::loadModel( const char *templatePath )
|
|
|
{
|
|
|
while( pfad.anzahlVon( "/" ) > 1 )
|
|
|
{
|
|
|
- Text *name = pfad.getTeilText( 0, pfad.positionVon( "/" ) );
|
|
|
+ Text* name = pfad.getTeilText( 0, pfad.positionVon( "/" ) );
|
|
|
klient->deOrdnerÖffnen( name );
|
|
|
pfad.remove( 0, name->getLength() + 1 );
|
|
|
name->release();
|
|
|
}
|
|
|
- Text *datei = pfad.getTeilText( 0, pfad.positionVon( ".m2/" ) + 3 );
|
|
|
- Text *model = pfad.getTeilText( pfad.positionVon( ".m2/" ) + 4 );
|
|
|
- Model2DData *res = klient->deModelLaden( datei, model, 0 );
|
|
|
+ Text* datei = pfad.getTeilText( 0, pfad.positionVon( ".m2/" ) + 3 );
|
|
|
+ Text* model = pfad.getTeilText( pfad.positionVon( ".m2/" ) + 4 );
|
|
|
+ Model2DData* res = klient->deModelLaden( datei, model, 0 );
|
|
|
datei->release();
|
|
|
model->release();
|
|
|
cs.unlock();
|
|
@@ -661,24 +661,24 @@ Model2DData *EditorKlient::loadModel( const char *templatePath )
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-RCArray< Text > *EditorKlient::getAllMapResourcePaths()
|
|
|
+RCArray< Text >* EditorKlient::getAllMapResourcePaths()
|
|
|
{
|
|
|
cs.lock();
|
|
|
klient->deResetPath();
|
|
|
- RCArray< Text > *result = new RCArray< Text >();
|
|
|
+ RCArray< Text >* result = new RCArray< Text >();
|
|
|
loadMapResourcePathsFromFolder( "map:", result );
|
|
|
cs.unlock();
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-void EditorKlient::loadMapResourcePathsFromFolder( const char *folderPath, RCArray< Text > *zPaths )
|
|
|
+void EditorKlient::loadMapResourcePathsFromFolder( const char* folderPath, RCArray< Text >* zPaths )
|
|
|
{
|
|
|
- RCArray< Text > *files = new RCArray< Text >();
|
|
|
+ RCArray< Text >* files = new RCArray< Text >();
|
|
|
klient->deGetDateiListe( files );
|
|
|
- for( auto f = files->getIterator(); f; f++ )
|
|
|
+ for( auto f : *files )
|
|
|
{
|
|
|
Text path( folderPath );
|
|
|
- path += Text( "/" ) + *f._;
|
|
|
+ path += Text( "/" ) + *f;
|
|
|
if( !f->hat( "." ) )
|
|
|
{
|
|
|
klient->deOrdnerÖffnen( f );
|
|
@@ -688,26 +688,26 @@ void EditorKlient::loadMapResourcePathsFromFolder( const char *folderPath, RCArr
|
|
|
}
|
|
|
else if( f->hat( ".ltdb" ) )
|
|
|
{
|
|
|
- RCArray< Text > *bilder = new RCArray< Text >();
|
|
|
+ RCArray< Text >* bilder = new RCArray< Text >();
|
|
|
klient->deGetBildListe( f, bilder );
|
|
|
- for( auto n = bilder->getIterator(); n; n++ )
|
|
|
- zPaths->add( new Text( path + "/" + *n._ ) );
|
|
|
+ for( auto n : *bilder )
|
|
|
+ zPaths->add( new Text( path + "/" + *n ) );
|
|
|
bilder->release();
|
|
|
}
|
|
|
else if( f->hat( ".m2" ) )
|
|
|
{
|
|
|
- RCArray< Text > *models = new RCArray< Text >();
|
|
|
+ RCArray< Text >* models = new RCArray< Text >();
|
|
|
klient->deGetModelListe( f, models );
|
|
|
- for( auto n = models->getIterator(); n; n++ )
|
|
|
- zPaths->add( new Text( path + "/" + *n._ ) );
|
|
|
+ for( auto n : *models )
|
|
|
+ zPaths->add( new Text( path + "/" + *n ) );
|
|
|
models->release();
|
|
|
}
|
|
|
else if( f->hat( ".gsl" ) )
|
|
|
{
|
|
|
- RCArray< Text > *sounds = new RCArray< Text >();
|
|
|
+ RCArray< Text >* sounds = new RCArray< Text >();
|
|
|
klient->deGetSoundListe( f, sounds );
|
|
|
- for( auto n = sounds->getIterator(); n; n++ )
|
|
|
- zPaths->add( new Text( path + "/" + *n._ ) );
|
|
|
+ for( auto n : *sounds )
|
|
|
+ zPaths->add( new Text( path + "/" + *n ) );
|
|
|
sounds->release();
|
|
|
}
|
|
|
}
|
|
@@ -715,14 +715,14 @@ void EditorKlient::loadMapResourcePathsFromFolder( const char *folderPath, RCArr
|
|
|
}
|
|
|
|
|
|
// Lädt die Spieler Team Struktur
|
|
|
-bool EditorKlient::getSpielerTeamStruktur( SpielerTeamStrukturV *sts )
|
|
|
+bool EditorKlient::getSpielerTeamStruktur( SpielerTeamStrukturV* sts )
|
|
|
{
|
|
|
return klient->ladeTeamDaten( sts );
|
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadMapSize( Punkt &size )
|
|
|
+bool EditorKlient::loadMapSize( Punkt& size )
|
|
|
{
|
|
|
- Network::Klient *k = klient->beginEditorMessage();
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
if( !k )
|
|
|
{
|
|
|
error = klient->getLetzterFehler();
|
|
@@ -734,14 +734,14 @@ bool EditorKlient::loadMapSize( Punkt &size )
|
|
|
k->getNachrichtEncrypted( &ret, 1 );
|
|
|
if( ret == 1 )
|
|
|
{
|
|
|
- k->getNachrichtEncrypted( (char *)&size.x, 4 );
|
|
|
- k->getNachrichtEncrypted( (char *)&size.y, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&size.x, 4 );
|
|
|
+ k->getNachrichtEncrypted( (char*)&size.y, 4 );
|
|
|
}
|
|
|
if( ret == 3 )
|
|
|
{
|
|
|
unsigned char l = 0;
|
|
|
- k->getNachrichtEncrypted( (char *)&l, 1 );
|
|
|
- char *err = new char[ l + 1 ];
|
|
|
+ k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
+ char* err = new char[ l + 1 ];
|
|
|
err[ l ] = 0;
|
|
|
k->getNachrichtEncrypted( err, l );
|
|
|
error = err;
|
|
@@ -753,7 +753,7 @@ bool EditorKlient::loadMapSize( Punkt &size )
|
|
|
}
|
|
|
|
|
|
// Gibt den Letzten Fehler zurück
|
|
|
-char *EditorKlient::getLastError() const
|
|
|
+char* EditorKlient::getLastError() const
|
|
|
{
|
|
|
return error;
|
|
|
}
|