- Timestamp:
- Nov 17, 2010, 4:05:13 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/WANDiscovery.cc
r7631 r7650 63 63 /* callback for the network reply poller */ 64 64 /* NOTE implement protocol-specific part here. */ 65 int r eplyhandler( char *addr, ENetEvent *ev )65 int rhandler( char *addr, ENetEvent *ev ) 66 66 { 67 /* handle incoming data 68 * if a list entry arrives add to list 69 * if a done entry arrives set done to true 70 */ 67 /* handle incoming data */ 68 /* if a list entry arrives add to list */ 69 if( !strncmp( ev->packet->data, MSPROTO_SERVERLIST_ITEM, 70 MSPROTO_SERVERLIST_ITEM_LEN ) ) 71 { 72 /* create server structure from that item */ 73 ServerInformation toadd; 74 75 /* fill in data */ 76 toadd->setName( std::string(ev->packet->data + 77 MSPROTO_SERVERLIST_ITEM_LEN) ); 78 toadd->setIP( std::string(ev->packet->data + 79 MSPROTO_SERVERLIST_ITEM_LEN) ); 80 81 /* add to list */ 82 this->servers_.add( toadd ); 83 } 84 else if( !strncmp( ev->packet->data, MSPROTO_SERVERLIST_END, 85 MSPROTO_SERVERLIST_END_LEN ) ) 86 { return 1; } 71 87 72 88 /* done handling, return all ok code 0 */ … … 80 96 81 97 /* send request to server */ 82 msc.sendRequest( MSPROTO_CLIENT MSPROTO_REQ_LIST );98 msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST ); 83 99 84 100 /* deal with replies */ 85 while( msc.pollForReply( replyhandler ) )101 while( !msc.pollForReply( rhandler ) ) 86 102 /* nothing */; 87 103
Note: See TracChangeset
for help on using the changeset viewer.