[Orxonox-commit 2931] r7631 - in code/branches/masterserver: data/gui/scripts src/libraries/network src/modules/masterserver

smerkli at orxonox.net smerkli at orxonox.net
Wed Nov 10 15:35:39 CET 2010


Author: smerkli
Date: 2010-11-10 15:35:39 +0100 (Wed, 10 Nov 2010)
New Revision: 7631

Added:
   code/branches/masterserver/src/libraries/network/MasterServerComm.cc
   code/branches/masterserver/src/libraries/network/MasterServerComm.h
Removed:
   code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc
   code/branches/masterserver/src/modules/masterserver/MasterServerComm.h
Modified:
   code/branches/masterserver/data/gui/scripts/MultiplayerMenu.lua
   code/branches/masterserver/src/libraries/network/CMakeLists.txt
   code/branches/masterserver/src/libraries/network/WANDiscovery.cc
   code/branches/masterserver/src/libraries/network/WANDiscovery.h
   code/branches/masterserver/src/modules/masterserver/ServerList.h
Log:
added comments, lua function (to be tested) and various implementation bits

Modified: code/branches/masterserver/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/masterserver/data/gui/scripts/MultiplayerMenu.lua	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/data/gui/scripts/MultiplayerMenu.lua	2010-11-10 14:35:39 UTC (rev 7631)
@@ -128,5 +128,38 @@
     end
 end
 
+
+-- same as above, but use WAN Discovery
+function P.showServerList()
+    local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
+    CEGUI.toListbox(listbox):resetList()
+    local discovery = orxonox.WANDiscovery:getInstance()
+    discovery:discover()
+    P.serverList = {}
+    local index = 0
+    local servername = ""
+    local serverip = ""
+    while true do
+        servername = discovery:getServerListItemName(index)
+        if servername == "" then
+            break
+        end
+        serverip = discovery:getServerListItemIP(index)
+        if serverip == "" then
+          break
+        end
+        table.insert(P.serverList, {servername, serverip})
+        index = index + 1
+    end
+    index = 1
+    for k,v in pairs(P.serverList) do
+        local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] )
+        item:setID(index)
+        index = index + 1
+        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+        CEGUI.toListbox(listbox):addItem(item)
+    end
+end
+
 return P
 

Modified: code/branches/masterserver/src/libraries/network/CMakeLists.txt
===================================================================
--- code/branches/masterserver/src/libraries/network/CMakeLists.txt	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/libraries/network/CMakeLists.txt	2010-11-10 14:35:39 UTC (rev 7631)
@@ -31,6 +31,8 @@
   GamestateHandler.cc
   LANDiscoverable.cc
   LANDiscovery.cc
+  WANDiscovery.cc
+  MasterServerComm.cc
   NetworkFunction.cc
   Host.cc
   Server.cc
@@ -53,6 +55,8 @@
   Host.h
   LANDiscoverable.h
   LANDiscovery.h
+  WANDiscovery.h
+  MasterServerComm.h
   NetworkFunction.h
   NetworkPrecompiledHeaders.h
   NetworkPrereqs.h

