Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7672


Ignore:
Timestamp:
Nov 24, 2010, 11:12:30 PM (13 years ago)
Author:
smerkli
Message:

just added some notes so I understand my own stuff next week.

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

Legend:

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

    r7668 r7672  
    109109    COUT(2) << "MARK polling...\n";
    110110
    111     if( enet_host_service( this->client, &this->event, 1000 ) >= 0 )
     111    /* enet_host_service returns 0 if no event occured */
     112    /* just newly set below test to >0 from >= 0, to be tested */
     113    if( enet_host_service( this->client, &this->event, 1000 ) > 0 )
    112114    {
    113115      /* address buffer */
  • code/branches/masterserver/src/libraries/network/WANDiscovery.cc

    r7667 r7672  
    4343  WANDiscovery::WANDiscovery()
    4444  {
    45     COUT(0) << "WANDiscovery created.\n";
    46     /* create master server communications object */
    47     //this->msc = MasterServerComm();
     45    COUT(4) << "Creating WANDiscovery.\n";
    4846
    4947    /* initialize it and see if it worked */
    5048    if( msc.initialize() )
    51       COUT(0) << "Error: could not initialize master server communications!\n";
     49      COUT(2) << "Error: could not initialize master server communications!\n";
    5250
    5351    /* connect and see if it worked */
    5452    if( msc.connect( MS_ADDRESS, 1234 ) )
    55       COUT(0) << "Error: could not connect to master server!\n";
     53      COUT(2) << "Error: could not connect to master server!\n";
    5654
    57     COUT(0) << "Initialization of WANDiscovery complete.\n";
     55    COUT(4) << "Initialization of WANDiscovery complete.\n";
    5856  }
    5957
     
    9290    else if( !strncmp( (char*)ev->packet->data, MSPROTO_SERVERLIST_END,
    9391      MSPROTO_SERVERLIST_END_LEN ) )
    94     { return 1; }
     92    {
     93      /* this is the only case where 1 should be returned,
     94       * as 1 is used to signal that we're done receiving
     95       * the list
     96       */
     97      return 1;
     98    }
    9599
    96100    /* done handling, return all ok code 0 */
     
    106110    this->msc.sendRequest( MSPROTO_CLIENT " " MSPROTO_REQ_LIST );
    107111
    108     /* deal with replies */
     112    /* poll for replies */
     113    /* TODO add some timeout here so we don't wait indefinitely */
    109114    while( !((this->msc).pollForReply( rhandler )) )
    110115      /* nothing */;
  • code/branches/masterserver/src/libraries/network/WANDiscovery.h

    r7657 r7672  
    7878      static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
    7979   
     80      /* todo: might make this private and use getter/setter methods
     81       * at some later time.
     82       */
    8083      /** game server list */
    8184      std::vector<packet::ServerInformation> servers_;
Note: See TracChangeset for help on using the changeset viewer.