- Timestamp:
- Nov 17, 2010, 4:18:14 PM (15 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.