Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 17, 2010, 4:18:14 PM (14 years ago)
Author:
smerkli
Message:

done for today

Location:
code/branches/masterserver/src/libraries/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserver/src/libraries/network/WANDiscovery.cc

    r7650 r7651  
    6262
    6363  /* callback for the network reply poller */
     64  /* WORK MARK WORK WORK */
    6465  /* NOTE implement protocol-specific part here. */
    65   int rhandler( char *addr, ENetEvent *ev )
     66  int WANDiscovery::rhandler( char *addr, ENetEvent *ev )
    6667  {
    6768    /* handle incoming data */
    6869    /* 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,
    7071      MSPROTO_SERVERLIST_ITEM_LEN ) )
    7172    {
    7273      /* create server structure from that item */
    73       ServerInformation toadd;
     74      packet::ServerInformation toadd;
    7475
    7576      /* fill in data */
    76       toadd->setName( std::string(ev->packet->data +
     77      toadd.setServerName( std::string((char*)ev->packet->data +
    7778        MSPROTO_SERVERLIST_ITEM_LEN) );
    78       toadd->setIP( std::string(ev->packet->data +
     79      toadd.setServerIP( std::string((char*)ev->packet->data +
    7980        MSPROTO_SERVERLIST_ITEM_LEN) );
    8081
    8182      /* add to list */
    82       this->servers_.add( toadd );
     83      this->servers_.push_back( toadd );
    8384    }
    84     else if( !strncmp( ev->packet->data, MSPROTO_SERVERLIST_END,
     85    else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
    8586      MSPROTO_SERVERLIST_END_LEN ) )
    8687    { return 1; }
     
    99100
    100101    /* deal with replies */
    101     while( !msc.pollForReply( rhandler ) )
     102    while( !msc.pollForReply( WANDiscovery::rhandler ) )
    102103      /* nothing */;
    103104
  • code/branches/masterserver/src/libraries/network/WANDiscovery.h

    r7650 r7651  
    7777       */
    7878      static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
     79   
     80      int rhandler( char *addr, ENetEvent *ev );
    7981     
    8082    private:
  • code/branches/masterserver/src/libraries/network/packet/ServerInformation.h

    r7459 r7651  
    5050        std::string   getServerName() { return this->serverName_; }
    5151        void          setServerName(std::string name) { this->serverName_ = name; }
     52        void          setServerIP( std::string IP ) { this->serverIP_ = IP; }
    5253        uint32_t      getServerRTT() { return this->serverRTT_; }
    5354       
Note: See TracChangeset for help on using the changeset viewer.