Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 425


Ignore:
Timestamp:
Dec 5, 2007, 10:06:29 PM (16 years ago)
Author:
scheusso
Message:

some minor changes

Location:
code/branches/FICN/src/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/Client.cc

    r415 r425  
    6868  bool Client::sendMouse(double x, double y){
    6969    // generate packet and add it to the queue
     70    if(!isConnected)
     71      return false;
    7072    if(!client_connection.addPacket(pck_gen.mousem(x, y)))
    7173        return false;
     
    8183  bool Client::sendKeyboard(char key_code){
    8284    // generate packet and add it to queue
     85    if(!isConnected)
     86      return false;
    8387    if(!client_connection.addPacket(pck_gen.keystrike(key_code)))
    8488        return false;
     
    118122   */
    119123  bool Client::sendPackets(){
     124    if(!isConnected)
     125      return false;
    120126    ENetEvent event;
    121127    // send packets
     
    142148  void Client::processGamestate( GameStateCompressed *data){
    143149    gamestate.pushGameState(*data);
     150    client_connection.addPacket(pck_gen.acknowledgement(data->id));
     151    client_connection.sendPackets();
    144152    return;
    145153  }
     
    153161  }
    154162 
     163  void Client::processChat( chat *data){
     164    std::cout << "Server: " << data->message << std::endl;
     165  }
     166 
    155167}
  • code/branches/FICN/src/network/Client.h

    r413 r425  
    5858  void processGamestate( GameStateCompressed *data);
    5959  void processClassid(classid *clid);
    60 
     60  void processChat( chat *data);
    6161};
    6262
  • code/branches/FICN/src/network/GameStateManager.cc

    r422 r425  
    3131
    3232GameStateCompressed GameStateManager::popGameState(int clientID){
    33   GameState *client = clientGameState[clientID]; 
     33  GameState *client = clientGameState[clientID];
    3434  GameState *server = reference;
    3535  return encode(client, server);
     
    160160}
    161161
     162void GameStateManager::removeClient(int clientID){
     163  clientGameState.erase(clientGameState.begin()+clientID);
     164}
     165
    162166}
    163167
  • code/branches/FICN/src/network/GameStateManager.h

    r422 r425  
    4848  GameStateCompressed popGameState(int clientID);
    4949  void ackGameState(int clientID, int gamestateID);
     50  void removeClient(int clientID);
    5051private:
    5152  GameState *getSnapshot(int id);
  • code/branches/FICN/src/network/Server.cc

    r422 r425  
    115115  }
    116116 
     117  /**
     118   * sends the gamestate
     119   */
    117120  bool Server::sendGameState(){
    118    
     121    return true;
    119122  }
    120123 
Note: See TracChangeset for help on using the changeset viewer.