Changeset 8327 for code/trunk/src/orxonox
- Timestamp:
- Apr 25, 2011, 8:22:36 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/network6 (added) merged: 7823-7825,7875,7878,7881-7882,7898,7900,7931,8315
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/ChatHistory.cc
r7284 r8327 82 82 #ifndef CHATTEST 83 83 /* get sender ID and prepend it to the message */ 84 if (senderID != CLIENTID_UNKNOWN)84 if (senderID != NETWORK_PEER_ID_UNKNOWN) 85 85 { 86 86 /* if we can't find anything, use "unknown" as default */ -
code/trunk/src/orxonox/ChatInputHandler.cc
r8079 r8327 220 220 221 221 /* setup player name info */ 222 if (senderID != CLIENTID_UNKNOWN)222 if (senderID != NETWORK_PEER_ID_UNKNOWN) 223 223 { 224 224 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); -
code/trunk/src/orxonox/PlayerManager.cc
r7474 r8327 45 45 RegisterRootObject(PlayerManager); 46 46 47 this->getConnectedClients();47 // this->getConnectedClients(); 48 48 } 49 49 -
code/trunk/src/orxonox/gamestates/GSRoot.cc
r8079 r8327 183 183 { 184 184 if (!GameMode::isStandalone()) 185 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new);185 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, NETWORK_PEER_ID_BROADCAST, factor_new); 186 186 } 187 187 -
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
r7284 r8327 452 452 if (!it->first)//in order to catch nullpointer 453 453 continue; 454 if (it->first->getClientID() == CLIENTID_UNKNOWN)454 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 455 455 continue; 456 456 this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); … … 467 467 if (!it->first)//in order to catch nullpointer 468 468 continue; 469 if (it->first->getClientID() == CLIENTID_UNKNOWN)469 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 470 470 continue; 471 471 else if (it->second==chaser) … … 501 501 if (!it->first)//in order to catch nullpointer 502 502 continue; 503 if (it->first->getClientID() == CLIENTID_UNKNOWN)503 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 504 504 continue; 505 505 this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); … … 516 516 if (!it->first) 517 517 continue; 518 if (it->first->getClientID() == CLIENTID_UNKNOWN)518 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 519 519 continue; 520 520 else if (it->second==chaser) … … 551 551 if (!it->first)//in order to catch nullpointer 552 552 continue; 553 if (it->first->getClientID() == CLIENTID_UNKNOWN)553 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 554 554 continue; 555 555 this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); … … 566 566 if (!it->first) 567 567 continue; 568 if (it->first->getClientID() == CLIENTID_UNKNOWN)568 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 569 569 continue; 570 570 else if (it->second==chaser) … … 632 632 for (std::map<PlayerInfo*, int>::iterator it = this->playerParty_.begin(); it != this->playerParty_.end(); ++it) 633 633 { 634 if (it->first->getClientID() == CLIENTID_UNKNOWN)634 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 635 635 continue; 636 636 this->gtinfo_->sendStaticMessage("Selection phase: Shoot at everything that moves.",it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f)); -
code/trunk/src/orxonox/gametypes/Gametype.cc
r8079 r8327 263 263 it->second.frags_++; 264 264 265 if (killer->getPlayer()->getClientID() != CLIENTID_UNKNOWN)265 if (killer->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN) 266 266 this->gtinfo_->sendKillMessage("You killed " + victim->getPlayer()->getName(), killer->getPlayer()->getClientID()); 267 if (victim->getPlayer()->getClientID() != CLIENTID_UNKNOWN)267 if (victim->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN) 268 268 this->gtinfo_->sendDeathMessage("You were killed by " + killer->getPlayer()->getName(), victim->getPlayer()->getClientID()); 269 269 } -
code/trunk/src/orxonox/gametypes/LastManStanding.cc
r8234 r8327 86 86 if (it != this->players_.end()) 87 87 { 88 if (it->first->getClientID()== CLIENTID_UNKNOWN)88 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 89 89 return true; 90 90 const std::string& message = ""; // resets Camper-Warning-message … … 131 131 for (std::map<PlayerInfo*, int>::iterator it = this->playerLives_.begin(); it != this->playerLives_.end(); ++it) 132 132 { 133 if (it->first->getClientID() == CLIENTID_UNKNOWN)133 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 134 134 continue; 135 135 … … 194 194 if (it != this->players_.end()) 195 195 { 196 if (it->first->getClientID()== CLIENTID_UNKNOWN)196 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 197 197 return; 198 198 const std::string& message = ""; // resets Camper-Warning-message … … 249 249 this->inGame_[it->first]=true; 250 250 251 if (it->first->getClientID()== CLIENTID_UNKNOWN)251 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 252 252 continue; 253 253 int output=1+(int)playerDelayTime_[it->first]; … … 261 261 { 262 262 this->punishPlayer(it->first); 263 if (it->first->getClientID()== CLIENTID_UNKNOWN)263 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 264 264 return; 265 265 const std::string& message = ""; // resets Camper-Warning-message … … 269 269 else if (it->second<timeRemaining/5)//Warning message 270 270 { 271 if (it->first->getClientID()== CLIENTID_UNKNOWN)271 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 272 272 continue; 273 273 const std::string& message = "Camper Warning! Don't forget to shoot."; -
code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
r8234 r8327 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "network/NetworkPrereqs.h" 32 33 #include "network/Host.h" 33 34 #include "infos/PlayerInfo.h" … … 135 136 if (it != this->players_.end()) 136 137 { 137 if (it->first->getClientID()== CLIENTID_UNKNOWN)138 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 138 139 return true; 139 140 const std::string& message = ""; // resets Camper-Warning-message … … 169 170 if (it != this->players_.end()) 170 171 { 171 if (it->first->getClientID()== CLIENTID_UNKNOWN)172 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 172 173 return; 173 174 const std::string& message = ""; // resets Camper-Warning-message … … 196 197 this->inGame_[it->first] = true; 197 198 198 if (it->first->getClientID()== CLIENTID_UNKNOWN)199 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 199 200 continue; 200 201 int output = 1 + (int)playerDelayTime_[it->first]; … … 208 209 { 209 210 this->punishPlayer(it->first); 210 if (it->first->getClientID() == CLIENTID_UNKNOWN)211 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 211 212 return; 212 213 const std::string& message = ""; // resets Camper-Warning-message … … 216 217 else if (it->second < timeRemaining/5)//Warning message 217 218 { 218 if (it->first->getClientID()== CLIENTID_UNKNOWN)219 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 219 220 continue; 220 221 const std::string& message = "Camper Warning! Don't forget to shoot."; … … 232 233 for (std::map<PlayerInfo*, int>::iterator it = this->playerLives_.begin(); it != this->playerLives_.end(); ++it) 233 234 { 234 if (it->first->getClientID() == CLIENTID_UNKNOWN)235 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 235 236 continue; 236 237 … … 247 248 for (std::map<PlayerInfo*, int>::iterator it3 = this->teamnumbers_.begin(); it3 != this->teamnumbers_.end(); ++it3) 248 249 { 249 if (it3->first->getClientID() == CLIENTID_UNKNOWN)250 if (it3->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 250 251 continue; 251 252 if (it3->second == party) -
code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
r7284 r8327 190 190 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 191 191 { 192 if (it->first->getClientID() == CLIENTID_UNKNOWN)192 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 193 193 continue; 194 194 -
code/trunk/src/orxonox/gametypes/UnderAttack.cc
r6417 r8327 76 76 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 77 77 { 78 if (it->first->getClientID() == CLIENTID_UNKNOWN)78 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 79 79 continue; 80 80 … … 158 158 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 159 159 { 160 if (it->first->getClientID() == CLIENTID_UNKNOWN)160 if (it->first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 161 161 continue; 162 162 -
code/trunk/src/orxonox/infos/GametypeInfo.cc
r7163 r8327 74 74 if (GameMode::isMaster()) 75 75 { 76 callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), CLIENTID_UNKNOWN, message);76 callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), NETWORK_PEER_ID_BROADCAST, message); 77 77 this->dispatchAnnounceMessage(message); 78 78 } -
code/trunk/src/orxonox/infos/HumanPlayer.cc
r6417 r8327 32 32 #include "core/ConfigValueIncludes.h" 33 33 #include "core/GameMode.h" 34 #include "network/ClientInformation.h"34 // #include "network/ClientInformation.h" 35 35 #include "network/Host.h" 36 36 #include "controllers/HumanController.h" … … 144 144 float HumanPlayer::getPing() const 145 145 { 146 return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT()); 146 // return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT()); 147 return 0.; //TODO: reimplement this 147 148 } 148 149 149 150 float HumanPlayer::getPacketLossRatio() const 150 151 { 151 return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss()); 152 // return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss()); 153 return 0.; //TODO: reimplement this 152 154 } 153 155 -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r7163 r8327 32 32 33 33 #include "core/CoreIncludes.h" 34 #include "network/ClientInformation.h"34 // #include "network/ClientInformation.h" 35 35 #include "gametypes/Gametype.h" 36 36 #include "worldentities/ControllableEntity.h" … … 43 43 RegisterObject(PlayerInfo); 44 44 45 this->clientID_ = CLIENTID_UNKNOWN;45 this->clientID_ = NETWORK_PEER_ID_UNKNOWN; 46 46 this->bHumanPlayer_ = false; 47 47 this->bLocalPlayer_ = false;
Note: See TracChangeset
for help on using the changeset viewer.