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