Changeset 9504 in orxonox.OLD for branches/proxy/src/lib/network
- Timestamp:
- Jul 27, 2006, 12:54:39 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.cc
r9494 r9504 141 141 int nAcks; 142 142 143 143 144 assert( i + INTSIZE <= length ); 144 145 n = Converter::byteArrayToInt( data + i, &nAcks ); … … 248 249 return i; 249 250 } 251 252 250 253 251 254 /** -
branches/proxy/src/lib/network/player_stats.cc
r9494 r9504 105 105 { 106 106 PRINTF(0)("user %s is now known as %s\n", oldNickName.c_str(), nickName.c_str()); 107 oldNickName = nickName; 108 } 109 } 107 this->oldNickName = nickName; 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 id 121 * @param newTeamId: the new team id 122 */ 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 } 134 135 110 136 111 137 /** -
branches/proxy/src/lib/network/player_stats.h
r9110 r9504 30 30 31 31 //! A class for storing player information 32 class PlayerStats : public Synchronizeable 32 class PlayerStats : public Synchronizeable 33 33 { 34 34 … … 37 37 PlayerStats( int userId ); 38 38 virtual ~PlayerStats(); 39 39 40 40 virtual void varChangeHandler( std::list<int> & id ); 41 41 42 42 static PlayerStats * getStats( int userId ); 43 43 44 44 inline int getUserId(){ return userId; } 45 45 46 46 inline int getTeamId(){ return teamId; } 47 47 inline void setTeamId( int teamId ){ this->teamId = teamId; } 48 48 49 void setPreferedTeamIdHandler( int newTeamId); 49 50 inline int getPreferedTeamId(){ return preferedTeamId; } 50 inline void setPreferedTeamId( int preferedTeamId ) { this->preferedTeamId = preferedTeamId; }51 51 inline void setPreferedTeamId( int preferedTeamId ) { this->preferedTeamId = preferedTeamId; } 52 52 53 inline int getScore(){ return score; } 53 54 inline void setScore( int score ){ this->score = score; } 54 55 55 56 inline int getPlayableClassId(){ return playableClassId; } 56 57 void setPlayableClassId( int classId ){ this->playableClassId = classId; }; 57 58 58 59 inline int getPlayableUniqueId(){ return playableUniqueId; } 59 60 void setPlayableUniqueId( int uniqueId ); 60 61 61 62 inline std::string getModelFileName(){ return modelFileName; } 62 63 inline void setModelFileName( std::string filename ){ modelFileName = filename; } 63 64 64 65 Playable * getPlayable(); 65 66 66 67 inline std::string getNickName(){ return this->nickName; } 67 68 void setNickName( std::string nick ); 68 69 static bool changeNickHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ); 69 70 void shellNick( const std::string& newNick ); 70 71 71 72 static void deleteAllPlayerStats(); 72 73 73 74 static ScoreList getScoreList(); 74 75 … … 97 98 int modelFileName_handle; 98 99 int nickName_handler; 99 100 100 101 void init(); 101 102 };
Note: See TracChangeset
for help on using the changeset viewer.