Changeset 9524 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 27, 2006, 8:57:19 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.cc
r9523 r9524 107 107 for ( std::list<NetworkMessage>::iterator it = outgoingMessageQueue[userId].messages.begin(); it != outgoingMessageQueue[userId].messages.end(); it++ ) 108 108 { 109 // send data length 109 110 n = Converter::intToByteArray( it->length, data + i, maxLength ); 110 111 i += n; 111 112 assert( n == INTSIZE ); 112 113 114 // send serial number 113 115 n = Converter::intToByteArray( it->number, data + i, maxLength ); 114 116 i += n; 115 117 assert( n == INTSIZE ); 116 118 119 // send message type 117 120 n = Converter::intToByteArray( it->messageType, data + i, maxLength ); 118 121 i += n; 119 122 assert( n == INTSIZE ); 120 123 124 // send sender id 121 125 n = Converter::intToByteArray( it->senderId, data + i, maxLength ); 122 126 i += n; 123 127 assert( n == INTSIZE ); 124 128 129 // send destination id 125 130 n = Converter::intToByteArray( it->destinationId, data + i, maxLength ); 126 131 i += n; 127 132 assert( n == INTSIZE ); 128 133 134 // send receiver type 135 n = Converter::intToByteArray( it->recieverType, data + i, maxLength ); 136 i += n; 137 assert( n == INTSIZE ); 138 139 // and copy the data 129 140 assert( i + it->length <= maxLength ); 130 141 memcpy( data + i, it->data, it->length ); … … 180 191 181 192 int messageLength, messageType; 182 int senderId, destinationId ;193 int senderId, destinationId, recieverType; 183 194 184 195 // now go through all newly received messages and assemble them … … 215 226 i += n; 216 227 228 // read the receiver type 229 assert( i + INTSIZE <= length ); 230 n = Converter::byteArrayToInt( data + i, &recieverType); 231 assert( n == INTSIZE ); 232 i += n; 217 233 218 234 if ( number > 0 ) … … 249 265 msg.number = userId; 250 266 msg.senderId = senderId; 267 msg.recieverType = (RecieverType)recieverType; 251 268 msg.destinationId = destinationId; 252 269 … … 273 290 msg.senderId = senderId; 274 291 msg.destinationId = destinationId; 275 276 incomingMessageQueue.push_back( msg ); 292 msg.recieverType = (RecieverType)recieverType; 293 #warning do the actual forwarding 294 // void sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int reciever, MessagePriority messagePriority ); 295 296 // this->sendMessage(messageType, messageHandlerMap[(MessageType)messageType].someData, 277 297 } 278 298 } … … 409 429 msg.senderId = SharedNetworkData::getInstance()->getHostID(); 410 430 msg.destinationId = reciever; 431 msg.recieverType = recieverType; 411 432 msg.priority = messagePriority; 412 433 … … 425 446 msg.senderId = SharedNetworkData::getInstance()->getHostID(); 426 447 msg.destinationId = reciever; 448 msg.recieverType = recieverType; 427 449 msg.priority = messagePriority; 428 450 … … 448 470 msg.senderId = SharedNetworkData::getInstance()->getHostID(); 449 471 msg.destinationId = reciever; 472 msg.recieverType = recieverType; 450 473 msg.priority = messagePriority; 451 474 … … 469 492 msg.senderId = SharedNetworkData::getInstance()->getHostID(); 470 493 msg.destinationId = reciever; 494 msg.recieverType = recieverType; 471 495 msg.priority = messagePriority; 472 496 -
branches/proxy/src/lib/network/message_manager.h
r9521 r9524 42 42 typedef bool (*MessageCallback)( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId ); 43 43 44 enum RecieverType44 typedef enum RecieverType 45 45 { 46 46 RT_ALL_BUT_ME = 1, //!< message is sent to all users but myself … … 67 67 int senderId; //!< userId of the sender 68 68 int destinationId; //!< userId of the destination 69 RecieverType recieverType; //!< type of the receiver 69 70 MessagePriority priority; //!< priority of the messages 70 71 };
Note: See TracChangeset
for help on using the changeset viewer.