Changeset 9507 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 27, 2006, 1:59:30 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.h
r9494 r9507 26 26 27 27 28 //!< different message ids 28 29 enum MessageId 29 30 { 30 TESTMESSAGEID = 1, 31 MSGID_DELETESYNCHRONIZEABLE, 32 MSGID_PREFEREDTEAM, 33 MSGID_CHANGENICKNAME, 34 MSGID_CHATMESSAGE, 35 MSGID_RESPAWN 31 TESTMESSAGEID = 1, //!< for testing purposes 32 MSGID_DELETESYNCHRONIZEABLE, //!< message for sync deletion 33 MSGID_PREFEREDTEAM, //!< change prefered team 34 MSGID_CHANGENICKNAME, //!< change nicknames 35 MSGID_CHATMESSAGE, //!< chat message 36 MSGID_RESPAWN, //!< respawn message 37 38 MSGID_FORWARDMESSAGE //!< forwarding a messag between proxy and master server 36 39 }; 40 37 41 38 42 typedef bool (*MessageCallback)( MessageId messageId, byte * data, int dataLength, void * someData, int userId ); -
branches/proxy/src/lib/network/network_game_manager.cc
r9503 r9507 272 272 void NetworkGameManager::prefereTeam( int teamId ) 273 273 { 274 if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)275 setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId );274 if ( SharedNetworkData::getInstance()->isMasterServer() ) 275 this->setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId ); 276 276 else 277 277 { … … 280 280 assert( Converter::intToByteArray( teamId, buf, INTSIZE) == INTSIZE ); 281 281 282 MessageManager::getInstance()->sendMessage( MSGID_PREFEREDTEAM, buf, INTSIZE, RT_USER, 0, MP_HIGHBANDWIDTH ); 282 // send this message to the master server 283 MessageManager::getInstance()->sendMessage( MSGID_PREFEREDTEAM, buf, INTSIZE, RT_USER, NET_ID_MASTER_SERVER, MP_HIGHBANDWIDTH ); 283 284 } 284 285 } -
branches/proxy/src/lib/network/player_stats.cc
r9505 r9507 107 107 this->oldNickName = nickName; 108 108 } 109 110 if ( std::find( id.begin(), id.end(), teamId_handle ) != id.end() )111 {112 PRINTF(0)("user %s joins team %i\n", this->nickName.c_str(), this->teamId);113 this->setPreferedTeamIdHandler( this->teamId);114 }115 116 }117 118 119 /**120 * handler for setting the prefered team id121 * @param newTeamId: the new team id122 */123 void PlayerStats::setPreferedTeamIdHandler( int newTeamId)124 {125 126 if( this->playable == NULL)127 {128 PRINTF(0)("could not set prefered team, since the playable is not yet set\n");129 return;130 }131 132 this->playable->setTeam(newTeamId);133 109 } 134 110 … … 189 165 State::getPlayer()->setPlayable( this->playable ); 190 166 // also set the team id 191 this->playable->setTeam(this->getTeamId());192 167 } 193 168 -
branches/proxy/src/lib/network/player_stats.h
r9505 r9507 47 47 inline void setTeamId( int teamId ){ this->teamId = teamId; } 48 48 49 void setPreferedTeamIdHandler( int newTeamId);50 49 inline int getPreferedTeamId(){ return preferedTeamId; } 51 50 inline void setPreferedTeamId( int preferedTeamId ) { this->preferedTeamId = preferedTeamId; }
Note: See TracChangeset
for help on using the changeset viewer.