Changeset 7823
- Timestamp:
- Dec 28, 2010, 4:46:42 PM (14 years ago)
- Location:
- code/branches/network6/src
- Files:
-
- 4 deleted
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network6/src/libraries/network/CMakeLists.txt
r7801 r7823 22 22 Client.cc 23 23 ClientConnection.cc 24 ClientInformation.cc25 24 ClientConnectionListener.cc 26 25 Connection.cc … … 50 49 ClientConnection.h 51 50 ClientConnectionListener.h 52 ClientInformation.h53 51 Connection.h 54 52 FunctionCall.h -
code/branches/network6/src/libraries/network/ClientConnection.cc
r7801 r7823 103 103 if( enet_host_service(this->host_, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && event.type == ENET_EVENT_TYPE_CONNECT ) 104 104 { 105 // manually add server to list of peers 106 /*incomingEvent inEvent = */Connection::preprocessConnectEvent(event); 107 // addPeer(inEvent.peerID); 108 // start communication thread 105 109 this->established_=true; 106 110 Connection::startCommunicationThread(); … … 148 152 assert( this->server_ ); 149 153 assert( packet ); 150 return Connection::addPacket( packet, this->server_, channelID ); 154 // return Connection::addPacket( packet, NETWORK_PEER_ID_SERVER, channelID ); 155 // HACK: actually there should be a way to do this using addPacket and the correct peerID 156 return Connection::broadcastPacket(packet, channelID); 151 157 } 152 158 153 void ClientConnection::addPeer( ENetEvent* event)159 void ClientConnection::addPeer(uint32_t peerID) 154 160 { 155 161 assert(0); 156 162 } 157 void ClientConnection::removePeer( ENetEvent* event)163 void ClientConnection::removePeer(uint32_t peerID) 158 164 { 159 165 this->established_=false; -
code/branches/network6/src/libraries/network/ClientConnection.h
r7801 r7823 57 57 uint32_t getRTT(); 58 58 private: 59 virtual void addPeer( ENetEvent* event);60 virtual void removePeer( ENetEvent* event);59 virtual void addPeer(uint32_t peerID); 60 virtual void removePeer(uint32_t peerID); 61 61 62 62 bool disconnectConnection(); -
code/branches/network6/src/libraries/network/ClientConnectionListener.cc
r6417 r7823 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/GameMode.h" 33 #include "ClientInformation.h"33 // #include "ClientInformation.h" 34 34 35 35 namespace orxonox … … 52 52 } 53 53 54 void ClientConnectionListener::getConnectedClients()55 {56 ClientInformation* client = ClientInformation::getBegin();57 while (client)58 {59 this->clientConnected(client->getID());60 client = client->next();61 }62 }54 // void ClientConnectionListener::getConnectedClients() 55 // { 56 // ClientInformation* client = ClientInformation::getBegin(); 57 // while (client) 58 // { 59 // this->clientConnected(client->getID()); 60 // client = client->next(); 61 // } 62 // } 63 63 } 64 64 -
code/branches/network6/src/libraries/network/ClientConnectionListener.h
r6417 r7823 48 48 49 49 protected: 50 void getConnectedClients();50 // void getConnectedClients(); 51 51 }; 52 52 } -
code/branches/network6/src/libraries/network/Connection.cc
r7801 r7823 44 44 45 45 Connection::Connection(): 46 host_(0), bCommunicationThreadRunning_(false) 46 host_(0), bCommunicationThreadRunning_(false), nextPeerID_(NETWORK_PEER_ID_SERVER+1) 47 47 { 48 48 enet_initialize(); … … 75 75 } 76 76 77 78 // int Connection::service(ENetEvent* event) { 79 // return enet_host_service( this->host_, event, NETWORK_WAIT_TIMEOUT ); 80 // } 81 82 void Connection::disconnectPeer(ENetPeer *peer) 83 { 84 assert(peer); 85 outgoingEvent outEvent = { peer, outgoingEventType::disconnectPeer, (ENetPacket*)10, 15 }; 77 void Connection::disconnectPeer(uint32_t peerID) 78 { 79 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 }; 86 80 87 81 this->outgoingEventsMutex_->lock(); … … 89 83 this->outgoingEventsMutex_->unlock(); 90 84 } 91 92 void Connection::addPacket(ENetPacket *packet, ENetPeer *peer, uint8_t channelID) 93 { 94 assert(peer); 95 outgoingEvent outEvent = { peer, outgoingEventType::sendPacket, packet, channelID }; 85 86 void Connection::disconnectPeers() 87 { 88 outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, 0, 0 }; 96 89 97 90 this->outgoingEventsMutex_->lock(); … … 99 92 this->outgoingEventsMutex_->unlock(); 100 93 } 101 102 void Connection:: broadcastPacket(ENetPacket* packet, uint8_t channelID)103 { 104 outgoingEvent outEvent = { (ENetPeer*)15, outgoingEventType::broadcastPacket, packet, channelID };94 95 void Connection::addPacket(ENetPacket* packet, uint32_t peerID, uint8_t channelID) 96 { 97 outgoingEvent outEvent = { peerID, outgoingEventType::sendPacket, packet, channelID }; 105 98 106 99 this->outgoingEventsMutex_->lock(); … … 108 101 this->outgoingEventsMutex_->unlock(); 109 102 } 103 104 void Connection::broadcastPacket(ENetPacket* packet, uint8_t channelID) 105 { 106 outgoingEvent outEvent = { 0, outgoingEventType::broadcastPacket, packet, channelID }; 107 108 this->outgoingEventsMutex_->lock(); 109 this->outgoingEvents_.push_back(outEvent); 110 this->outgoingEventsMutex_->unlock(); 111 } 110 112 111 113 … … 119 121 while( enet_host_check_events( this->host_, &event ) > 0 ) 120 122 { 121 // COUT(0) << "incoming event" << endl; 122 // received an event 123 this->incomingEventsMutex_->lock(); 124 this->incomingEvents_.push_back(event); 125 this->incomingEventsMutex_->unlock(); 123 processIncomingEvent(event); 126 124 } 127 125 … … 138 136 this->outgoingEventsMutex_->unlock(); 139 137 140 switch( outEvent.type ) 141 { 142 case outgoingEventType::sendPacket: 143 enet_peer_send( outEvent.peer, outEvent.channelID, outEvent.packet ); 144 break; 145 case outgoingEventType::disconnectPeer: 146 enet_peer_disconnect(outEvent.peer, 0); 147 break; 148 case outgoingEventType::broadcastPacket: 149 enet_host_broadcast( this->host_, outEvent.channelID, outEvent.packet ); 150 break; 151 default: 152 assert(0); 153 } 138 processOutgoingEvent(outEvent); 139 154 140 this->outgoingEventsMutex_->lock(); 155 141 outgoingEventsCount = this->outgoingEvents_.size(); … … 160 146 if( enet_host_service( this->host_, &event, NETWORK_WAIT_TIMEOUT ) > 0 ) 161 147 { 162 // COUT(0) << "incoming event after wait" << endl; 163 //received an event 164 this->incomingEventsMutex_->lock(); 165 this->incomingEvents_.push_back(event); 166 this->incomingEventsMutex_->unlock(); 148 processIncomingEvent(event); 167 149 } 168 150 } 169 151 } 152 153 void Connection::processIncomingEvent(ENetEvent& event) 154 { 155 incomingEvent inEvent; 156 // preprocess event 157 switch( event.type ) 158 { 159 case ENET_EVENT_TYPE_CONNECT: 160 inEvent = preprocessConnectEvent(event); 161 break; 162 case ENET_EVENT_TYPE_RECEIVE: 163 inEvent = preprocessReceiveEvent(event); 164 break; 165 case ENET_EVENT_TYPE_DISCONNECT: 166 inEvent = preprocessDisconnectEvent(event); 167 break; 168 case ENET_EVENT_TYPE_NONE: 169 default: 170 return; 171 } 172 173 // pushing event to queue 174 this->incomingEventsMutex_->lock(); 175 this->incomingEvents_.push_back(inEvent); 176 this->incomingEventsMutex_->unlock(); 177 } 178 179 void Connection::processOutgoingEvent(outgoingEvent& event) 180 { 181 ENetPeer* peer; 182 switch( event.type ) 183 { 184 case outgoingEventType::sendPacket: 185 assert(this->peerMap_.find(event.peerID) != this->peerMap_.end()); 186 peer = this->peerMap_[event.peerID]; 187 enet_peer_send( peer, event.channelID, event.packet ); 188 break; 189 case outgoingEventType::disconnectPeer: 190 assert(this->peerMap_.find(event.peerID) != this->peerMap_.end()); 191 peer = this->peerMap_[event.peerID]; 192 enet_peer_disconnect(peer, 0); 193 break; 194 case outgoingEventType::disconnectPeers: 195 while( this->peerMap_.size()!=0 ) 196 { 197 peer = this->peerMap_.begin()->second; 198 enet_peer_disconnect(peer, 0); 199 } 200 break; 201 case outgoingEventType::broadcastPacket: 202 enet_host_broadcast( this->host_, event.channelID, event.packet ); 203 break; 204 default: 205 assert(0); 206 } 207 } 208 170 209 171 210 void Connection::processQueue() 172 211 { 173 ENetEvent event;212 incomingEvent inEvent; 174 213 175 214 this->incomingEventsMutex_->lock(); … … 178 217 while( incomingEventsCount > 0 ) 179 218 { 180 packet::Packet* p;219 // pop event from queue 181 220 this->incomingEventsMutex_->lock(); 182 event = this->incomingEvents_.front();221 inEvent = this->incomingEvents_.front(); 183 222 this->incomingEvents_.pop_front(); 184 223 this->incomingEventsMutex_->unlock(); 185 224 186 switch(event.type) 225 // process event 226 switch( inEvent.type ) 187 227 { 188 // log handling ================ 189 case ENET_EVENT_TYPE_CONNECT: 190 addPeer( &event ); 228 case incomingEventType::peerConnect: 229 addPeer(inEvent.peerID); 191 230 break; 192 case ENET_EVENT_TYPE_DISCONNECT:193 removePeer( &event);231 case incomingEventType::peerDisconnect: 232 removePeer(inEvent.peerID); 194 233 break; 195 case ENET_EVENT_TYPE_RECEIVE: 196 // COUT(0) << "ENET_EVENT_TYPE_RECEIVE" << endl; 197 p = createPacket( &event ); 198 processPacket(p); 234 case incomingEventType::receivePacket: 235 processPacket(inEvent.packet); 199 236 break; 200 case ENET_EVENT_TYPE_NONE:237 default: 201 238 break; 202 239 } 203 240 241 // check whether there are still events in the queue 204 242 this->incomingEventsMutex_->lock(); 205 243 incomingEventsCount = this->incomingEvents_.size(); … … 208 246 } 209 247 210 packet::Packet* Connection::createPacket(ENetEvent* event) 211 { 212 packet::Packet *p = packet::Packet::createPacket(event->packet, event->peer); 213 return p; 214 // return p->process(); 215 } 248 incomingEvent Connection::preprocessConnectEvent(ENetEvent& event) 249 { 250 // make sure this peer doesn't exist 251 assert( this->peerMap_.find(this->nextPeerID_) == this->peerMap_.end() ); 252 assert( this->peerIDMap_.find(event.peer) == this->peerIDMap_.end() ); 253 254 // give peer a new id and increase peerID for next peer 255 uint32_t peerID = this->nextPeerID_; 256 ++this->nextPeerID_; 257 258 // add peer/peerID into peerMap_ and peerIDMap_ 259 this->peerMap_[peerID] = event.peer; 260 this->peerIDMap_[event.peer] = peerID; 261 262 // create new peerEvent and return it 263 incomingEvent inEvent = { peerID, incomingEventType::peerConnect, 0 }; 264 return inEvent; 265 } 266 267 incomingEvent Connection::preprocessDisconnectEvent(ENetEvent& event) 268 { 269 // assert that the peer exists and get peerID 270 assert( this->peerIDMap_.find(event.peer) != this->peerIDMap_.end() ); 271 uint32_t peerID = this->peerIDMap_[event.peer]; 272 273 // remove peer/peerID from maps 274 this->peerIDMap_.erase(this->peerIDMap_.find(event.peer)); 275 this->peerMap_.erase(this->peerMap_.find(peerID)); 276 277 // create new peerEvent and return it 278 incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, 0 }; 279 return inEvent; 280 } 281 282 incomingEvent Connection::preprocessReceiveEvent(ENetEvent& event) 283 { 284 // assert that the peer exists and get peerID 285 assert( this->peerIDMap_.find(event.peer) != this->peerIDMap_.end() ); 286 uint32_t peerID = this->peerIDMap_[event.peer]; 287 288 // create new Packet from ENetPacket 289 packet::Packet* p = packet::Packet::createPacket(event.packet, peerID); 290 291 // create new peerEvent and return it 292 incomingEvent inEvent = { peerID, incomingEventType::receivePacket, p }; 293 return inEvent; 294 } 295 216 296 217 297 void Connection::enableCompression() -
code/branches/network6/src/libraries/network/Connection.h
r7801 r7823 44 44 45 45 #include <deque> 46 #include <map> 46 47 #include <enet/enet.h> 48 #include <boost/concept_check.hpp> 47 49 48 50 namespace boost … … 59 61 const unsigned int NETWORK_MAX_QUEUE_PROCESS_TIME = 5; 60 62 63 namespace incomingEventType 64 { 65 enum Value 66 { 67 receivePacket = 1, // incoming packet 68 peerConnect = 2, // incoming connect request 69 peerDisconnect = 3 // incoming disconnect request 70 }; 71 72 } 73 61 74 namespace outgoingEventType 62 75 { 63 76 enum Value 64 77 { 65 sendPacket = 1, 66 disconnectPeer = 2, 67 broadcastPacket = 3 78 sendPacket = 1, // outgoing packet 79 broadcastPacket = 2, // outgoing broadcast packet 80 disconnectPeer = 3, // outgoing disconnect request 81 disconnectPeers = 4 // outgoing disconnect request 68 82 }; 69 83 70 84 } 71 85 86 struct _NetworkExport incomingEvent 87 { 88 uint32_t peerID; 89 incomingEventType::Value type; 90 packet::Packet* packet; 91 }; 92 72 93 struct _NetworkExport outgoingEvent 73 94 { 74 ENetPeer* peer;95 uint32_t peerID; 75 96 outgoingEventType::Value type; 76 97 ENetPacket* packet; … … 83 104 virtual ~Connection(); 84 105 85 void addPacket(ENetPacket *packet, ENetPeer *peer, uint8_t channelID);86 void broadcastPacket(ENetPacket* packet, uint8_t channelID);87 // ENetHost* getHost(){ return this->host_; }88 89 106 protected: 90 107 Connection(); 91 // static Connection* getInstance(){ return Connection::instance_; } 92 93 // int service(ENetEvent* event); 108 94 109 void startCommunicationThread(); 95 110 void stopCommunicationThread(); 96 void communicationThread(); 97 virtual void disconnectPeer(ENetPeer *peer); 111 112 void addPacket(ENetPacket *packet, uint32_t peerID, uint8_t channelID); 113 void broadcastPacket(ENetPacket* packet, uint8_t channelID); 114 void disconnectPeer(uint32_t peerID); 115 void disconnectPeers(); 98 116 99 117 void enableCompression(); 100 118 101 119 void processQueue(); 102 virtual void addPeer( ENetEvent* event)=0;103 virtual void removePeer( ENetEvent* event)=0;120 virtual void addPeer(uint32_t peerID)=0; 121 virtual void removePeer(uint32_t peerID)=0; 104 122 virtual void processPacket( packet::Packet* packet)=0; 105 virtual packet::Packet* createPacket(ENetEvent* event); 123 124 incomingEvent preprocessConnectEvent(ENetEvent& event); 125 incomingEvent preprocessDisconnectEvent(ENetEvent& event); 126 incomingEvent preprocessReceiveEvent(ENetEvent& event); 127 128 void processIncomingEvent(ENetEvent& event); 129 void processOutgoingEvent(outgoingEvent& event); 106 130 107 ENetHost* host_;131 ENetHost* host_; 108 132 private: 109 boost::thread* communicationThread_; 110 bool bCommunicationThreadRunning_; 111 ENetAddress* bindAddress_; 112 std::deque<ENetEvent> incomingEvents_; 113 std::deque<outgoingEvent> outgoingEvents_; 114 boost::mutex* incomingEventsMutex_; 115 boost::mutex* outgoingEventsMutex_; 133 void communicationThread(); 134 135 boost::thread* communicationThread_; 136 bool bCommunicationThreadRunning_; 137 ENetAddress* bindAddress_; 138 std::deque<incomingEvent> incomingEvents_; 139 std::deque<outgoingEvent> outgoingEvents_; 140 boost::mutex* incomingEventsMutex_; 141 boost::mutex* outgoingEventsMutex_; 142 std::map<uint32_t, ENetPeer*> peerMap_; 143 std::map<ENetPeer*, uint32_t> peerIDMap_; 144 uint32_t nextPeerID_; 116 145 117 146 // static Connection *instance_; -
code/branches/network6/src/libraries/network/GamestateManager.h
r7801 r7823 101 101 { assert(peerMap_.find(peerID)!=peerMap_.end()); peerMap_[peerID].isSynched = true; } 102 102 void removePeer( uint32_t peerID ); 103 bool hasPeers(){ return this->peerMap_.size()!=0; } 103 104 // void removeClient(ClientInformation *client); 104 105 protected: -
code/branches/network6/src/libraries/network/Host.cc
r7801 r7823 115 115 { 116 116 for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it) 117 it->incomingChat(message, CLIENTID_UNKNOWN);117 it->incomingChat(message, NETWORK_PEER_ID_BROADCAST); 118 118 return true; 119 119 } -
code/branches/network6/src/libraries/network/NetworkPrereqs.h
r7801 r7823 65 65 { 66 66 static const unsigned int GAMESTATEID_INITIAL = static_cast<unsigned int>(-1); 67 static const unsigned int CLIENTID_UNKNOWN = static_cast<unsigned int>(-2);68 67 extern const char* LAN_DISCOVERY_MESSAGE; 69 68 extern const char* LAN_DISCOVERY_ACK; 70 69 static const unsigned int LAN_DISCOVERY_PORT = 55558; 71 70 static const unsigned int NETWORK_PEER_ID_SERVER = 0; 71 static const unsigned int NETWORK_PEER_ID_BROADCAST = static_cast<unsigned int>(-1); 72 static const unsigned int NETWORK_PEER_ID_UNKNOWN = static_cast<unsigned int>(-2); 72 73 static const unsigned int NETWORK_CHANNEL_DEFAULT = 0; 73 74 static const unsigned int NETWORK_CHANNEL_UNRELIABLE = 1; -
code/branches/network6/src/libraries/network/Server.cc
r7801 r7823 57 57 #include "packet/Welcome.h" 58 58 #include "ChatListener.h" 59 #include "ClientInformation.h"59 // #include "ClientInformation.h" 60 60 #include "FunctionCallManager.h" 61 61 #include "GamestateManager.h" … … 152 152 bool Server::processChat(const std::string& message, unsigned int playerID) 153 153 { 154 ClientInformation *temp = ClientInformation::getBegin();154 // ClientInformation *temp = ClientInformation::getBegin(); 155 155 packet::Chat *chat; 156 while(temp){157 158 chat->setPeerID(temp->getID());159 if(!chat->send( static_cast<Host*>(this) ))160 COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;161 temp = temp->next();162 }156 // while(temp){ 157 chat = new packet::Chat(message, playerID); 158 chat->setPeerID(NETWORK_PEER_ID_BROADCAST); 159 chat->send( static_cast<Host*>(this) ); 160 // COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl; 161 // temp = temp->next(); 162 // } 163 163 // COUT(1) << "Player " << playerID << ": " << message << std::endl; 164 164 return true; … … 207 207 //helper_HandleMasterServerRequests(); 208 208 209 if ( ClientInformation::hasClients() )209 if ( GamestateManager::hasPeers() ) 210 210 { 211 211 // process incoming gamestates … … 237 237 unsigned int Server::getRTT(unsigned int clientID) 238 238 { 239 assert(ClientInformation::findClient(clientID)); 240 return ClientInformation::findClient(clientID)->getRTT(); 239 // assert(ClientInformation::findClient(clientID)); 240 // return ClientInformation::findClient(clientID)->getRTT(); 241 // TODO: reimplement 242 return 0; 241 243 } 242 244 243 245 void Server::printRTT() 244 246 { 245 for( ClientInformation* temp=ClientInformation::getBegin(); temp!=0; temp=temp->next() )246 COUT(0) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;247 // for( ClientInformation* temp=ClientInformation::getBegin(); temp!=0; temp=temp->next() ) 248 // COUT(0) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl; 247 249 } 248 250 … … 252 254 double Server::getPacketLoss(unsigned int clientID) 253 255 { 254 assert(ClientInformation::findClient(clientID)); 255 return ClientInformation::findClient(clientID)->getPacketLoss(); 256 // assert(ClientInformation::findClient(clientID)); 257 // return ClientInformation::findClient(clientID)->getPacketLoss(); 258 return 0.; 256 259 } 257 260 … … 261 264 void Server::updateGamestate() 262 265 { 263 if( ClientInformation::getBegin()==NULL)266 if( this->clientIDs_.size()==0 ) 264 267 //no client connected 265 268 return; … … 291 294 bool Server::sendObjectDeletes() 292 295 { 293 ClientInformation *temp = ClientInformation::getBegin();294 if( temp == NULL )296 // ClientInformation *temp = ClientInformation::getBegin(); 297 // if( temp == NULL ) 295 298 //no client connected 299 if( this->clientIDs_.size()==0 ) 296 300 return true; 297 301 packet::DeleteObjects *del = new packet::DeleteObjects(); … … 302 306 } 303 307 // COUT(3) << "sending DeleteObjects" << std::endl; 304 while(temp != NULL){305 if( !(temp->getSynched()) )306 {307 COUT(5) << "Server: not sending gamestate" << std::endl;308 temp=temp->next();309 continue;310 }311 int cid = temp->getID(); //get client id312 packet::DeleteObjects *cd = new packet::DeleteObjects(*del);313 assert(cd);314 cd->setPeerID(cid);315 if ( !cd->send( static_cast<Host*>(this) ) )316 COUT(3) << "Server: packet with client id (cid): " << cid << " not sended" << std::endl;317 temp=temp->next();308 // while(temp != NULL){ 309 // if( !(temp->getSynched()) ) 310 // { 311 // COUT(5) << "Server: not sending gamestate" << std::endl; 312 // temp=temp->next(); 313 // continue; 314 // } 315 // int cid = temp->getID(); //get client id 316 // packet::DeleteObjects *cd = new packet::DeleteObjects(*del); 317 // assert(cd); 318 del->setPeerID(NETWORK_PEER_ID_BROADCAST); 319 if ( !del->send( static_cast<Host*>(this) ) ) 320 COUT(3) << "Server: could not broadcast deleteObjects packet" << std::endl; 321 // temp=temp->next(); 318 322 // gs gets automatically deleted by enet callback 319 }320 delete del;323 // } 324 // delete del; 321 325 return true; 322 326 } 323 327 324 328 325 void Server::addPeer( ENetEvent *event)326 { 327 static unsigned int newid=1;328 329 COUT(2) << "Server: adding client" << std::endl;330 ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);331 if(!temp)332 {333 COUT(2) << "Server: could not add client" << std::endl;334 }335 temp->setID(newid);336 temp->setPeer(event->peer);329 void Server::addPeer(uint32_t peerID) 330 { 331 // static unsigned int newid=1; 332 // 333 // COUT(2) << "Server: adding client" << std::endl; 334 // ClientInformation *temp = ClientInformation::insertBack(new ClientInformation); 335 // if(!temp) 336 // { 337 // COUT(2) << "Server: could not add client" << std::endl; 338 // } 339 // temp->setID(newid); 340 // temp->setPeer(event->peer); 337 341 338 342 // inform all the listeners 339 ClientConnectionListener::broadcastClientConnected(newid); 340 GamestateManager::addPeer(newid); 341 342 ++newid; 343 344 COUT(3) << "Server: added client id: " << temp->getID() << std::endl; 345 createClient(temp->getID()); 343 this->clientIDs_.push_back(peerID); 344 ClientConnectionListener::broadcastClientConnected(peerID); 345 GamestateManager::addPeer(peerID); 346 347 // ++newid; 348 349 COUT(3) << "Server: added client id: " << peerID << std::endl; 350 createClient(peerID); 346 351 } 347 352 348 void Server::removePeer( ENetEvent *event)353 void Server::removePeer(uint32_t peerID) 349 354 { 350 355 COUT(4) << "removing client from list" << std::endl; 351 ClientInformation *client = ClientInformation::findClient(&event->peer->address); 352 if(!client) 353 return; 354 else 355 { 356 GamestateManager::removePeer(client->getID()); 356 // ClientInformation *client = ClientInformation::findClient(&event->peer->address); 357 // if(!client) 358 // return; 359 // else 360 // { 361 std::vector<uint32_t>::iterator it; 362 for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it ) 363 { 364 if( *it == peerID ) 365 { 366 this->clientIDs_.erase(it); 367 break; 368 } 369 } 370 ClientConnectionListener::broadcastClientDisconnected(peerID); 371 GamestateManager::removePeer(peerID); 357 372 //ServerConnection::disconnectClient( client ); 358 373 //ClientConnectionListener::broadcastClientDisconnected( client->getID() ); //this is done in ClientInformation now 359 delete client;360 }374 // delete client; 375 // } 361 376 } 362 377 … … 377 392 bool Server::createClient(int clientID) 378 393 { 379 ClientInformation *temp = ClientInformation::findClient(clientID);380 if(!temp)381 {382 COUT(2) << "Conn.Man. could not create client with id: " << clientID << std::endl;383 return false;384 }385 COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;394 // ClientInformation *temp = ClientInformation::findClient(clientID); 395 // if(!temp) 396 // { 397 // COUT(2) << "Server. could not create client with id: " << clientID << std::endl; 398 // return false; 399 // } 400 // COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl; 386 401 387 402 // synchronise class ids 388 syncClassid( temp->getID());403 syncClassid(clientID); 389 404 390 405 // now synchronise functionIDs … … 394 409 assert(b); 395 410 396 temp->setSynched(true);411 // temp->setSynched(true); 397 412 GamestateManager::setSynched(clientID); 398 413 399 414 COUT(4) << "sending welcome" << std::endl; 400 packet::Welcome *w = new packet::Welcome( temp->getID(), temp->getShipID());401 w->setPeerID( temp->getID());415 packet::Welcome *w = new packet::Welcome(clientID, OBJECTID_UNKNOWN); 416 w->setPeerID(clientID); 402 417 b = w->send( static_cast<Host*>(this) ); 403 418 assert(b); 404 419 packet::Gamestate *g = new packet::Gamestate(); 405 g->setPeerID( temp->getID());420 g->setPeerID(clientID); 406 421 b = g->collectData(0,packet::GAMESTATE_MODE_SERVER); 407 422 assert(b); … … 415 430 } 416 431 417 void Server::disconnectClient( ClientInformation *client)418 { 419 ServerConnection::disconnectClient( client );420 GamestateManager::removePeer( client->getID());432 void Server::disconnectClient( uint32_t clientID ) 433 { 434 ServerConnection::disconnectClient( clientID ); 435 GamestateManager::removePeer( clientID ); 421 436 // inform all the listeners 422 437 // ClientConnectionListener::broadcastClientDisconnected(client->getID()); // this is done in ClientInformation now … … 430 445 bool Server::broadcast(const std::string& message) 431 446 { 432 return this->sendChat(message, CLIENTID_UNKNOWN);447 return this->sendChat(message, NETWORK_PEER_ID_BROADCAST); 433 448 } 434 449 435 450 bool Server::sendChat(const std::string& message, unsigned int clientID) 436 451 { 437 ClientInformation *temp = ClientInformation::getBegin();452 // ClientInformation *temp = ClientInformation::getBegin(); 438 453 packet::Chat *chat; 439 while(temp)454 // while(temp) 440 455 { 441 456 chat = new packet::Chat(message, clientID); 442 chat->setPeerID( temp->getID());443 if(!chat->send( static_cast<Host*>(this) ))444 COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;445 temp = temp->next();457 chat->setPeerID(NETWORK_PEER_ID_BROADCAST); 458 chat->send( static_cast<Host*>(this) ); 459 // COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl; 460 // temp = temp->next(); 446 461 } 447 462 // COUT(1) << "Player " << Host::getPlayerID() << ": " << message << std::endl; -
code/branches/network6/src/libraries/network/Server.h
r7801 r7823 33 33 34 34 #include <deque> 35 #include <vector> 35 36 36 37 #include "util/UtilPrereqs.h" … … 80 81 unsigned int playerID(){return 0;} 81 82 82 void addPeer( ENetEvent *event);83 void removePeer( ENetEvent *event);83 void addPeer(uint32_t peerID); 84 void removePeer(uint32_t peerID); 84 85 void processPacket(packet::Packet* packet); 85 86 86 87 bool createClient(int clientID); 87 void disconnectClient( ClientInformation *client);88 void disconnectClient( uint32_t clientID ); 88 89 bool sendGameStates(); 89 90 bool sendObjectDeletes(); … … 95 96 float timeSinceLastUpdate_; 96 97 std::deque<packet::Packet*> packetQueue_; 98 std::vector<uint32_t> clientIDs_; 97 99 }; 98 100 -
code/branches/network6/src/libraries/network/ServerConnection.cc
r7801 r7823 35 35 36 36 #include "util/Debug.h" 37 #include "ClientInformation.h"37 // #include "ClientInformation.h" 38 38 39 39 namespace orxonox … … 104 104 void ServerConnection::addPacket(ENetPacket *packet, unsigned int clientID, uint8_t channelID) 105 105 { 106 if ( clientID == CLIENTID_UNKNOWN)106 if ( clientID == NETWORK_PEER_ID_BROADCAST ) 107 107 { 108 108 broadcastPacket(packet, channelID); … … 110 110 else 111 111 { 112 ClientInformation *temp = ClientInformation::findClient(clientID);113 if(!temp){114 COUT(3) << "C.Man: addPacket findClient failed" << std::endl;115 }116 Connection::addPacket(packet, temp->getPeer(), channelID);112 // ClientInformation *temp = ClientInformation::findClient(clientID); 113 // if(!temp){ 114 // COUT(3) << "C.Man: addPacket findClient failed" << std::endl; 115 // } 116 Connection::addPacket(packet, clientID, channelID); 117 117 } 118 118 } 119 119 120 void ServerConnection::disconnectClient(ClientInformation *client)121 {122 Connection::disconnectPeer( client->getPeer() );123 }120 // void ServerConnection::disconnectClient(ClientInformation *client) 121 // { 122 // Connection::disconnectPeer( client->getPeer() ); 123 // } 124 124 125 125 void ServerConnection::disconnectClient(int clientID) 126 126 { 127 ClientInformation *client = ClientInformation::findClient(clientID);128 if(client)129 ServerConnection::disconnectClient(client);127 // ClientInformation *client = ClientInformation::findClient(clientID); 128 // if(client) 129 ServerConnection::disconnectClient(clientID); 130 130 } 131 131 132 132 void ServerConnection::disconnectClients() 133 133 { 134 ClientInformation *temp = ClientInformation::getBegin(); 135 while(temp!=0) 136 { 137 ServerConnection::disconnectClient( temp ); 138 temp = temp->next(); 139 } 134 Connection::disconnectPeers(); 135 // ClientInformation *temp = ClientInformation::getBegin(); 136 // while(temp!=0) 137 // { 138 // ServerConnection::disconnectClient( temp ); 139 // temp = temp->next(); 140 // } 140 141 return; 141 142 } 142 143 143 144 144 int ServerConnection::getClientID(ENetPeer* peer)145 {146 return getClientID(&(peer->address));147 }145 // int ServerConnection::getClientID(ENetPeer* peer) 146 // { 147 // return getClientID(&(peer->address)); 148 // } 148 149 149 int ServerConnection::getClientID(ENetAddress* address)150 {151 return ClientInformation::findClient(address)->getID();152 }153 154 ENetPeer *ServerConnection::getClientPeer(int clientID)155 {156 return ClientInformation::findClient(clientID)->getPeer();157 }150 // int ServerConnection::getClientID(ENetAddress* address) 151 // { 152 // return ClientInformation::findClient(address)->getID(); 153 // } 154 // 155 // ENetPeer *ServerConnection::getClientPeer(int clientID) 156 // { 157 // return ClientInformation::findClient(clientID)->getPeer(); 158 // } 158 159 159 160 -
code/branches/network6/src/libraries/network/ServerConnection.h
r7801 r7823 57 57 bool closeListener(); 58 58 void addPacket(ENetPacket *packet, unsigned int ID, uint8_t channelID); 59 virtual void disconnectClient(ClientInformation *client);59 // virtual void disconnectClient(ClientInformation *client); 60 60 void disconnectClient(int clientID); 61 61 protected: … … 64 64 65 65 private: 66 int getClientID(ENetPeer* peer);67 int getClientID(ENetAddress* address);68 ENetPeer* getClientPeer(int clientID);66 // int getClientID(ENetPeer* peer); 67 // int getClientID(ENetAddress* address); 68 // ENetPeer* getClientPeer(int clientID); 69 69 70 70 ENetAddress* bindAddress_; -
code/branches/network6/src/libraries/network/packet/Packet.cc
r7801 r7823 47 47 #include "Welcome.h" 48 48 #include "network/Host.h" 49 #include "network/ClientInformation.h"49 // #include "network/ClientInformation.h" 50 50 51 51 namespace orxonox{ … … 85 85 86 86 87 Packet::Packet(const Packet &p){ 87 Packet::Packet(const Packet &p) 88 { 88 89 enetPacket_=p.enetPacket_; 89 90 flags_=p.flags_; … … 104 105 That also means destroying the ENetPacket if one exists. There 105 106 */ 106 Packet::~Packet(){ 107 Packet::~Packet() 108 { 107 109 // Deallocate data_ memory if necessary. 108 if (this->bDataENetAllocated_){ 110 if (this->bDataENetAllocated_) 111 { 109 112 // In this case ENet allocated data_ and will destroy it. 110 113 } 111 else if (this->data_) { 114 else if (this->data_) 115 { 112 116 // This destructor was probably called as a consequence of ENet executing our callback. 113 117 // It simply serves us to be able to deallocate the packet content (data_) ourselves since … … 119 123 // Note: For the case ENet used the callback to destroy the packet, we have already set 120 124 // enetPacket_ to NULL to avoid destroying it again. 121 if (this->enetPacket_){ 125 if (this->enetPacket_) 126 { 122 127 // enetPacket_->data gets destroyed too by ENet if it was allocated by it. 123 128 enet_packet_destroy(enetPacket_); … … 125 130 } 126 131 127 bool Packet::send(orxonox::Host* host){ 128 if(packetDirection_ != Direction::Outgoing && packetDirection_ != Direction::Bidirectional ){ 132 bool Packet::send(orxonox::Host* host) 133 { 134 if(packetDirection_ != Direction::Outgoing && packetDirection_ != Direction::Bidirectional ) 135 { 129 136 assert(0); 130 137 return false; 131 138 } 132 if(!enetPacket_){ 139 if(!enetPacket_) 140 { 133 141 if(!data_){ 134 142 assert(0); … … 175 183 } 176 184 177 Packet *Packet::createPacket(ENetPacket *packet, ENetPeer *peer){ 185 Packet *Packet::createPacket(ENetPacket* packet, uint32_t peerID) 186 { 178 187 uint8_t *data = packet->data; 179 assert(ClientInformation::findClient(&peer->address)->getID() != static_cast<unsigned int>(-2) || !Host::isServer());180 unsigned int peerID = ClientInformation::findClient(&peer->address)->getID();188 // assert(ClientInformation::findClient(&peer->address)->getID() != static_cast<unsigned int>(-2) || !Host::isServer()); 189 // unsigned int peerID = ClientInformation::findClient(&peer->address)->getID(); 181 190 // HACK 182 if( peerID==static_cast<unsigned int>(-2))183 peerID = NETWORK_PEER_ID_SERVER;191 // if( peerID==static_cast<unsigned int>(-2)) 192 // peerID = NETWORK_PEER_ID_SERVER; 184 193 Packet *p = 0; 185 194 // COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl; … … 235 244 data we allocated ourselves. 236 245 */ 237 void Packet::deletePacket(ENetPacket *enetPacket){ 246 void Packet::deletePacket(ENetPacket *enetPacket) 247 { 238 248 // Get our Packet from a global map with all Packets created in the send() method of Packet. 239 249 Packet::packetMapMutex_.lock(); -
code/branches/network6/src/libraries/network/packet/Packet.h
r7801 r7823 32 32 #include <map> 33 33 34 namespace orxonox { 34 namespace orxonox 35 { 35 36 36 namespace packet{ 37 namespace packet 38 { 37 39 38 namespace Direction{ 39 enum Value{ 40 namespace Direction 41 { 42 enum Value 43 { 40 44 Incoming, 41 45 Outgoing, … … 43 47 }; 44 48 } 45 namespace Type{ 46 enum Value{ 49 namespace Type 50 { 51 enum Value 52 { 47 53 Acknowledgement, 48 54 Chat, … … 59 65 @author Oliver Scheuss <scheusso [at] ee.ethz.ch> 60 66 */ 61 class _NetworkExport Packet{ 67 class _NetworkExport Packet 68 { 62 69 public: 63 70 Packet(const Packet &p); 64 71 virtual ~Packet(); 65 static Packet *createPacket(ENetPacket *packet, ENetPeer *peer);66 static void deletePacket(ENetPacket *packet);72 static Packet* createPacket(ENetPacket* packet, uint32_t peerID); 73 static void deletePacket(ENetPacket* packet); 67 74 68 virtual unsigned char *getData(){ return data_; };75 virtual unsigned char* getData(){ return data_; }; 69 76 virtual unsigned int getSize() const =0; 70 77 virtual bool process(orxonox::Host* host)=0; -
code/branches/network6/src/modules/overlays/hud/ChatOverlay.cc
r7284 r7823 71 71 std::string text; 72 72 73 if (senderID != CLIENTID_UNKNOWN)73 if (senderID != NETWORK_PEER_ID_UNKNOWN) 74 74 { 75 75 std::string name = "unknown"; -
code/branches/network6/src/orxonox/ChatHistory.cc
r7284 r7823 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/branches/network6/src/orxonox/ChatInputHandler.cc
r7284 r7823 207 207 208 208 /* setup player name info */ 209 if (senderID != CLIENTID_UNKNOWN)209 if (senderID != NETWORK_PEER_ID_UNKNOWN) 210 210 { 211 211 PlayerInfo* player = PlayerManager::getInstance().getClient(senderID); -
code/branches/network6/src/orxonox/PlayerManager.cc
r7474 r7823 45 45 RegisterRootObject(PlayerManager); 46 46 47 this->getConnectedClients();47 // this->getConnectedClients(); 48 48 } 49 49 -
code/branches/network6/src/orxonox/gamestates/GSRoot.cc
r7284 r7823 160 160 { 161 161 if (!GameMode::isStandalone()) 162 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new);162 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, NETWORK_PEER_ID_BROADCAST, factor_new); 163 163 } 164 164 } -
code/branches/network6/src/orxonox/gametypes/Dynamicmatch.cc
r7284 r7823 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/branches/network6/src/orxonox/gametypes/Gametype.cc
r7801 r7823 262 262 it->second.frags_++; 263 263 264 if (killer->getPlayer()->getClientID() != CLIENTID_UNKNOWN)264 if (killer->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN) 265 265 this->gtinfo_->sendKillMessage("You killed " + victim->getPlayer()->getName(), killer->getPlayer()->getClientID()); 266 if (victim->getPlayer()->getClientID() != CLIENTID_UNKNOWN)266 if (victim->getPlayer()->getClientID() != NETWORK_PEER_ID_UNKNOWN) 267 267 this->gtinfo_->sendDeathMessage("You were killed by " + killer->getPlayer()->getName(), victim->getPlayer()->getClientID()); 268 268 } -
code/branches/network6/src/orxonox/gametypes/LastManStanding.cc
r7655 r7823 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+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/branches/network6/src/orxonox/gametypes/TeamBaseMatch.cc
r7284 r7823 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/branches/network6/src/orxonox/gametypes/UnderAttack.cc
r6417 r7823 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/branches/network6/src/orxonox/infos/GametypeInfo.cc
r7163 r7823 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/branches/network6/src/orxonox/infos/HumanPlayer.cc
r6417 r7823 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/branches/network6/src/orxonox/infos/PlayerInfo.cc
r7163 r7823 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.