Changeset 9473 in orxonox.OLD for branches/proxy
- Timestamp:
- Jul 25, 2006, 10:57:27 PM (19 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/handshake.cc
r9406 r9473 76 76 remoteState.orxId = 0; 77 77 remoteState.version = 0; 78 remoteState.nodeType = NET_ CLIENT;78 remoteState.nodeType = NET_UNASSIGNED; 79 79 remoteState.canDel = 0; 80 80 -
branches/proxy/src/lib/network/netdefs.h
r9458 r9473 47 47 //!< enum indicating the type of the node 48 48 typedef enum { 49 NET_MASTER_SERVER, 49 NET_UNASSIGNED = -1, 50 51 NET_MASTER_SERVER = 0, 50 52 NET_PROXY_SERVER_ACTIVE, 51 53 NET_PROXY_SERVER_PASSIVE, -
branches/proxy/src/lib/network/network_stream.cc
r9472 r9473 65 65 this->init(); 66 66 /* initialize the references */ 67 this->pInfo->nodeType = NET_ CLIENT;67 this->pInfo->nodeType = NET_UNASSIGNED; 68 68 } 69 69 … … 552 552 if ( it->second.handshake->ok() ) 553 553 { 554 // write the first informations into the node so they can be read from there for case differentiation 555 it->second.nodeType = it->second.handshake->getRemoteNodeType(); 556 it->second.ip = it->second.socket->getRemoteAddress(); 557 554 558 // the counter part didn't mark it free for deletion yet 555 559 if ( !it->second.handshake->allowDel() ) 556 560 { 557 // make sure this is a client 558 if( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive()) 561 // make sure this is a connection: 562 // - client <==> master server 563 // - proxy server <==> master server 564 if( SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isMasterServer()) 559 565 { 560 566 SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() ); 561 567 this->pInfo->userId = SharedNetworkData::getInstance()->getHostID(); 562 568 563 it->second.nodeType = it->second.handshake->getRemoteNodeType();564 it->second.ip = it->second.socket->getRemoteAddress();569 // it->second.nodeType = it->second.handshake->getRemoteNodeType(); 570 // it->second.ip = it->second.socket->getRemoteAddress(); 565 571 // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER) 566 572 this->networkMonitor->addNode(&it->second); … … 595 601 if ( SharedNetworkData::getInstance()->isMasterServer() ) 596 602 { 597 it->second.nodeType = it->second.handshake->getRemoteNodeType();598 it->second.ip = it->second.socket->getRemoteAddress();599 600 603 this->networkMonitor->addNode(&it->second); 601 604 … … 753 756 754 757 // if we are a server (both master and proxy servers) and this is not our handshake 755 if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/ ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId ) 758 if ( ( SharedNetworkData::getInstance()->isMasterServer() || 759 SharedNetworkData::getInstance()->isProxyServerActive() && peer->second.isClient()) 760 && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId ) 756 761 continue; 757 762 … … 767 772 768 773 // server fakes uniqueid == 0 for handshake 769 if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive() */) && 774 if ( ( SharedNetworkData::getInstance()->isMasterServer() || 775 SharedNetworkData::getInstance()->isProxyServerActive() && peer->second.isClient() ) && 770 776 sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it 771 777 n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
Note: See TracChangeset
for help on using the changeset viewer.