|
@@ -9,51 +9,51 @@ using namespace Editor;
|
|
|
|
|
|
SpielerTeamStruktur::SpielerTeamStruktur()
|
|
SpielerTeamStruktur::SpielerTeamStruktur()
|
|
{
|
|
{
|
|
- spielerAnzahl = 0;
|
|
|
|
- teamAnzahl = 0;
|
|
|
|
- spielerFarbe = new Array< int >();
|
|
|
|
- teamFarbe = new Array< int >();
|
|
|
|
- teamName = new RCArray< Text >();
|
|
|
|
- teamSize = new Array< int >();
|
|
|
|
- ref = 1;
|
|
|
|
|
|
+ spielerAnzahl = 0;
|
|
|
|
+ teamAnzahl = 0;
|
|
|
|
+ spielerFarbe = new Array< int >();
|
|
|
|
+ teamFarbe = new Array< int >();
|
|
|
|
+ teamName = new RCArray< Text >();
|
|
|
|
+ teamSize = new Array< int >();
|
|
|
|
+ ref = 1;
|
|
}
|
|
}
|
|
|
|
|
|
SpielerTeamStruktur::~SpielerTeamStruktur()
|
|
SpielerTeamStruktur::~SpielerTeamStruktur()
|
|
{
|
|
{
|
|
- spielerFarbe->release();
|
|
|
|
- teamFarbe->release();
|
|
|
|
- teamName->release();
|
|
|
|
- teamSize->release();
|
|
|
|
|
|
+ spielerFarbe->release();
|
|
|
|
+ teamFarbe->release();
|
|
|
|
+ teamName->release();
|
|
|
|
+ teamSize->release();
|
|
}
|
|
}
|
|
|
|
|
|
SpielerTeamStrukturV* SpielerTeamStruktur::getThis()
|
|
SpielerTeamStrukturV* SpielerTeamStruktur::getThis()
|
|
{
|
|
{
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
|
|
+ ref++;
|
|
|
|
+ return this;
|
|
}
|
|
}
|
|
|
|
|
|
SpielerTeamStrukturV* SpielerTeamStruktur::release()
|
|
SpielerTeamStrukturV* SpielerTeamStruktur::release()
|
|
{
|
|
{
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
|
|
+ ref--;
|
|
|
|
+ if (!ref)
|
|
|
|
+ delete this;
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
// Inhalt der EditorKlient Klasse aus EditorKlient.h
|
|
// Inhalt der EditorKlient Klasse aus EditorKlient.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
// k: Der zu verwendende Klient
|
|
// k: Der zu verwendende Klient
|
|
-EditorKlient::EditorKlient( KSGClient::EditorServerClient* k )
|
|
|
|
- : ReferenceCounter()
|
|
|
|
|
|
+EditorKlient::EditorKlient(KSGClient::EditorServerClient* k)
|
|
|
|
+ : ReferenceCounter()
|
|
{
|
|
{
|
|
- klient = k;
|
|
|
|
|
|
+ klient = k;
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
EditorKlient::~EditorKlient()
|
|
EditorKlient::~EditorKlient()
|
|
{
|
|
{
|
|
- klient->release();
|
|
|
|
|
|
+ klient->release();
|
|
}
|
|
}
|
|
|
|
|
|
// Initialisiert den Server
|
|
// Initialisiert den Server
|
|
@@ -62,698 +62,698 @@ EditorKlient::~EditorKlient()
|
|
// 0, sonnst
|
|
// 0, sonnst
|
|
int EditorKlient::init()
|
|
int EditorKlient::init()
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- k->sendeEncrypted( "\x0", 1 );
|
|
|
|
- char ret;
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ k->sendeEncrypted("\x0", 1);
|
|
|
|
+ char ret;
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
// Verwirft die vorhandene Sitzung und erstellt eine neue
|
|
// Verwirft die vorhandene Sitzung und erstellt eine neue
|
|
bool EditorKlient::sitzungVerwerfen()
|
|
bool EditorKlient::sitzungVerwerfen()
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x1", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x1", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
// Speichert Sitzung und beendet Editor
|
|
// Speichert Sitzung und beendet Editor
|
|
bool EditorKlient::sitzungBeenden()
|
|
bool EditorKlient::sitzungBeenden()
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x2", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x2", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveTeam( const TeamDaten* team )
|
|
|
|
|
|
+bool EditorKlient::saveTeam(const TeamDaten* team)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x7", 1 );
|
|
|
|
- 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->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x7", 1);
|
|
|
|
+ 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->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveSpieler( const SpielerDaten* spieler )
|
|
|
|
|
|
+bool EditorKlient::saveSpieler(const SpielerDaten* spieler)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x6", 1 );
|
|
|
|
- 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->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x6", 1);
|
|
|
|
+ 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->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::saveObjekt( const ObjektDaten* objekt )
|
|
|
|
|
|
+bool EditorKlient::saveObjekt(const ObjektDaten* objekt)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x8", 1 );
|
|
|
|
- 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->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x8", 1);
|
|
|
|
+ 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->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::deleteObjekt( int id )
|
|
|
|
|
|
+bool EditorKlient::deleteObjekt(int id)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x9", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- 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 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x9", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ 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];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadResources( Array< ResourceDaten* >& resources )
|
|
|
|
|
|
+bool EditorKlient::loadResources(Array< ResourceDaten* >& resources)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\xA", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- int anz = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
|
- for( int i = 0; i < anz; i++ )
|
|
|
|
- {
|
|
|
|
- ResourceDaten* resource = new ResourceDaten();
|
|
|
|
- k->getNachrichtEncrypted( (char*)&resource->id, 4 );
|
|
|
|
- char len = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
- char* path = new char[ len + 1 ];
|
|
|
|
- path[ len ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( path, len );
|
|
|
|
- resource->path = path;
|
|
|
|
- delete[] path;
|
|
|
|
- resources.add( resource );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\xA", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ int anz = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&anz, 4);
|
|
|
|
+ for (int i = 0; i < anz; i++)
|
|
|
|
+ {
|
|
|
|
+ ResourceDaten* resource = new ResourceDaten();
|
|
|
|
+ k->getNachrichtEncrypted((char*)&resource->id, 4);
|
|
|
|
+ char len = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&len, 1);
|
|
|
|
+ char* path = new char[len + 1];
|
|
|
|
+ path[len] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(path, len);
|
|
|
|
+ resource->path = path;
|
|
|
|
+ delete[] path;
|
|
|
|
+ resources.add(resource);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-int EditorKlient::addResource( const char* path )
|
|
|
|
|
|
+int EditorKlient::addResource(const char* path)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\xC", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- unsigned char len = (unsigned char)strlen( path );
|
|
|
|
- k->sendeEncrypted( (char*)&len, 1 );
|
|
|
|
- k->sendeEncrypted( path, len );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- int id = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&id, 4 );
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return id;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return 0;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\xC", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ unsigned char len = (unsigned char)strlen(path);
|
|
|
|
+ k->sendeEncrypted((char*)&len, 1);
|
|
|
|
+ k->sendeEncrypted(path, len);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ int id = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&id, 4);
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadSpieler( Array< SpielerDaten* >& spieler )
|
|
|
|
|
|
+bool EditorKlient::loadSpieler(Array< SpielerDaten* >& spieler)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x3", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- int anz = 0;
|
|
|
|
- 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 );
|
|
|
|
- spieler.add( player );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x3", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ int anz = 0;
|
|
|
|
+ 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);
|
|
|
|
+ spieler.add(player);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadTeams( Array< TeamDaten* >& teams )
|
|
|
|
|
|
+bool EditorKlient::loadTeams(Array< TeamDaten* >& teams)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x4", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- int anz = 0;
|
|
|
|
- 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 );
|
|
|
|
- teams.add( team );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x4", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ int anz = 0;
|
|
|
|
+ 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);
|
|
|
|
+ teams.add(team);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadObjekte( Array< ObjektDaten* >& objekte )
|
|
|
|
|
|
+bool EditorKlient::loadObjekte(Array< ObjektDaten* >& objekte)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\x5", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- int anz = 0;
|
|
|
|
- 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 );
|
|
|
|
- objekte.add( objekt );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( ret == 3 )
|
|
|
|
- {
|
|
|
|
- unsigned char l = 0;
|
|
|
|
- k->getNachrichtEncrypted( (char*)&l, 1 );
|
|
|
|
- char* err = new char[ l + 1 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\x5", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ int anz = 0;
|
|
|
|
+ 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);
|
|
|
|
+ objekte.add(objekt);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ret == 3)
|
|
|
|
+ {
|
|
|
|
+ unsigned char l = 0;
|
|
|
|
+ k->getNachrichtEncrypted((char*)&l, 1);
|
|
|
|
+ char* err = new char[l + 1];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
-Bild* EditorKlient::loadBild( const char* templatePath )
|
|
|
|
|
|
+Bild* EditorKlient::loadBild(const char* templatePath)
|
|
{
|
|
{
|
|
- Text txt( templatePath );
|
|
|
|
- Text pfad;
|
|
|
|
- if( txt.positionVon( "spiel:" ) == 0 )
|
|
|
|
- {
|
|
|
|
- pfad = "data/spiele/Asteroids";
|
|
|
|
- pfad.append( txt.getTeilText( 6 ) );
|
|
|
|
- if( pfad.hat( ".ltdb/" ) )
|
|
|
|
- {
|
|
|
|
- int pos = pfad.positionVon( ".ltdb/", pfad.anzahlVon( ".ltdb/" ) - 1 );
|
|
|
|
- LTDBDatei datei;
|
|
|
|
- datei.setDatei( pfad.getTeilText( 0, pos + 5 ) );
|
|
|
|
- datei.leseDaten( 0 );
|
|
|
|
- return datei.laden( 0, pfad.getTeilText( pos + 6 ) );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( txt.positionVon( "map:" ) == 0 )
|
|
|
|
- {
|
|
|
|
- pfad.append( txt.getTeilText( 5 ) );
|
|
|
|
- if( pfad.hat( ".ltdb/" ) )
|
|
|
|
- {
|
|
|
|
- cs.lock();
|
|
|
|
- if( klient->deResetPath() )
|
|
|
|
- {
|
|
|
|
- while( pfad.anzahlVon( "/" ) > 1 )
|
|
|
|
- {
|
|
|
|
- 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 );
|
|
|
|
- datei->release();
|
|
|
|
- bild->release();
|
|
|
|
- cs.unlock();
|
|
|
|
- return res;
|
|
|
|
- }
|
|
|
|
- cs.unlock();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
|
|
+ Text txt(templatePath);
|
|
|
|
+ Text pfad;
|
|
|
|
+ if (txt.positionVon("spiel:") == 0)
|
|
|
|
+ {
|
|
|
|
+ pfad = "data/spiele/Asteroids";
|
|
|
|
+ pfad.append(txt.getTeilText(6));
|
|
|
|
+ if (pfad.hat(".ltdb/"))
|
|
|
|
+ {
|
|
|
|
+ int pos = pfad.positionVon(".ltdb/", pfad.anzahlVon(".ltdb/") - 1);
|
|
|
|
+ LTDBDatei datei;
|
|
|
|
+ datei.setDatei(pfad.getTeilText(0, pos + 5));
|
|
|
|
+ datei.leseDaten(0);
|
|
|
|
+ return datei.laden(0, pfad.getTeilText(pos + 6));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (txt.positionVon("map:") == 0)
|
|
|
|
+ {
|
|
|
|
+ pfad.append(txt.getTeilText(5));
|
|
|
|
+ if (pfad.hat(".ltdb/"))
|
|
|
|
+ {
|
|
|
|
+ cs.lock();
|
|
|
|
+ if (klient->deResetPath())
|
|
|
|
+ {
|
|
|
|
+ while (pfad.anzahlVon("/") > 1)
|
|
|
|
+ {
|
|
|
|
+ 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);
|
|
|
|
+ datei->release();
|
|
|
|
+ bild->release();
|
|
|
|
+ cs.unlock();
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+ cs.unlock();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-Model2DData* EditorKlient::loadModel( const char* templatePath )
|
|
|
|
|
|
+Model2DData* EditorKlient::loadModel(const char* templatePath)
|
|
{
|
|
{
|
|
- Text txt( templatePath );
|
|
|
|
- Text pfad;
|
|
|
|
- if( txt.positionVon( "spiel:" ) == 0 )
|
|
|
|
- {
|
|
|
|
- pfad = "data/spiele/Asteroids";
|
|
|
|
- pfad.append( txt.getTeilText( 6 ) );
|
|
|
|
- if( pfad.hat( ".m2/" ) )
|
|
|
|
- {
|
|
|
|
- int pos = pfad.positionVon( ".m2/", pfad.anzahlVon( ".m2/" ) - 1 );
|
|
|
|
- M2Datei datei;
|
|
|
|
- Text* file = pfad.getTeilText( 0, pos + 3 );
|
|
|
|
- datei.setPfad( file->getText() );
|
|
|
|
- file->release();
|
|
|
|
- datei.leseDaten();
|
|
|
|
- return datei.ladeModel( pfad.getTeilText( pos + 4 ) );
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if( txt.positionVon( "map:" ) == 0 )
|
|
|
|
- {
|
|
|
|
- pfad.append( txt.getTeilText( 5 ) );
|
|
|
|
- if( pfad.hat( ".m2/" ) )
|
|
|
|
- {
|
|
|
|
- cs.lock();
|
|
|
|
- if( klient->deResetPath() )
|
|
|
|
- {
|
|
|
|
- while( pfad.anzahlVon( "/" ) > 1 )
|
|
|
|
- {
|
|
|
|
- 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 );
|
|
|
|
- datei->release();
|
|
|
|
- model->release();
|
|
|
|
- cs.unlock();
|
|
|
|
- return res;
|
|
|
|
- }
|
|
|
|
- cs.unlock();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
|
|
+ Text txt(templatePath);
|
|
|
|
+ Text pfad;
|
|
|
|
+ if (txt.positionVon("spiel:") == 0)
|
|
|
|
+ {
|
|
|
|
+ pfad = "data/spiele/Asteroids";
|
|
|
|
+ pfad.append(txt.getTeilText(6));
|
|
|
|
+ if (pfad.hat(".m2/"))
|
|
|
|
+ {
|
|
|
|
+ int pos = pfad.positionVon(".m2/", pfad.anzahlVon(".m2/") - 1);
|
|
|
|
+ M2Datei datei;
|
|
|
|
+ Text* file = pfad.getTeilText(0, pos + 3);
|
|
|
|
+ datei.setPfad(file->getText());
|
|
|
|
+ file->release();
|
|
|
|
+ datei.leseDaten();
|
|
|
|
+ return datei.ladeModel(pfad.getTeilText(pos + 4));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (txt.positionVon("map:") == 0)
|
|
|
|
+ {
|
|
|
|
+ pfad.append(txt.getTeilText(5));
|
|
|
|
+ if (pfad.hat(".m2/"))
|
|
|
|
+ {
|
|
|
|
+ cs.lock();
|
|
|
|
+ if (klient->deResetPath())
|
|
|
|
+ {
|
|
|
|
+ while (pfad.anzahlVon("/") > 1)
|
|
|
|
+ {
|
|
|
|
+ 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);
|
|
|
|
+ datei->release();
|
|
|
|
+ model->release();
|
|
|
|
+ cs.unlock();
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+ cs.unlock();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
RCArray< Text >* EditorKlient::getAllMapResourcePaths()
|
|
RCArray< Text >* EditorKlient::getAllMapResourcePaths()
|
|
{
|
|
{
|
|
- cs.lock();
|
|
|
|
- klient->deResetPath();
|
|
|
|
- RCArray< Text >* result = new RCArray< Text >();
|
|
|
|
- loadMapResourcePathsFromFolder( "map:", result );
|
|
|
|
- cs.unlock();
|
|
|
|
- return result;
|
|
|
|
|
|
+ cs.lock();
|
|
|
|
+ klient->deResetPath();
|
|
|
|
+ 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 >();
|
|
|
|
- klient->deGetDateiListe( files );
|
|
|
|
- for( auto f : *files )
|
|
|
|
- {
|
|
|
|
- Text path( folderPath );
|
|
|
|
- path += Text( "/" ) + *f;
|
|
|
|
- if( !f->hat( "." ) )
|
|
|
|
- {
|
|
|
|
- klient->deOrdnerÖffnen( f );
|
|
|
|
- loadMapResourcePathsFromFolder( path, zPaths );
|
|
|
|
- Text back = "..";
|
|
|
|
- klient->deOrdnerÖffnen( &back );
|
|
|
|
- }
|
|
|
|
- else if( f->hat( ".ltdb" ) )
|
|
|
|
- {
|
|
|
|
- RCArray< Text >* bilder = new RCArray< Text >();
|
|
|
|
- klient->deGetBildListe( f, bilder );
|
|
|
|
- for( auto n : *bilder )
|
|
|
|
- zPaths->add( new Text( path + "/" + *n ) );
|
|
|
|
- bilder->release();
|
|
|
|
- }
|
|
|
|
- else if( f->hat( ".m2" ) )
|
|
|
|
- {
|
|
|
|
- RCArray< Text >* models = new RCArray< Text >();
|
|
|
|
- klient->deGetModelListe( f, models );
|
|
|
|
- for( auto n : *models )
|
|
|
|
- zPaths->add( new Text( path + "/" + *n ) );
|
|
|
|
- models->release();
|
|
|
|
- }
|
|
|
|
- else if( f->hat( ".gsl" ) )
|
|
|
|
- {
|
|
|
|
- RCArray< Text >* sounds = new RCArray< Text >();
|
|
|
|
- klient->deGetSoundListe( f, sounds );
|
|
|
|
- for( auto n : *sounds )
|
|
|
|
- zPaths->add( new Text( path + "/" + *n ) );
|
|
|
|
- sounds->release();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- files->release();
|
|
|
|
|
|
+ RCArray< Text >* files = new RCArray< Text >();
|
|
|
|
+ klient->deGetDateiListe(files);
|
|
|
|
+ for (auto f : *files)
|
|
|
|
+ {
|
|
|
|
+ Text path(folderPath);
|
|
|
|
+ path += Text("/") + *f;
|
|
|
|
+ if (!f->hat("."))
|
|
|
|
+ {
|
|
|
|
+ klient->deOrdnerÖffnen(f);
|
|
|
|
+ loadMapResourcePathsFromFolder(path, zPaths);
|
|
|
|
+ Text back = "..";
|
|
|
|
+ klient->deOrdnerÖffnen(&back);
|
|
|
|
+ }
|
|
|
|
+ else if (f->hat(".ltdb"))
|
|
|
|
+ {
|
|
|
|
+ RCArray< Text >* bilder = new RCArray< Text >();
|
|
|
|
+ klient->deGetBildListe(f, bilder);
|
|
|
|
+ for (auto n : *bilder)
|
|
|
|
+ zPaths->add(new Text(path + "/" + *n));
|
|
|
|
+ bilder->release();
|
|
|
|
+ }
|
|
|
|
+ else if (f->hat(".m2"))
|
|
|
|
+ {
|
|
|
|
+ RCArray< Text >* models = new RCArray< Text >();
|
|
|
|
+ klient->deGetModelListe(f, models);
|
|
|
|
+ for (auto n : *models)
|
|
|
|
+ zPaths->add(new Text(path + "/" + *n));
|
|
|
|
+ models->release();
|
|
|
|
+ }
|
|
|
|
+ else if (f->hat(".gsl"))
|
|
|
|
+ {
|
|
|
|
+ RCArray< Text >* sounds = new RCArray< Text >();
|
|
|
|
+ klient->deGetSoundListe(f, sounds);
|
|
|
|
+ for (auto n : *sounds)
|
|
|
|
+ zPaths->add(new Text(path + "/" + *n));
|
|
|
|
+ sounds->release();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ files->release();
|
|
}
|
|
}
|
|
|
|
|
|
// Lädt die Spieler Team Struktur
|
|
// Lädt die Spieler Team Struktur
|
|
-bool EditorKlient::getSpielerTeamStruktur( SpielerTeamStrukturV* sts )
|
|
|
|
|
|
+bool EditorKlient::getSpielerTeamStruktur(SpielerTeamStrukturV* sts)
|
|
{
|
|
{
|
|
- return klient->ladeTeamDaten( sts );
|
|
|
|
|
|
+ return klient->ladeTeamDaten(sts);
|
|
}
|
|
}
|
|
|
|
|
|
-bool EditorKlient::loadMapSize( Punkt& size )
|
|
|
|
|
|
+bool EditorKlient::loadMapSize(Punkt& size)
|
|
{
|
|
{
|
|
- Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
- if( !k )
|
|
|
|
- {
|
|
|
|
- error = klient->getLetzterFehler();
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
- error = "";
|
|
|
|
- char ret;
|
|
|
|
- k->sendeEncrypted( "\xB", 1 );
|
|
|
|
- k->getNachrichtEncrypted( &ret, 1 );
|
|
|
|
- if( ret == 1 )
|
|
|
|
- {
|
|
|
|
- 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 ];
|
|
|
|
- err[ l ] = 0;
|
|
|
|
- k->getNachrichtEncrypted( err, l );
|
|
|
|
- error = err;
|
|
|
|
- delete[] err;
|
|
|
|
- ret = 0;
|
|
|
|
- }
|
|
|
|
- klient->endEditorMessage();
|
|
|
|
- return ret == 1;
|
|
|
|
|
|
+ Network::Klient* k = klient->beginEditorMessage();
|
|
|
|
+ if (!k)
|
|
|
|
+ {
|
|
|
|
+ error = klient->getLetzterFehler();
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ error = "";
|
|
|
|
+ char ret;
|
|
|
|
+ k->sendeEncrypted("\xB", 1);
|
|
|
|
+ k->getNachrichtEncrypted(&ret, 1);
|
|
|
|
+ if (ret == 1)
|
|
|
|
+ {
|
|
|
|
+ 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];
|
|
|
|
+ err[l] = 0;
|
|
|
|
+ k->getNachrichtEncrypted(err, l);
|
|
|
|
+ error = err;
|
|
|
|
+ delete[] err;
|
|
|
|
+ ret = 0;
|
|
|
|
+ }
|
|
|
|
+ klient->endEditorMessage();
|
|
|
|
+ return ret == 1;
|
|
}
|
|
}
|
|
|
|
|
|
// Gibt den Letzten Fehler zurück
|
|
// Gibt den Letzten Fehler zurück
|
|
-char* EditorKlient::getLastError() const
|
|
|
|
|
|
+const char* EditorKlient::getLastError() const
|
|
{
|
|
{
|
|
- return error;
|
|
|
|
|
|
+ return error;
|
|
}
|
|
}
|