Changeset 2087 for code/trunk/src/network/Client.cc
- Timestamp:
- Nov 1, 2008, 7:04:09 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/network/Client.cc
r1907 r2087 39 39 // 40 40 41 #include <cassert> 42 41 43 #include "Client.h" 42 44 #include "Host.h" … … 44 46 #include "core/CoreIncludes.h" 45 47 #include "packet/Packet.h" 48 46 49 // #include "packet/Acknowledgement.h" 47 50 … … 67 70 * @param port port of the application on the server 68 71 */ 69 Client::Client( std::stringaddress, int port) : client_connection(port, address){72 Client::Client(const std::string& address, int port) : client_connection(port, address){ 70 73 isConnected=false; 71 74 isSynched_=false; … … 114 117 } 115 118 116 bool Client::processChat( std::stringmessage, unsigned int playerID){117 COUT(1) << "Player " << playerID << ": " << message << std::endl;119 bool Client::processChat(const std::string& message, unsigned int playerID){ 120 // COUT(1) << "Player " << playerID << ": " << message << std::endl; 118 121 return true; 119 122 } 120 123 121 124 /** 122 125 * This function implements the method of sending a chat message to the server 123 * @param message message to be sent 126 * @param message message to be sent 124 127 * @return result(true/false) 125 128 */ 126 bool Client::chat( std::stringmessage){129 bool Client::chat(const std::string& message){ 127 130 packet::Chat *m = new packet::Chat(message, Host::getPlayerID()); 128 131 return m->send(); … … 132 135 /** 133 136 * Processes incoming packets, sends a gamestate to the server and does the cleanup 134 * @param time 137 * @param time 135 138 */ 136 139 void Client::tick(float time){ … … 152 155 COUT(5) << "tick packet size " << event->packet->dataLength << std::endl; 153 156 packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer); 157 // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler 154 158 bool b = packet->process(); 155 159 assert(b);
Note: See TracChangeset
for help on using the changeset viewer.