Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2010, 4:22:58 PM (14 years ago)
Author:
smerkli
Message:
 
File:
1 edited

Legend:

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

    r7633 r7634  
    101101
    102102  /* TODO */
    103   void helper_ConnectToMasterserver()
    104   {
    105     /* TODO connect to master server here and say you're there */
     103  void Server::helper_ConnectToMasterserver()
     104  {
     105    /* initialize it and see if it worked */
     106    if( msc.initialize() )
     107      COUT(1) << "Error: could not initialize master server communications!\n";
     108
     109    /* connect and see if it worked */
     110    if( msc.connect( MS_ADDRESS, 1234 ) )
     111      COUT(1) << "Error: could not connect to master server!\n";
     112
     113    /* TODO */
     114    /* now send the master server some note we're here */
    106115  }
    107116
     
    154163
    155164
     165  /* TODO */
     166  int replyhandler( char *addr, ENetEvent *ev )
     167  {
     168    /* handle incoming data */
     169
     170    /* done handling, return all ok code 0 */
     171    return 0;
     172  }
     173
     174  void Server::helper_HandleMasterServerRequests()
     175  {
     176    this->msc.pollForReply( replyhandler );
     177  }
     178
    156179  /**
    157180  * Run this function once every tick
     
    167190    LANDiscoverable::update();
    168191
    169     // TODO receive and process requests from master server
     192    // receive and process requests from master server
     193    helper_HandleMasterServerRequests();
    170194
    171195    if ( ClientInformation::hasClients() )
Note: See TracChangeset for help on using the changeset viewer.