Changeset 7651 for code/branches/masterserver/src/libraries/network
- Timestamp:
- Nov 17, 2010, 4:18:14 PM (14 years ago)
- Location:
- code/branches/masterserver/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/WANDiscovery.cc
r7650 r7651 62 62 63 63 /* callback for the network reply poller */ 64 /* WORK MARK WORK WORK */ 64 65 /* NOTE implement protocol-specific part here. */ 65 int rhandler( char *addr, ENetEvent *ev )66 int WANDiscovery::rhandler( char *addr, ENetEvent *ev ) 66 67 { 67 68 /* handle incoming data */ 68 69 /* if a list entry arrives add to list */ 69 if( !strncmp( ev->packet->data, MSPROTO_SERVERLIST_ITEM,70 if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_ITEM, 70 71 MSPROTO_SERVERLIST_ITEM_LEN ) ) 71 72 { 72 73 /* create server structure from that item */ 73 ServerInformation toadd;74 packet::ServerInformation toadd; 74 75 75 76 /* fill in data */ 76 toadd ->setName( std::string(ev->packet->data +77 toadd.setServerName( std::string((char*)ev->packet->data + 77 78 MSPROTO_SERVERLIST_ITEM_LEN) ); 78 toadd ->setIP( std::string(ev->packet->data +79 toadd.setServerIP( std::string((char*)ev->packet->data + 79 80 MSPROTO_SERVERLIST_ITEM_LEN) ); 80 81 81 82 /* add to list */ 82 this->servers_. add( toadd );83 this->servers_.push_back( toadd ); 83 84 } 84 else if( !strncmp( ev->packet->data, MSPROTO_SERVERLIST_END,85 else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END, 85 86 MSPROTO_SERVERLIST_END_LEN ) ) 86 87 { return 1; } … … 99 100 100 101 /* deal with replies */ 101 while( !msc.pollForReply( rhandler ) )102 while( !msc.pollForReply( WANDiscovery::rhandler ) ) 102 103 /* nothing */; 103 104 -
code/branches/masterserver/src/libraries/network/WANDiscovery.h
r7650 r7651 77 77 */ 78 78 static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export 79 80 int rhandler( char *addr, ENetEvent *ev ); 79 81 80 82 private: -
code/branches/masterserver/src/libraries/network/packet/ServerInformation.h
r7459 r7651 50 50 std::string getServerName() { return this->serverName_; } 51 51 void setServerName(std::string name) { this->serverName_ = name; } 52 void setServerIP( std::string IP ) { this->serverIP_ = IP; } 52 53 uint32_t getServerRTT() { return this->serverRTT_; } 53 54
Note: See TracChangeset
for help on using the changeset viewer.