- Timestamp:
- Jul 14, 2006, 12:19:31 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9289 r9290 99 99 this->localNode->addClient(pInfo); 100 100 else if( pInfo->isProxyServer()) 101 { 101 102 this->localNode->addProxyServer(pInfo); 103 // create a new node, since a proxy can connect clients again 104 NetworkNode* node = new NetworkNode(pInfo); 105 this->nodeList.push_back(node); 106 } 102 107 else if( pInfo->isMasterServer()) 108 { 103 109 this->localNode->addMasterServer(pInfo); 110 } 104 111 } 105 112 -
branches/proxy/src/lib/network/monitor/network_monitor.h
r9287 r9290 52 52 inline int getPlayerNumber() { return this->playerNumber; } 53 53 54 /** @returns true if there are still free network slots available */ 55 inline bool gotFreeSlots() { return (this->playerNumber < NET_MAX_CONNECTIONS)?true:false; } 56 void getServerWithFreeSlots() { } 57 54 58 55 59 void showGUI(); -
branches/proxy/src/lib/network/netdefs.h
r9263 r9290 34 34 35 35 /* maximal connectinons for the server*/ 36 #define MAX_CONNECTIONS 100036 #define NET_MAX_CONNECTIONS 5 37 37 38 38 /* network polling frequency */ -
branches/proxy/src/lib/network/network_stream.cc
r9287 r9290 337 337 338 338 // check if there are too many clients connected 339 if ( clientId > MAX_CONNECTIONS )339 if ( clientId > NET_MAX_CONNECTIONS ) 340 340 { 341 341 peers[clientId].handshake->doReject( "too many connections" ); … … 420 420 (*it)->getUniqueID(), (*it)->beSynchronized()); 421 421 } 422 PRINT(0)(" Maximal Connections: %i\n", MAX_CONNECTIONS );422 PRINT(0)(" Maximal Connections: %i\n", NET_MAX_CONNECTIONS ); 423 423 424 424 } … … 568 568 569 569 // server fakes uniqueid == 0 for handshake 570 if ( this->isMasterServer() && sync.getUniqueID() < MAX_CONNECTIONS - 1 )570 if ( this->isMasterServer() && sync.getUniqueID() < NET_MAX_CONNECTIONS - 1 ) 571 571 n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset ); 572 572 else -
branches/proxy/src/lib/network/network_stream.h
r9285 r9290 52 52 inline bool isClient() const { return (this->pInfo->nodeType == NET_CLIENT)? true:false; } 53 53 // inline bool isActive() const { return this->bActive; } 54 inline int getMaxConnections(){ return MAX_CONNECTIONS; }54 inline int getMaxConnections(){ return NET_MAX_CONNECTIONS; } 55 55 56 56 /* functions for the peerInfo information retreival */ -
branches/proxy/src/lib/network/peer_info.h
r9286 r9290 32 32 int userId; 33 33 int nodeType; 34 IPaddress ip; 35 34 36 NetworkSocket * socket; 35 37 Handshake * handshake; 36 38 ConnectionMonitor * connectionMonitor; 39 37 40 int lastAckedState; 38 41 int lastRecvedState; -
branches/proxy/src/lib/network/shared_network_data.cc
r9257 r9290 35 35 this->hostID = -1; 36 36 this->defaultSyncStream = NULL; 37 this->newUniqueID = MAX_CONNECTIONS + 2;37 this->newUniqueID = NET_MAX_CONNECTIONS + 2; 38 38 this->nodeType = NET_CLIENT; 39 39 } -
branches/proxy/src/lib/network/udp_socket.h
r8802 r9290 31 31 32 32 virtual void connectToServer( std::string host, int port ); 33 33 34 34 virtual void disconnectServer(); 35 35 … … 37 37 38 38 virtual int readPacket(byte * data, int maxLength); 39 39 40 IPaddress getAddress() { return this->ip; } 41 42 40 43 private: 41 44 UdpServerSocket * serverSocket; //!< will get packets here … … 44 47 UDPsocket socket; //!< socket used to send/recieve 45 48 UDPpacket * packet; 46 49 47 50 byte randomByte; //!< contains random bytes & 0xFC 48 51 49 52 bool writeRawPacket( byte * data, int length ); 50 53 bool checkUdpCmd( byte udpCmd ); 51 54 bool checkRandomByte( byte rndByte ); 52 55 byte generateNewRandomByte(); 53 56 54 57 void init(); 55 58
Note: See TracChangeset
for help on using the changeset viewer.