Copied: code/branches/masterserver/src/libraries/network/MasterServerComm.cc (from rev 7630, code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc)
===================================================================
--- code/branches/masterserver/src/libraries/network/MasterServerComm.cc	                        (rev 0)
+++ code/branches/masterserver/src/libraries/network/MasterServerComm.cc	2010-11-10 14:35:39 UTC (rev 7631)
@@ -0,0 +1,208 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sandro 'smerkli' Merkli
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "MasterServerComm.h"
+
+namespace orxonox
+{
+ 
+  MasterServerComm::MasterServerComm()
+  { /* nothing anymore, everything's been outsourced to 
+     * the initialize method to facilitate debugging
+     */
+  } 
+
+
+  int MasterServerComm::initialize()
+  {
+    /* initialize Enet */
+    if (enet_initialize () != 0)
+    { COUT(1) << "An error occurred while initializing ENet.\n";
+      return 1;
+    }
+    
+    /* install atexit handler for enet */
+    atexit( enet_deinitialize );
+
+
+    /* initiate the client */
+    this->client = enet_host_create( NULL /* create a client host */,
+        1,
+        2, /* allow up 2 channels to be used, 0 and 1 */
+        0, 
+        0 ); 
+
+    /* see if it worked */
+    if (this->client == NULL)
+    { COUT(1) << "An error occurred while trying to create an ENet client host.\n";
+      return 1;
+    }
+  }
+
+  MasterServerComm::~MasterServerComm()
+  {
+    /* destroy the enet facilities */
+    enet_host_destroy(this->client);
+  }
+
+  int MasterServerComm::connect( char *address, unsigned int port )
+  {
+    /* Connect to address:port. */
+    enet_address_set_host( &this->address, address );
+    this->address.port = port;
+
+    /* Initiate the connection, allocating the two channels 0 and 1. */
+    this->peer = enet_host_connect(this->client, &this->address, 2, 0);    
+
+    if (this->peer == NULL )
+    { fprintf( stderr, 
+        "No available peers for initiating an ENet connection.\n");
+    //exit (EXIT_FAILURE);
+    return -1;
+    }
+
+    /* Wait up to 2 seconds for the connection attempt to succeed. */
+    if (enet_host_service (this->client, &this->event, 2000) > 0 &&
+        this->event.type == ENET_EVENT_TYPE_CONNECT )
+      fprintf( stdout, "Connection to server succeeded." );
+    else
+    {
+      enet_peer_reset (this->peer);
+      fprintf( stdout, "Connection to %s failed.", address );
+      //exit(EXIT_FAILURE);
+      return -1;
+    }
+
+    return 0;
+  }
+
+  int MasterServerComm::pollForReply( int (*callback)( char*, ENetEvent* ) )
+  { 
+    /* see whether anything happened */
+    if( enet_host_service( this->client, &this->event, 100 ) >= 0 )
+    { 
+      /* address buffer */
+      char *addrconv = NULL;
+
+      /* check what type of event it is and react accordingly */
+      switch (this->event.type)
+      { /* new connection, not supposed to happen. */
+        case ENET_EVENT_TYPE_CONNECT: break;
+
+        /* disconnect */
+        case ENET_EVENT_TYPE_DISCONNECT: /* ?? */ break;
+
+        /* incoming data */
+        case ENET_EVENT_TYPE_RECEIVE: 
+          addrconv = (char *) calloc( 50, 1 );
+          enet_address_get_host_ip( &(this->event.peer->address), addrconv, 49 );
+
+          /* DEBUG */
+          printf( "A packet of length %u containing %s was "
+            "received from %s on channel %u.\n",
+            this->event.packet->dataLength,
+            this->event.packet->data,
+            addrconv,
+            this->event.channelID );
+          /* END DEBUG */
+
+          /* call the supplied callback, if any. */
+          if( (*callback) != NULL )
+            (*callback)( addrconv, &(this->event) );
+
+          enet_packet_destroy( event.packet );
+          if( addrconv ) free( addrconv );
+          break;
+        default: break;
+      }
+
+      /* event handled, return 0 */
+      return 0;
+    }
+
+    /* show that no event occured */
+    return 1;
+  }
+
+  int MasterServerComm::sendRequest( char *data )
+  {
+    /* send the data to the friend */
+    /* Create a reliable packet of size 7 containing "packet\0" */
+    ENetPacket * packet = enet_packet_create( data, 
+        strlen( data ) + 1, 
+        ENET_PACKET_FLAG_RELIABLE);
+
+    /* Send the packet to the peer over channel id 0. */
+    enet_peer_send (this->peer, 0, packet);
+
+    /* One could just use enet_host_service() instead. */
+    enet_host_flush( this->client );
+    if( packet ) free( packet );
+  }
+
+}
+
+
+/* DON'T DELETE THIS I MIGHT NEED IT AGAIN -smerkli */
+/* not needed anymore, only here for testing purposes */
+/*
+//[> sample callback to output debugging info. <]
+//int callb( char *addr, ENetEvent *ev )
+//{ 
+  //printf( "A packet of length %u containing %s was "
+      //"received from %s on channel %u.\n",
+      //ev->packet->dataLength,
+      //ev->packet->data,
+      //addr,
+      //ev->channelID );
+  //return 0;
+//}
+
+//[> small testing implementation <]
+//int
+//main( int argc, char *argv[] )
+//{
+  //[> setup object and connect <]
+  //MasterServerComm msc = MasterServerComm();
+  //if( msc.connect( argv[1], 1234 ) )
+    //exit(EXIT_FAILURE);
+  
+  //[> send some data and poll for replies <]
+  //char *theinput = (char *)calloc( 100,1 );
+  //while( true )
+  //{ 
+    //fgets( theinput, 90, stdin );
+    //if( !strncmp( theinput, "quit", 4 ) )
+      //break;
+
+    //msc.sendRequest( theinput );
+    //msc.pollForReply( &callb );
+  //}
+
+//}
+*/

