31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
|
|
String s_map[]; //send this via tcp
|
|
int i_sMapReso =1; //the higher the smaller the reso
|
|
void clientCommunication() {
|
|
client = server.available();
|
|
if (client != null) {
|
|
s_fromClient = client.readString();
|
|
if (s_fromClient.equals("give locx")) {
|
|
server.write(str(citizen[i_selectedCitizen].f_xPos/i_sMapReso));
|
|
}
|
|
if (s_fromClient.equals("give locy")) {
|
|
server.write(str(citizen[i_selectedCitizen].f_yPos/i_sMapReso));
|
|
}
|
|
if (s_fromClient.equals("give a")) {
|
|
server.write(str(citizen[i_selectedCitizen].f_angle));
|
|
}
|
|
if (s_fromClient.equals("give mapw")) {
|
|
server.write(str(img_houses.width/i_sMapReso));
|
|
}
|
|
if (s_fromClient.equals("give maph")) {
|
|
server.write(str(img_houses.height/i_sMapReso));
|
|
}
|
|
if (i_mapLevelTransferC >= img_houses.height/i_sMapReso) i_mapLevelTransferC = 0;
|
|
if (s_fromClient.equals("give map")) {
|
|
server.write(s_map[i_mapLevelTransferC]);
|
|
//println(s_map[i_mapLevelTransferC]);
|
|
i_mapLevelTransferC++;
|
|
}
|
|
}
|
|
}
|