Changes in client/Client/main.cpp [3b1efcc:e607c0f] in network-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r3b1efcc re607c0f 23 23 #include "../../common/Compiler.h" 24 24 #include "../../common/Message.h" 25 #include "../../common/Common.h" 25 26 26 27 #include "Window.h" … … 200 201 error("socket"); 201 202 203 set_nonblock(sock); 204 202 205 server.sin_family = AF_INET; 203 206 hp = gethostbyname(argv[1]); … … 209 212 210 213 al_start_timer(timer); 211 214 212 215 while(!doexit) 213 216 { … … 282 285 } 283 286 } 284 285 if(redraw && al_is_event_queue_empty(event_queue)) { 287 288 if (receiveMessage(&msgFrom, sock, &from) >= 0) 289 { 290 processMessage(msgFrom, state, chatConsole); 291 cout << "state: " << state << endl; 292 } 293 294 if (redraw && al_is_event_queue_empty(event_queue)) 295 { 286 296 redraw = false; 287 297 … … 364 374 case STATE_START: 365 375 { 376 cout << "In STATE_START" << endl; 377 366 378 chatConsole.addLine(response); 367 379 … … 448 460 449 461 sendMessage(&msgTo, sock, &server); 450 receiveMessage(&msgFrom, sock, &from);451 processMessage(msgFrom, state, chatConsole);452 cout << "state: " << state << endl;453 462 } 454 463 … … 468 477 469 478 sendMessage(&msgTo, sock, &server); 470 receiveMessage(&msgFrom, sock, &from);471 processMessage(msgFrom, state, chatConsole);472 cout << "state: " << state << endl;473 479 } 474 480 … … 482 488 483 489 sendMessage(&msgTo, sock, &server); 484 receiveMessage(&msgFrom, sock, &from);485 processMessage(msgFrom, state, chatConsole);486 490 } 487 491 … … 502 506 503 507 sendMessage(&msgTo, sock, &server); 504 receiveMessage(&msgFrom, sock, &from); 505 processMessage(msgFrom, state, chatConsole); 506 } 508 }
Note:
See TracChangeset
for help on using the changeset viewer.