Copied: code/branches/masterserver/src/libraries/network/MasterServerComm.h (from rev 7629, code/branches/masterserver/src/modules/masterserver/MasterServerComm.h)
===================================================================
--- code/branches/masterserver/src/libraries/network/MasterServerComm.h	                        (rev 0)
+++ code/branches/masterserver/src/libraries/network/MasterServerComm.h	2010-11-10 14:35:39 UTC (rev 7631)
@@ -0,0 +1,87 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Sandro 'smerkli' Merkli
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <enet/enet.h>
+
+namespace orxonox
+{
+  class MasterServerComm
+  {
+    public: 
+      /** constructor */
+      MasterServerComm();
+
+      /** destructor */
+      ~MasterServerComm();
+
+      /** \return 0 for success, other for error
+       * 
+       * Initialize everything for the master server communication 
+       */
+      int initialize();
+
+
+      /** \param address Address to connect to (Host name or IP in text form)
+       * \param port Port to connect on 
+       * \return 0 for success, other for error 
+       * 
+       * Connect to the master server with the given address on the given port. 
+       */
+      int connect( char *address, unsigned int port );
+
+      /** \param data The data to be sent. 
+       * \return 0 for success, other for error. 
+       * 
+       * Send a request to the master server containing data specified in data
+       */
+      int sendRequest( char *data );
+
+      /** \param callback The callback function to call with data receivced.
+       * \return 0 for success, other for error
+       * 
+       * Poll the master server for new data and act accordingly */
+      int pollForReply( int (*callback)( char*, ENetEvent* ) );
+
+    private:
+      /** client handle */
+      ENetHost *client;
+
+      /** event data holder */
+      ENetEvent event;
+
+      /** address holder */
+      ENetAddress address;
+
+      /** peer data holder */
+      ENetPeer *peer;
+  };
+
+}

Modified: code/branches/masterserver/src/libraries/network/WANDiscovery.cc
===================================================================
--- code/branches/masterserver/src/libraries/network/WANDiscovery.cc	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/libraries/network/WANDiscovery.cc	2010-11-10 14:35:39 UTC (rev 7631)
@@ -20,8 +20,9 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      Fabian 'x3n' Landau (original)
  *   Co-authors:
+ *      Sandro 'smerkli' Merkli (adaptions to WAN)
  *      ...
  *
  */
@@ -41,25 +42,70 @@
 
   WANDiscovery::WANDiscovery()
   {
+    /* create master server communications object */
+    this->msc = MasterServerComm();
+
+    /* initialize it and see if it worked */
+    if( msc.initialize() )
+      COUT(1) << "Error: could not initialize master server communications!\n";
+
+    /* connect and see if it worked */
+    if( msc.connect( MS_ADDRESS, 1234 ) )
+      COUT(1) << "Error: could not connect to master server!\n";
   }
 
   WANDiscovery::~WANDiscovery()
