Changeset 2042 for code/branches/objecthierarchy/src/orxonox/objects/infos
- Timestamp:
- Oct 29, 2008, 3:26:55 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects/infos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/infos/HumanPlayer.cc
r2041 r2042 54 54 this->setConfigValues(); 55 55 this->registerVariables(); 56 57 COUT(0) << this->getObjectID() << ": HumanPlayer created" << std::endl;58 network::Synchronisable* temp = dynamic_cast<network::Synchronisable*>(creator);59 if (temp)60 {61 COUT(0) << this->getObjectID() << ": CreatorID: " << temp->getObjectID() << std::endl;62 }63 else64 {65 COUT(0) << this->getObjectID() << ": Creator is no Synchronisable" << std::endl;66 }67 unsigned int creatorID = network::OBJECTID_UNKNOWN;68 searchcreatorID:69 if (creator)70 {71 if (creator->isA(Class(Synchronisable)))72 {73 Synchronisable* synchronisable_creator = dynamic_cast<Synchronisable*>(creator);74 creatorID = synchronisable_creator->getObjectID();75 }76 else if (creator != creator->getCreator())77 {78 creator = creator->getCreator();79 goto searchcreatorID;80 }81 }82 COUT(0) << this->getObjectID() << ": ### tranmitted creatorID: " << creatorID << std::endl;83 56 } 84 57 85 58 HumanPlayer::~HumanPlayer() 86 59 { 87 COUT(0) << this->getObjectID() << ": HumanPlayer destroyed" << std::endl;88 60 } 89 61 … … 120 92 void HumanPlayer::networkcallback_clientIDchanged() 121 93 { 122 COUT(0) << this->getObjectID() << ": PI: clientID changed to " << this->clientID_ << std::endl;123 94 if (this->clientID_ == network::Host::getPlayerID()) 124 95 { 125 COUT(0) << this->getObjectID() << ": PI: it's my clientID" << std::endl;126 96 this->bLocalPlayer_ = true; 127 97 this->synchronize_nick_ = this->nick_; … … 129 99 130 100 if (!Core::isMaster()) 131 {132 101 this->setObjectMode(network::direction::bidirectional); 133 COUT(0) << this->getObjectID() << ": PI: set objectmode to bidirectional" << std::endl;134 }135 102 else 136 103 this->setName(this->nick_); … … 143 110 { 144 111 this->client_ready_ = true; 145 COUT(0) << this->getObjectID() << ": PI: server ready, client set ready too" << std::endl;146 112 } 147 113 148 114 void HumanPlayer::networkcallback_client_ready() 149 115 { 150 COUT(0) << this->getObjectID() << ": PI: client ready" << std::endl;151 116 if (this->getGametype()) 152 {153 COUT(0) << this->getObjectID() << ": PI: adding client to gametype" << std::endl;154 117 this->getGametype()->playerEntered(this); 155 }156 118 } 157 119 … … 173 135 void HumanPlayer::setClientID(unsigned int clientID) 174 136 { 175 COUT(0) << this->getObjectID() << ": PI: set clientID to " << clientID << std::endl;176 137 this->clientID_ = clientID; 177 138 this->networkcallback_clientIDchanged(); -
code/branches/objecthierarchy/src/orxonox/objects/infos/PlayerInfo.cc
r2041 r2042 128 128 this->controllableEntityID_ = network::OBJECTID_UNKNOWN; 129 129 } 130 COUT(0) << this->getObjectID() << ": PI: start control" << std::endl; 130 131 131 if (this->controller_) 132 132 this->controller_->setControllableEntity(entity);
Note: See TracChangeset
for help on using the changeset viewer.