Changeset 7657 for code/branches/masterserver/src/libraries/network
- Timestamp:
- Nov 24, 2010, 2:07:53 PM (14 years ago)
- Location:
- code/branches/masterserver/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/MasterServerProtocol.h
r7650 r7657 37 37 38 38 #define MSPROTO_REQ_LIST "REQ:LIST" 39 #define MSPROTO_REQ_LIST_LEN 8 39 40 40 41 -
code/branches/masterserver/src/libraries/network/WANDiscovery.cc
r7651 r7657 62 62 63 63 /* callback for the network reply poller */ 64 /* WORK MARK WORK WORK */ 65 /* NOTE implement protocol-specific part here. */ 66 int WANDiscovery::rhandler( char *addr, ENetEvent *ev ) 64 int rhandler( char *addr, ENetEvent *ev ) 67 65 { 66 /* error recognition */ 67 if( !ev || !ev->packet || !ev->packet->data ) 68 { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n"; 69 return 0; 70 } 71 68 72 /* handle incoming data */ 69 73 /* if a list entry arrives add to list */ … … 81 85 82 86 /* add to list */ 83 this->servers_.push_back( toadd );87 WANDiscovery::getInstance().servers_.push_back( toadd ); 84 88 } 85 89 else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END, … … 97 101 98 102 /* send request to server */ 99 msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST );103 this->msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST ); 100 104 101 105 /* deal with replies */ 102 while( ! msc.pollForReply( WANDiscovery::rhandler ) )106 while( !(this->msc).pollForReply( rhandler ) ) 103 107 /* nothing */; 104 108 -
code/branches/masterserver/src/libraries/network/WANDiscovery.h
r7651 r7657 78 78 static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export 79 79 80 int rhandler( char *addr, ENetEvent *ev ); 80 /** game server list */ 81 std::vector<packet::ServerInformation> servers_; 81 82 82 83 private: … … 87 88 MasterServerComm msc; 88 89 89 /** game server list */90 std::vector<packet::ServerInformation> servers_;91 92 90 }; // tolua_export 93 91
Note: See TracChangeset
for help on using the changeset viewer.