-  {
+  { 
+    /* clear server list */
+    this->servers_.clear();  
   }
 
+  /* callback for the network reply poller */
+  /* NOTE implement protocol-specific part here. */
+  int replyhandler( char *addr, ENetEvent *ev )
+  { 
+    /* handle incoming data
+     * if a list entry arrives add to list
+     * if a done entry arrives set done to true
+     */
+
+    /* done handling, return all ok code 0 */
+    return 0;
+  }
+ 
   void WANDiscovery::discover()
   {
+    /* clear list */
     this->servers_.clear();
+
+    /* send request to server */
+    msc.sendRequest( MSPROTO_CLIENT MSPROTO_REQ_LIST );
+
+    /* deal with replies */
+    while( msc.pollForReply( replyhandler ) ) 
+      /* nothing */;
+
+    /* done receiving. */
   }
 
   std::string WANDiscovery::getServerListItemName(unsigned int index)
   {
-
+    /* if the index is out of range, return empty */
+    if( index >= this->servers_.size() )
+      return BLANKSTRING;
+    else
+      /* else return the name of the server */
+      return this->servers_[index].getServerName();
   }
 
   std::string WANDiscovery::getServerListItemIP(unsigned int index)
   {
-
+    /* if the index is out of range, return empty */
+    if( index >= this->servers_.size() )
+      return BLANKSTRING;
+    else
+      /* else return the IP of the server */
+      return this->servers_[index].getServerIP();
   }
 
 

Modified: code/branches/masterserver/src/libraries/network/WANDiscovery.h
===================================================================
--- code/branches/masterserver/src/libraries/network/WANDiscovery.h	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/libraries/network/WANDiscovery.h	2010-11-10 14:35:39 UTC (rev 7631)
@@ -32,9 +32,17 @@
 #include "NetworkPrereqs.h"
 #include "packet/ServerInformation.h"
 #include "util/Singleton.h"
+#include "MasterServerComm.h"
 
 #include <vector>
 
+/* master server address (to be moved elsewhere later) */
+#define MS_ADDRESS "localhost"
+
+/* protocol (to be moved elsewhere later) */
+#define MSPROTO_CLIENT "CL "
+#define MSPROTO_REQ_LIST "REQ:LIST"
+
 // tolua_begin
 namespace orxonox
 {
@@ -45,17 +53,45 @@
   { // tolua_export
     friend class Singleton<WANDiscovery>;
     public:
+      /** constructor */
       WANDiscovery();
+
+      /** destructor */
       ~WANDiscovery();
+
+      /** ask server for server list  */
       void discover(); // tolua_export
+
+      /** \param index Index to get the name of 
+       * \return The name of the server
+       * 
+       * Get the name of the server at index index. 
+       */
       std::string getServerListItemName( unsigned int index ); // tolua_export
+
+      /** \param index Index to get the IP of 
+       * \return The IP of the server
+       * 
+       * Get the IP of the server at index index. 
+       */
       std::string getServerListItemIP( unsigned int index ); // tolua_export
-      static WANDiscovery& getInstance(){ return Singleton<WANDiscovery>::getInstance(); } // tolua_export
+
+      /** \return an instance of WANDiscovery
+       * 
+       * Create and return an instance of WANDiscovery.
+       */
+      static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export
       
     private:
+      /** Singleton pointer */
       static WANDiscovery* singletonPtr_s;
-      ENetHost* host_;
+
+      /** Master server communications object */
+      MasterServerComm msc;
+
+      /** game server list */
       std::vector<packet::ServerInformation> servers_;
+
   }; // tolua_export
 
 } // tolua_export

Deleted: code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc
===================================================================
--- code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/modules/masterserver/MasterServerComm.cc	2010-11-10 14:35:39 UTC (rev 7631)
@@ -1,190 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Sandro 'smerkli' Merkli
- *   Co-authors:
- *      ...
- *
- */
-
-#include <cstdlib>
-#include <cstdio>
-#include <cstring>
-#include <enet/enet.h>
-#include "MasterServerComm.h"
-
-MasterServerComm::MasterServerComm()
-{
-  /* initialize Enet */
-  if (enet_initialize () != 0)
-  { fprintf (stderr, "An error occurred while initializing ENet.\n");
-    exit(EXIT_FAILURE);
-  }
-  atexit (enet_deinitialize);
-
-
-  /* initiate the client */
-  this->client = enet_host_create( NULL /* create a client host */,
-      1,
-      2, /* allow up 2 channels to be used, 0 and 1 */
-      0, 
-      0 ); 
-
-  /* see if it worked */
-  if (this->client == NULL)
-  { fprintf (stderr, 
-      "An error occurred while trying to create an ENet client host.\n");
-    exit (EXIT_FAILURE);
-  }
-}
-
-MasterServerComm::~MasterServerComm()
-{
-  enet_host_destroy(this->client);
-}
-
-int 
-MasterServerComm::connect( char *address, unsigned int port )
-{
-  /* Connect to address:port. */
-  enet_address_set_host( &this->address, address );
-  this->address.port = port;
-
-  /* Initiate the connection, allocating the two channels 0 and 1. */
-  this->peer = enet_host_connect(this->client, &this->address, 2, 0);    
-
-  if (this->peer == NULL )
-  { fprintf( stderr, 
-        "No available peers for initiating an ENet connection.\n");
-    //exit (EXIT_FAILURE);
-    return -1;
-  }
-
-  /* Wait up to 2 seconds for the connection attempt to succeed. */
-  if (enet_host_service (this->client, &this->event, 2000) > 0 &&
-      this->event.type == ENET_EVENT_TYPE_CONNECT )
-    fprintf( stdout, "Connection to server succeeded." );
-  else
-  {
-    enet_peer_reset (this->peer);
-    fprintf( stdout, "Connection to %s failed.", address );
-    //exit(EXIT_FAILURE);
-    return -1;
-  }
-
-  return 0;
-}
-
-int 
-MasterServerComm::pollForReply( int (*callback)( char*, ENetEvent* ) )
-{ 
-  if( enet_host_service( this->client, &this->event, 100 ) >= 0 )
-  { 
-    char *addrconv = NULL;
-    /* check what type of event it is and react accordingly */
-    switch (this->event.type)
-    { /* new connection, not supposed to happen. */
-      case ENET_EVENT_TYPE_CONNECT: break;
-
-      /* disconnect */
-      case ENET_EVENT_TYPE_DISCONNECT: 
-        /* ?? */ break;
-
-        /* incoming data */
-      case ENET_EVENT_TYPE_RECEIVE: 
-        addrconv = (char *) calloc( 50, 1 );
-        enet_address_get_host_ip( &(this->event.peer->address), addrconv, 49 );
-
-        /* DEBUG */
-        printf( "A packet of length %u containing %s was "
-          "received from %s on channel %u.\n",
-          this->event.packet->dataLength,
-          this->event.packet->data,
-          addrconv,
-          this->event.channelID );
-        /* END DEBUG */
-
-        /* call the supplied callback, if any. */
-        if( (*callback) != NULL )
-          (*callback)( addrconv, &(this->event) );
-
-        enet_packet_destroy( event.packet );
-        if( addrconv ) free( addrconv );
-        break;
-      default: break;
-    }
-  }
-  
-  return 0;
-}
-
-int 
-MasterServerComm::sendRequest( char *data )
-{
-  /* send the data to the friend */
-  /* Create a reliable packet of size 7 containing "packet\0" */
-  ENetPacket * packet = enet_packet_create( data, 
-      strlen( data ) + 1, 
-      ENET_PACKET_FLAG_RELIABLE);
-
-  /* Send the packet to the peer over channel id 0. */
-  enet_peer_send (this->peer, 0, packet);
-
-  /* One could just use enet_host_service() instead. */
-  enet_host_flush( this->client );
-  if( packet ) free( packet );
-}
-
-/* sample callback to output debugging info. */
-int callb( char *addr, ENetEvent *ev )
-{ 
-  printf( "A packet of length %u containing %s was "
-      "received from %s on channel %u.\n",
-      ev->packet->dataLength,
-      ev->packet->data,
-      addr,
-      ev->channelID );
-  return 0;
-}
-
-/* small testing implementation */
-int
-main( int argc, char *argv[] )
-{
-  /* setup object and connect */
-  MasterServerComm msc = MasterServerComm();
-  if( msc.connect( argv[1], 1234 ) )
-    exit(EXIT_FAILURE);
-  
-  /* send some data and poll for replies */
-  char *theinput = (char *)calloc( 100,1 );
-  while( true )
-  { 
-    fgets( theinput, 90, stdin );
-    if( !strncmp( theinput, "quit", 4 ) )
-      break;
-
-    msc.sendRequest( theinput );
-    msc.pollForReply( &callb );
-  }
-
-}

Deleted: code/branches/masterserver/src/modules/masterserver/MasterServerComm.h
===================================================================
--- code/branches/masterserver/src/modules/masterserver/MasterServerComm.h	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/modules/masterserver/MasterServerComm.h	2010-11-10 14:35:39 UTC (rev 7631)
@@ -1,69 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Sandro 'smerkli' Merkli
- *   Co-authors:
- *      ...
- *
- */
-
-class MasterServerComm
-{
-  public: 
-    /** constructor */
-    MasterServerComm();
-
-    /** destructor */
-    ~MasterServerComm();
-
-    
-    /** \param address Address to connect to (Host name or IP in text form)
-     * \param port Port to connect on 
-     * \return 0 for success, other for error 
-     * 
-     * Connect to the master server with the given address on the given port. 
-     */
-    int connect( char *address, unsigned int port );
-
-    /** \param data The data to be sent. 
-     * \return 0 for success, other for error. 
-     * 
-     * Send a request to the master server containing data specified in data
-     */
-    int sendRequest( char *data );
-
-    /** \param callback The callback function to call with data receivced.
-     * \return 0 for success, other for error
-     * 
-     * Poll the master server for new data and act accordingly */
-    int pollForReply( int (*callback)( char*, ENetEvent* ) );
-
-  private:
-    /* client handle */
-    ENetHost *client;
-    ENetEvent event;
-
-    ENetAddress address;
-    ENetPeer *peer;
-
-
-};

Modified: code/branches/masterserver/src/modules/masterserver/ServerList.h
===================================================================
--- code/branches/masterserver/src/modules/masterserver/ServerList.h	2010-11-10 13:19:44 UTC (rev 7630)
+++ code/branches/masterserver/src/modules/masterserver/ServerList.h	2010-11-10 14:35:39 UTC (rev 7631)
@@ -68,7 +68,7 @@
       bool delServerByAddress( std::string address );
 
 
-      /* SORTING */
+      /* SORTING (to be implemented) */
 
       /** sort by name  */
       void sortByName();




More information about the Orxonox-commit mailing list