Changeset 7672
- Timestamp:
- Nov 24, 2010, 11:12:30 PM (14 years ago)
- Location:
- code/branches/masterserver/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/MasterServerComm.cc
r7668 r7672 109 109 COUT(2) << "MARK polling...\n"; 110 110 111 if( enet_host_service( this->client, &this->event, 1000 ) >= 0 ) 111 /* enet_host_service returns 0 if no event occured */ 112 /* just newly set below test to >0 from >= 0, to be tested */ 113 if( enet_host_service( this->client, &this->event, 1000 ) > 0 ) 112 114 { 113 115 /* address buffer */ -
code/branches/masterserver/src/libraries/network/WANDiscovery.cc
r7667 r7672 43 43 WANDiscovery::WANDiscovery() 44 44 { 45 COUT(0) << "WANDiscovery created.\n"; 46 /* create master server communications object */ 47 //this->msc = MasterServerComm(); 45 COUT(4) << "Creating WANDiscovery.\n"; 48 46 49 47 /* initialize it and see if it worked */ 50 48 if( msc.initialize() ) 51 COUT( 0) << "Error: could not initialize master server communications!\n";49 COUT(2) << "Error: could not initialize master server communications!\n"; 52 50 53 51 /* connect and see if it worked */ 54 52 if( msc.connect( MS_ADDRESS, 1234 ) ) 55 COUT( 0) << "Error: could not connect to master server!\n";53 COUT(2) << "Error: could not connect to master server!\n"; 56 54 57 COUT( 0) << "Initialization of WANDiscovery complete.\n";55 COUT(4) << "Initialization of WANDiscovery complete.\n"; 58 56 } 59 57 … … 92 90 else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END, 93 91 MSPROTO_SERVERLIST_END_LEN ) ) 94 { return 1; } 92 { 93 /* this is the only case where 1 should be returned, 94 * as 1 is used to signal that we're done receiving 95 * the list 96 */ 97 return 1; 98 } 95 99 96 100 /* done handling, return all ok code 0 */ … … 106 110 this->msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST ); 107 111 108 /* deal with replies */ 112 /* poll for replies */ 113 /* TODO add some timeout here so we don't wait indefinitely */ 109 114 while( !((this->msc).pollForReply( rhandler )) ) 110 115 /* nothing */; -
code/branches/masterserver/src/libraries/network/WANDiscovery.h
r7657 r7672 78 78 static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export 79 79 80 /* todo: might make this private and use getter/setter methods 81 * at some later time. 82 */ 80 83 /** game server list */ 81 84 std::vector<packet::ServerInformation> servers_;
Note: See TracChangeset
for help on using the changeset viewer.