- Timestamp:
- Dec 17, 2010, 11:09:14 AM (14 years ago)
- Location:
- code/branches/network5/src/libraries/network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network5/src/libraries/network/ClientConnection.cc
r7772 r7773 39 39 const unsigned int NETWORK_CLIENT_CONNECTION_TIMEOUT = 3000; //millisecs 40 40 const unsigned int NETWORK_CLIENT_MAX_CONNECTIONS = 1; 41 const unsigned int NETWORK_CLIENT_CHANNELS = 1;42 41 43 42 … … 71 70 ENetEvent event; 72 71 73 this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0, 0);72 this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 74 73 if ( this->host_ == NULL ) 75 74 { … … 86 85 COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl; 87 86 88 this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_C LIENT_CHANNELS, 0);87 this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0); 89 88 if ( this->server_==NULL ) 90 89 { … … 155 154 COUT(1) << "Received disconnect Packet from Server!" << endl; 156 155 // server closed the connection 156 this->stopCommunicationThread(); 157 157 this->connectionClosed(); 158 158 } -
code/branches/network5/src/libraries/network/GamestateManager.cc
r7759 r7773 216 216 217 217 218 bool b = gs->compressData();219 assert(b);218 // bool b = gs->compressData(); 219 // assert(b); 220 220 clock.capture(); 221 221 COUT(4) << "diff and compress time: " << clock.getDeltaTime() << endl; -
code/branches/network5/src/libraries/network/NetworkPrereqs.h
r7772 r7773 68 68 extern const char* LAN_DISCOVERY_MESSAGE; 69 69 extern const char* LAN_DISCOVERY_ACK; 70 static const unsigned int LAN_DISCOVERY_PORT = 55557; 71 static const unsigned int NETWORK_PEER_ID_SERVER = 0; 72 static const unsigned int NETWORK_CHANNEL_DEFAULT = 0; 73 static const unsigned int NETWORK_CHANNEL_RELIABLE = 1; 70 static const unsigned int LAN_DISCOVERY_PORT = 55557; 71 static const unsigned int NETWORK_PEER_ID_SERVER = 0; 72 static const unsigned int NETWORK_CHANNEL_DEFAULT = 0; 73 static const unsigned int NETWORK_CHANNEL_UNRELIABLE = 1; 74 static const unsigned int NETWORK_CHANNEL_COUNT = 2; 74 75 } 75 76 -
code/branches/network5/src/libraries/network/Server.cc
r7772 r7773 425 425 if(!b) 426 426 return false; //no data for the client 427 b = g->compressData();428 assert(b);427 // b = g->compressData(); 428 // assert(b); 429 429 b = g->send(); 430 430 assert(b); -
code/branches/network5/src/libraries/network/ServerConnection.cc
r7772 r7773 68 68 bool ServerConnection::openListener() 69 69 { 70 this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, 0, 0, 0);70 this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 71 71 if ( this->host_ == NULL ) 72 72 { … … 91 91 this->bListening_=false; 92 92 disconnectClients(); 93 Connection::stopCommunicationThread(); 93 94 enet_host_destroy(this->host_); 94 95 return true; -
code/branches/network5/src/libraries/network/packet/Packet.cc
r7772 r7773 169 169 // enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet 170 170 if( this->flags_ & PacketFlag::Reliable ) 171 Host::addPacket( enetPacket_, clientID_, 0);171 Host::addPacket( enetPacket_, clientID_, NETWORK_CHANNEL_DEFAULT); 172 172 else 173 Host::addPacket( enetPacket_, clientID_, 0);173 Host::addPacket( enetPacket_, clientID_, NETWORK_CHANNEL_UNRELIABLE); 174 174 return true; 175 175 }
Note: See TracChangeset
for help on using the changeset viewer.