Changeset 1378 for code/branches/network
- Timestamp:
- May 22, 2008, 4:24:32 PM (17 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/ClientInformation.cc
r1360 r1378 85 85 ClientInformation::~ClientInformation() { 86 86 boost::recursive_mutex::scoped_lock lock(mutex_); 87 if( preve!=0)88 prev e->setNext(this->nexte);89 if(next e!=0)90 next e->setPrev(this->preve);87 if(next()!=0) 88 prev()->setNext(this->next()); 89 if(next()!=0) 90 next()->setPrev(this->prev()); 91 91 } 92 92 … … 123 123 ClientInformation *ClientInformation::insertAfter(ClientInformation *ins) { 124 124 boost::recursive_mutex::scoped_lock lock(mutex_); 125 this->next e->setPrev(ins);126 ins->setNext(this->next e);125 this->next()->setPrev(ins); 126 ins->setNext(this->next()); 127 127 ins->setPrev(this); 128 128 this->nexte = ins; … … 135 135 return NULL; 136 136 this->prev()->setNext(ins); 137 ins->setPrev(this->prev e);137 ins->setPrev(this->prev()); 138 138 this->preve=ins; 139 139 ins->setNext(this); … … 142 142 143 143 void ClientInformation::setID(int clientID){ 144 if(!this) 145 return; 144 146 boost::recursive_mutex::scoped_lock lock(mutex_); 145 147 clientID_ = clientID; -
code/branches/network/src/network/ConnectionManager.cc
r1360 r1378 151 151 } 152 152 153 bool ConnectionManager::sendPackets(ENetEvent *event) {153 /*bool ConnectionManager::sendPackets(ENetEvent *event) { 154 154 if(server==NULL) 155 155 return false; … … 158 158 else 159 159 return false; 160 } 160 }*/ 161 161 162 162 bool ConnectionManager::sendPackets() { 163 ENetEvent event;164 163 if(server==NULL) 165 164 return false; 166 if(enet_host_service(server, &event, NETWORK_SEND_WAIT)>=0) 167 return true; 168 else 169 return false; 165 enet_host_flush(server); 166 return true; 170 167 } 171 168 … … 208 205 break; 209 206 case ENET_EVENT_TYPE_NONE: 210 receiverThread_->yield();207 //receiverThread_->yield(); 211 208 break; 212 209 } 213 210 // usleep(100); 214 receiverThread_->yield(); //TODO: find apropriate211 //receiverThread_->yield(); //TODO: find apropriate 215 212 } 216 213 disconnectClients(); -
code/branches/network/src/network/ConnectionManager.h
r1293 r1378 84 84 bool addPacket(ENetPacket *packet, int ID); 85 85 bool addPacketAll(ENetPacket *packet); 86 bool sendPackets(ENetEvent *event);86 // bool sendPackets(ENetEvent *event); 87 87 bool sendPackets(); 88 88 bool createClient(int clientID);
Note: See TracChangeset
for help on using the changeset viewer.