Changeset 9538 in orxonox.OLD
- Timestamp:
- Jul 27, 2006, 11:46:50 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.h
r9524 r9538 36 36 MSGID_RESPAWN, //!< respawn message 37 37 38 MSGID_ FORWARDMESSAGE //!< forwarding a messag between proxy and master server38 MSGID_PROXY_NEWCLIENT //!< informs the master server about a new client 39 39 }; 40 40 -
branches/proxy/src/lib/network/network_manager.cc
r9494 r9538 31 31 #include "network_log.h" 32 32 #include "network_game_manager.h" 33 #include "proxy/proxy_control.h" 33 34 34 35 … … 116 117 this->networkStream->createNetworkGameManager(); 117 118 119 // init the proxy control center 120 ProxyControl::getInstance(); 121 118 122 PRINTF(0)("Created Network Master Server\n"); 119 123 SDL_Delay(20); … … 140 144 this->networkStream->createServer( port, port +1); 141 145 142 143 146 // and to the other proxy servers also, this would be very nice if its works 144 145 146 // start the network game manager 147 //this->networkStream->createNetworkGameManager(); 148 147 /* put it here....*/ 148 149 // init the proxy control center 150 ProxyControl::getInstance(); 149 151 150 152 PRINTF(0)("Created Network Proxy Server\n"); -
branches/proxy/src/lib/network/network_stream.cc
r9537 r9538 11 11 ### File Specific: 12 12 main-programmer: Christoph Renner rennerc@ee.ethz.ch 13 co-programmer: Patrick Boenzli boenzlip@orxonox.ethz.ch13 co-programmer: Patrick Boenzli patrick@orxonox.ethz.ch 14 14 15 15 June 2006: finishing work on the network stream for pps presentation (rennerc@ee.ethz.ch) 16 July 2006: some code rearangement and integration of the proxy server mechanism ( boenzlip@ee.ethz.ch)16 July 2006: some code rearangement and integration of the proxy server mechanism (patrick@orxonox.ethz.ch) 17 17 */ 18 18 … … 20 20 #define DEBUG_MODULE_NETWORK 21 21 22 #include "proxy/proxy_control.h" 22 23 23 24 #include "base_object.h" … … 646 647 647 648 // work with the ProxyControl to init the new client 649 ProxyControl::getInstance()->signalNewClient(it->second.userId); 648 650 649 651 -
branches/proxy/src/lib/network/proxy/proxy_control.cc
r9537 r9538 41 41 this->setClassID( CL_PROXY_CONTROL, "ProxyControl" ); 42 42 43 // MessageManager::getInstance()->registerMessageHandler( MSGID_CHANGENICKNAME, changeNickHandler, NULL );43 MessageManager::getInstance()->registerMessageHandler( MSGID_PROXY_NEWCLIENT, messageHandlerNewClient, NULL ); 44 44 45 45 PRINTF(0)("ProxyControl created\n"); … … 71 71 } 72 72 73 74 /** 75 * signals new client connected to this local proxy 76 * @param userId userId of the new client 77 */ 78 void ProxyControl::signalNewClient(int userId) 79 { 80 // make sure we are a proxy server 81 assert(SharedNetworkData::getInstance()->isProxyServerActive()); 82 83 84 } 85 86 87 /** 88 * this is the handler for proxy signals: new clients 89 * 90 * @param messageType the type of the message 91 * @param data message data 92 * @param dataLength length of the message data 93 * @param someData some other atteched data 94 * @param senderId id of the sender client 95 * @param destinationId id of the destination client 96 * @return true if succeeded 97 */ 98 bool ProxyControl::messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId ) 99 { 100 // part for the master server 101 if( SharedNetworkData::getInstance()->isMasterServer()) 102 { 103 104 } 105 else if(SharedNetworkData::getInstance()->isProxyServerActive()) 106 { 107 108 } 109 110 return true; 111 } -
branches/proxy/src/lib/network/proxy/proxy_control.h
r9537 r9538 16 16 17 17 18 18 19 //! A class for storing player information 19 20 class ProxyControl : public Synchronizeable … … 26 27 27 28 virtual void varChangeHandler( std::list<int> & id ); 29 30 void signalNewClient(int userId); 31 static bool messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId ); 28 32 29 33
Note: See TracChangeset
for help on using the changeset viewer.