Changes in client/Client/main.cpp [e607c0f:3b1efcc] in network-game


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    re607c0f r3b1efcc  
    2323#include "../../common/Compiler.h"
    2424#include "../../common/Message.h"
    25 #include "../../common/Common.h"
    2625
    2726#include "Window.h"
     
    201200      error("socket");
    202201
    203    set_nonblock(sock);
    204 
    205202   server.sin_family = AF_INET;
    206203   hp = gethostbyname(argv[1]);
     
    212209
    213210   al_start_timer(timer);
    214 
     211 
    215212   while(!doexit)
    216213   {
     
    285282         }
    286283      }
    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)) {
    296286         redraw = false;
    297287 
     
    374364      case STATE_START:
    375365      {
    376          cout << "In STATE_START" << endl;
    377 
    378366         chatConsole.addLine(response);
    379367
     
    460448
    461449   sendMessage(&msgTo, sock, &server);
     450   receiveMessage(&msgFrom, sock, &from);
     451   processMessage(msgFrom, state, chatConsole);
     452   cout << "state: " << state << endl;
    462453}
    463454
     
    477468
    478469   sendMessage(&msgTo, sock, &server);
     470   receiveMessage(&msgFrom, sock, &from);
     471   processMessage(msgFrom, state, chatConsole);
     472   cout << "state: " << state << endl;
    479473}
    480474
     
    488482
    489483   sendMessage(&msgTo, sock, &server);
     484   receiveMessage(&msgFrom, sock, &from);
     485   processMessage(msgFrom, state, chatConsole);
    490486}
    491487
     
    506502
    507503   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.