Changeset 8589 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Jun 19, 2006, 8:36:11 PM (19 years ago)
- Location:
- branches/network/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/message_manager.cc
r8273 r8589 319 319 { 320 320 NetworkMessage msg; 321 321 322 322 msg.data = new byte[dataLength]; 323 323 memcpy( msg.data, data, dataLength ); … … 326 326 msg.number = newNumber++; 327 327 msg.priority = messagePriority; 328 328 329 329 it->second.messages.push_back( msg ); 330 330 331 if ( recieverType == RT_ALL_ME ) 332 incomingMessabeBuffer.push_back( msg ); 333 } 334 } 335 } 336 337 331 332 } 333 } 334 335 if ( recieverType == RT_ALL_ME ) 336 { 337 NetworkMessage msg; 338 339 msg.data = new byte[dataLength]; 340 memcpy( msg.data, data, dataLength ); 341 msg.length = dataLength; 342 msg.messageId = messageId; 343 msg.number = newNumber++; 344 msg.priority = messagePriority; 345 346 incomingMessabeBuffer.push_back( msg ); 347 } 348 } 349 350 -
branches/network/src/lib/network/network_game_manager.cc
r8588 r8589 60 60 MessageManager::getInstance()->registerMessageHandler( MSGID_DELETESYNCHRONIZEABLE, delSynchronizeableHandler, NULL ); 61 61 MessageManager::getInstance()->registerMessageHandler( MSGID_PREFEREDTEAM, preferedTeamHandler, NULL ); 62 MessageManager::getInstance()->registerMessageHandler( MSGID_CHATMESSAGE, chatMessageHandler, NULL ); 62 63 63 64 this->gameState = 0; … … 300 301 301 302 rules.handleChatMessage( userId, message, messageType ); 302 303 303 304 return true; 304 305 } … … 312 313 void NetworkGameManager::sendChatMessage( const std::string & message, int messageType, int userId ) 313 314 { 314 byte * buf = new byte[message.length() ]+2*INTSIZE;315 315 byte * buf = new byte[message.length()+2*INTSIZE]; 316 316 317 assert( Converter::intToByteArray( messageType, buf, INTSIZE ) == INTSIZE ); 317 318 assert( Converter::stringToByteArray(message, buf+INTSIZE, message.length()+INTSIZE) == message.length()+INTSIZE ); 318 319 319 320 if ( userId == -1 ) 320 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, sizeof(buf), RT_ALL_ME, 0, MP_HIGHBANDWIDTH );321 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+2*INTSIZE, RT_ALL_ME, 0, MP_HIGHBANDWIDTH ); 321 322 else 322 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, sizeof(buf), RT_USER, userId, MP_HIGHBANDWIDTH );323 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+2*INTSIZE, RT_USER, userId, MP_HIGHBANDWIDTH ); 323 324 324 325 delete [] buf; -
branches/network/src/lib/shell/some_shell_commands.cc
r8244 r8589 28 28 using namespace OrxShell; 29 29 30 #include "network_game_rules.h" 31 SHELL_COMMAND(say, NetworkGameRules, shellSay)->setAlias("say"); 32 30 33 #include "player_stats.h" 31 34 SHELL_COMMAND(nick, PlayerStats, shellNick)->setAlias("nick");
Note: See TracChangeset
for help on using the changeset viewer.