Changeset 7898 for code/branches/network6/src
- Timestamp:
- Feb 15, 2011, 11:37:15 AM (14 years ago)
- Location:
- code/branches/network6/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network6/src/libraries/network/Connection.cc
r7881 r7898 42 42 namespace orxonox 43 43 { 44 const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(20 );44 const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(200); 45 45 const unsigned int NETWORK_DISCONNECT_TIMEOUT = 500; 46 46 … … 52 52 this->incomingEventsMutex_ = new boost::mutex; 53 53 this->outgoingEventsMutex_ = new boost::mutex; 54 this->overallMutex_ = new boost::mutex;54 // this->overallMutex_ = new boost::mutex; 55 55 } 56 56 … … 80 80 void Connection::disconnectPeer(uint32_t peerID) 81 81 { 82 this->overallMutex_->lock();82 // this->overallMutex_->lock(); 83 83 outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, 0, 0 }; 84 84 … … 86 86 this->outgoingEvents_.push_back(outEvent); 87 87 this->outgoingEventsMutex_->unlock(); 88 this->overallMutex_->unlock();88 // this->overallMutex_->unlock(); 89 89 } 90 90 … … 100 100 void Connection::addPacket(ENetPacket* packet, uint32_t peerID, uint8_t channelID) 101 101 { 102 this->overallMutex_->lock();102 // this->overallMutex_->lock(); 103 103 outgoingEvent outEvent = { peerID, outgoingEventType::sendPacket, packet, channelID }; 104 104 … … 106 106 this->outgoingEvents_.push_back(outEvent); 107 107 this->outgoingEventsMutex_->unlock(); 108 this->overallMutex_->unlock();108 // this->overallMutex_->unlock(); 109 109 } 110 110 111 111 void Connection::broadcastPacket(ENetPacket* packet, uint8_t channelID) 112 112 { 113 this->overallMutex_->lock();113 // this->overallMutex_->lock(); 114 114 outgoingEvent outEvent = { 0, outgoingEventType::broadcastPacket, packet, channelID }; 115 115 … … 117 117 this->outgoingEvents_.push_back(outEvent); 118 118 this->outgoingEventsMutex_->unlock(); 119 this->overallMutex_->unlock();119 // this->overallMutex_->unlock(); 120 120 } 121 121 … … 125 125 ENetEvent event; 126 126 127 this->overallMutex_->lock();127 // this->overallMutex_->lock(); 128 128 while( bCommunicationThreadRunning_ ) 129 129 { … … 134 134 } 135 135 136 this->overallMutex_->unlock();136 // this->overallMutex_->unlock(); 137 137 msleep(10); 138 this->overallMutex_->lock();138 // this->overallMutex_->lock(); 139 139 140 140 // Send all waiting outgoing packets … … 163 163 } 164 164 } 165 this->overallMutex_->unlock();165 // this->overallMutex_->unlock(); 166 166 } 167 167 -
code/branches/network6/src/libraries/network/ServerConnection.cc
r7878 r7898 45 45 { 46 46 this->bindAddress_ = new ENetAddress(); 47 memset(this->bindAddress_, 0, sizeof(ENetAddress));47 // memset(this->bindAddress_, 0, sizeof(ENetAddress)); 48 48 this->bindAddress_->host = ENET_HOST_ANY; 49 49 this->bindAddress_->port = NETWORK_PORT; 50 this->bindAddress_->scopeID = 0; 50 51 } 51 52 -
code/branches/network6/src/libraries/network/packet/Gamestate.cc
r7825 r7898 158 158 //start write gamestate header 159 159 header_.setDataSize( currentsize ); 160 header_.setCompSize( 0 ); 160 161 header_.setID( id ); 161 162 header_.setBaseID( GAMESTATEID_INITIAL );
Note: See TracChangeset
for help on using the changeset viewer.