- Timestamp:
- Oct 29, 2008, 12:48:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/infos/HumanPlayer.cc
r2040 r2041 55 55 this->registerVariables(); 56 56 57 COUT(0) << "HumanPlayer created" << std::endl; 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 else 64 { 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; 58 83 } 59 84 60 85 HumanPlayer::~HumanPlayer() 61 86 { 87 COUT(0) << this->getObjectID() << ": HumanPlayer destroyed" << std::endl; 62 88 } 63 89 … … 94 120 void HumanPlayer::networkcallback_clientIDchanged() 95 121 { 122 COUT(0) << this->getObjectID() << ": PI: clientID changed to " << this->clientID_ << std::endl; 96 123 if (this->clientID_ == network::Host::getPlayerID()) 97 124 { 125 COUT(0) << this->getObjectID() << ": PI: it's my clientID" << std::endl; 98 126 this->bLocalPlayer_ = true; 99 127 this->synchronize_nick_ = this->nick_; … … 101 129 102 130 if (!Core::isMaster()) 131 { 103 132 this->setObjectMode(network::direction::bidirectional); 133 COUT(0) << this->getObjectID() << ": PI: set objectmode to bidirectional" << std::endl; 134 } 104 135 else 105 136 this->setName(this->nick_); … … 112 143 { 113 144 this->client_ready_ = true; 145 COUT(0) << this->getObjectID() << ": PI: server ready, client set ready too" << std::endl; 114 146 } 115 147 116 148 void HumanPlayer::networkcallback_client_ready() 117 149 { 150 COUT(0) << this->getObjectID() << ": PI: client ready" << std::endl; 118 151 if (this->getGametype()) 152 { 153 COUT(0) << this->getObjectID() << ": PI: adding client to gametype" << std::endl; 119 154 this->getGametype()->playerEntered(this); 155 } 120 156 } 121 157 … … 137 173 void HumanPlayer::setClientID(unsigned int clientID) 138 174 { 175 COUT(0) << this->getObjectID() << ": PI: set clientID to " << clientID << std::endl; 139 176 this->clientID_ = clientID; 140 177 this->networkcallback_clientIDchanged();
Note: See TracChangeset
for help on using the changeset viewer.