|
@@ -26,6 +26,7 @@ FactoryClient::~FactoryClient()
|
|
|
|
|
|
void FactoryClient::loadServerInfo()
|
|
void FactoryClient::loadServerInfo()
|
|
{
|
|
{
|
|
|
|
+ std::cout << "downloading server type information\n";
|
|
// receive type information
|
|
// receive type information
|
|
for (int i = 0; i < blockTypeCount; i++)
|
|
for (int i = 0; i < blockTypeCount; i++)
|
|
blockTypes[i]->release();
|
|
blockTypes[i]->release();
|
|
@@ -176,8 +177,8 @@ int FactoryClient::join(
|
|
secret = buffer;
|
|
secret = buffer;
|
|
delete[] buffer;
|
|
delete[] buffer;
|
|
}
|
|
}
|
|
- int keyLen;
|
|
|
|
- client->getNachricht((char*)&keyLen, 4);
|
|
|
|
|
|
+ short keyLen;
|
|
|
|
+ client->getNachricht((char*)&keyLen, 2);
|
|
char* key = new char[keyLen];
|
|
char* key = new char[keyLen];
|
|
client->getNachricht(key, keyLen);
|
|
client->getNachricht(key, keyLen);
|
|
foreground = new Klient();
|
|
foreground = new Klient();
|
|
@@ -235,6 +236,11 @@ int FactoryClient::join(
|
|
bg = 1;
|
|
bg = 1;
|
|
if (!background->sende((char*)&bg, 1)) return 201;
|
|
if (!background->sende((char*)&bg, 1)) return 201;
|
|
backgroundReader = new NetworkReader(background);
|
|
backgroundReader = new NetworkReader(background);
|
|
|
|
+ char res;
|
|
|
|
+ foregroundReader->lese(&res, 1);
|
|
|
|
+ if (res != 1) return 403;
|
|
|
|
+ backgroundReader->lese(&res, 1);
|
|
|
|
+ if (res != 1) return 403;
|
|
client->trenne();
|
|
client->trenne();
|
|
loadServerInfo();
|
|
loadServerInfo();
|
|
return 200;
|
|
return 200;
|