Changeset 425
- Timestamp:
- Dec 5, 2007, 10:06:29 PM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/Client.cc
r415 r425 68 68 bool Client::sendMouse(double x, double y){ 69 69 // generate packet and add it to the queue 70 if(!isConnected) 71 return false; 70 72 if(!client_connection.addPacket(pck_gen.mousem(x, y))) 71 73 return false; … … 81 83 bool Client::sendKeyboard(char key_code){ 82 84 // generate packet and add it to queue 85 if(!isConnected) 86 return false; 83 87 if(!client_connection.addPacket(pck_gen.keystrike(key_code))) 84 88 return false; … … 118 122 */ 119 123 bool Client::sendPackets(){ 124 if(!isConnected) 125 return false; 120 126 ENetEvent event; 121 127 // send packets … … 142 148 void Client::processGamestate( GameStateCompressed *data){ 143 149 gamestate.pushGameState(*data); 150 client_connection.addPacket(pck_gen.acknowledgement(data->id)); 151 client_connection.sendPackets(); 144 152 return; 145 153 } … … 153 161 } 154 162 163 void Client::processChat( chat *data){ 164 std::cout << "Server: " << data->message << std::endl; 165 } 166 155 167 } -
code/branches/FICN/src/network/Client.h
r413 r425 58 58 void processGamestate( GameStateCompressed *data); 59 59 void processClassid(classid *clid); 60 60 void processChat( chat *data); 61 61 }; 62 62 -
code/branches/FICN/src/network/GameStateManager.cc
r422 r425 31 31 32 32 GameStateCompressed GameStateManager::popGameState(int clientID){ 33 GameState *client = clientGameState[clientID]; 33 GameState *client = clientGameState[clientID]; 34 34 GameState *server = reference; 35 35 return encode(client, server); … … 160 160 } 161 161 162 void GameStateManager::removeClient(int clientID){ 163 clientGameState.erase(clientGameState.begin()+clientID); 164 } 165 162 166 } 163 167 -
code/branches/FICN/src/network/GameStateManager.h
r422 r425 48 48 GameStateCompressed popGameState(int clientID); 49 49 void ackGameState(int clientID, int gamestateID); 50 void removeClient(int clientID); 50 51 private: 51 52 GameState *getSnapshot(int id); -
code/branches/FICN/src/network/Server.cc
r422 r425 115 115 } 116 116 117 /** 118 * sends the gamestate 119 */ 117 120 bool Server::sendGameState(){ 118 121 return true; 119 122 } 120 123
Note: See TracChangeset
for help on using the changeset viewer.