Changeset 8829 for code/branches/output/src/libraries/network/Client.cc
- Timestamp:
- Aug 7, 2011, 3:11:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/network/Client.cc
r8807 r8829 116 116 } 117 117 118 bool Client::processChat(const std::string& message, unsigned int playerID)119 {120 // orxout(message) << "Player " << playerID << ": " << message << endl;121 return true;122 }123 124 118 void Client::printRTT() 125 119 { … … 128 122 129 123 /** 130 * This function implements the method of sending a chat message to the server124 * @brief Sends a chat message to the server. 131 125 * @param message message to be sent 132 * @return result(true/false) 126 * @param sourceID the ID of the sender 127 * @param targetID the ID of the receiver 133 128 */ 134 bool Client::chat(const std::string& message) 135 { 136 packet::Chat *m = new packet::Chat(message, Host::getPlayerID()); 137 return m->send(static_cast<Host*>(this)); 138 } 139 129 void Client::doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID) 130 { 131 // send the message to the server 132 packet::Chat* packet = new packet::Chat(message, sourceID, targetID); 133 packet->send(static_cast<Host*>(this)); 134 } 135 136 /** 137 * @brief Gets called if a packet::Chat packet is received. Calls the parent function which passes the message to the listeners. 138 */ 139 void Client::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID) 140 { 141 // call the parent function which passes the message to the listeners 142 Host::doReceiveChat(message, sourceID, targetID); 143 } 140 144 141 145 /** … … 203 207 Game::getInstance().popState(); 204 208 } 205 209 206 210 void Client::processPacket(packet::Packet* packet) 207 211 { … … 216 220 packet->process(static_cast<Host*>(this)); 217 221 } 218 219 220 221 222 222 }
Note: See TracChangeset
for help on using the changeset viewer.