Skip to content
Snippets Groups Projects
Commit e3902d42 authored by OleL's avatar OleL
Browse files

... (*rennt immernoch panisch im Kreis und es wird nicht besser*)

parent 1efb1420
No related branches found
No related tags found
No related merge requests found
...@@ -58,20 +58,20 @@ void GameClient::joinGame(String ip) { ...@@ -58,20 +58,20 @@ void GameClient::joinGame(String ip) {
Serial.printf("Conn data:\n\tip: %s\n\tport: %d\n", ip.c_str(), SERVER_PORT); Serial.printf("Conn data:\n\tip: %s\n\tport: %d\n", ip.c_str(), SERVER_PORT);
//client->connect(ip.c_str(), SERVER_PORT);
client = new WiFiClient();
Serial.printf("Trying to conncet!\n"); Serial.printf("Trying to conncet!\n");
if (!client->connect("192.168.42.175", 4803)){ Serial.printf("My ip is %s\n", WiFi.localIP().toString().c_str());
Serial.printf("Connect failed!\n"); client->connect(ip.c_str(), SERVER_PORT);
}
Serial.printf("client->connect\n"); Serial.printf("client->connect\n");
client->print(player->getNickname());
Serial.printf("client->print nickname\n");
client->flush();
Serial.printf("client->flush");
Serial.printf("Receiving"); client->println(player->getNickname());
//client->flush();
String recv = client->readStringUntil('\n'); String recv = client->readStringUntil('\n');
Serial.printf("RECV: %s", recv.c_str()); Serial.printf("RECV: %s\n", recv.c_str());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment