Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7568


Ignore:
Timestamp:
Oct 20, 2010, 3:43:42 PM (14 years ago)
Author:
smerkli
Message:

some progress, nothing working yet though.

Location:
code/branches/masterserver/src/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserver/src/modules/CMakeLists.txt

    r7401 r7568  
    3434ADD_SUBDIRECTORY(questsystem)
    3535ADD_SUBDIRECTORY(weapons)
     36ADD_SUBDIRECTORY(masterserver)
  • code/branches/masterserver/src/modules/masterserver/MasterServer.cpp

    r7565 r7568  
    66/* connect event */
    77int eventConnect( ENetEvent *event )
    8 {
    9   /* check for bad parameters */
     8{ /* check for bad parameters */
    109  if( !event )
    1110  { fprintf( stderr, "No event given.\n" );
     
    3534/* disconnect event */
    3635int eventDisconnect( ENetEvent *event )
    37 {
    38   /* check for bad parameters */
     36{ /* check for bad parameters */
    3937  if( !event )
    4038  { fprintf( stderr, "No event given.\n" );
     
    5452/* data event */
    5553int eventData( ENetEvent *event )
    56 {
    57   /* output what's in the packet (to be removed later) */
     54{ /* output what's in the packet (to be removed later) */
    5855  if( !event || !(event->packet) || !(event->peer) || !(event->channelID) )
    5956  { fprintf( stderr, "No complete event given.\n" );
     
    6158  }
    6259
    63 
     60  /* output debug info about the data that has come, to be removed */
    6461  printf( "A packet of length %u containing %s was received from %s on channel %u.\n",
    6562      event->packet->dataLength,
     
    123120
    124121  /***** INITIALIZE GAME SERVER LIST *****/
    125   ServerList mainlist = new ServerList();
    126   if( !mainlist )
    127   { fprintf( stderr, "Error creating server list.\n" );
    128     exit( EXIT_FAILURE );
    129   }
     122  orxonox::ServerList *mainlist = new orxonox::ServerList();
     123  //if( mainlist == NULL )
     124  //{ fprintf( stderr, "Error creating server list.\n" );
     125    //exit( EXIT_FAILURE );
     126  //}
    130127
    131128  /***** ENTER MAIN LOOP *****/
    132   ENetEvent *event = calloc(sizeof(ENetEvent));
    133   if( !event )
     129  ENetEvent *event = calloc(sizeof(ENetEvent), sizeof(char));
     130  if( event == NULL )
    134131  { fprintf( stderr, "Could not create ENetEvent structure, exiting.\n" );
    135132    exit( EXIT_FAILURE );
    136133  }
    137134
     135  /* NOTE this only waits on one client, we need to find some way to
     136   * actually listen on all active connections. This will be implemented
     137   * together with the list of active connections.
     138   */
    138139  /* Wait up to 1000 milliseconds for an event. */
    139140  while (enet_host_service (client, event, 1000) > 0)
  • code/branches/masterserver/src/modules/masterserver/MasterServer.h

    r7565 r7568  
    44/* orxonox includes */
    55#include <enet/enet.h>
    6 #include "packet/Chat.h"
    7 #include "packet/ClassID.h"
    8 #include "packet/DeleteObjects.h"
    9 #include "packet/FunctionIDs.h"
    10 #include "packet/Gamestate.h"
    11 #include "packet/Welcome.h"
     6#include <network/packet/Chat.h>
     7#include <network/packet/ClassID.h>
     8#include <network/packet/DeleteObjects.h>
     9#include <network/packet/FunctionIDs.h>
     10#include <network/packet/Gamestate.h>
     11#include <network/packet/Welcome.h>
    1212
    1313/* my includes */
    14 #include <ServerList.h>
     14#include "ServerList.h"
    1515
    1616/* c compatibility */
  • code/branches/masterserver/src/modules/masterserver/ServerList.h

    r7565 r7568  
    3232#include <list>
    3333#include <string>
    34 #include "ServerInformation.h"
     34#include <network/packet/ServerInformation.h>
    3535
    3636/* methods necessary */
     
    5454       * Add server to the game server list
    5555       */
    56       int addServer( ServerInformation *toadd );
     56      int addServer( packet::ServerInformation *toadd );
    5757
    5858      /** \param name Name of the server to remove
     
    7979    private:
    8080      /** the list of servers for internal storage */
    81       std::list<ServerInformation *> serverlist;
     81      std::list<packet::ServerInformation *> serverlist;
    8282  };
    8383}
Note: See TracChangeset for help on using the changeset viewer.