Changeset 7568
- Timestamp:
- Oct 20, 2010, 3:43:42 PM (14 years ago)
- Location:
- code/branches/masterserver/src/modules
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/modules/CMakeLists.txt
r7401 r7568 34 34 ADD_SUBDIRECTORY(questsystem) 35 35 ADD_SUBDIRECTORY(weapons) 36 ADD_SUBDIRECTORY(masterserver) -
code/branches/masterserver/src/modules/masterserver/MasterServer.cpp
r7565 r7568 6 6 /* connect event */ 7 7 int eventConnect( ENetEvent *event ) 8 { 9 /* check for bad parameters */ 8 { /* check for bad parameters */ 10 9 if( !event ) 11 10 { fprintf( stderr, "No event given.\n" ); … … 35 34 /* disconnect event */ 36 35 int eventDisconnect( ENetEvent *event ) 37 { 38 /* check for bad parameters */ 36 { /* check for bad parameters */ 39 37 if( !event ) 40 38 { fprintf( stderr, "No event given.\n" ); … … 54 52 /* data event */ 55 53 int 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) */ 58 55 if( !event || !(event->packet) || !(event->peer) || !(event->channelID) ) 59 56 { fprintf( stderr, "No complete event given.\n" ); … … 61 58 } 62 59 63 60 /* output debug info about the data that has come, to be removed */ 64 61 printf( "A packet of length %u containing %s was received from %s on channel %u.\n", 65 62 event->packet->dataLength, … … 123 120 124 121 /***** INITIALIZE GAME SERVER LIST *****/ 125 ServerList mainlist = newServerList();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 //} 130 127 131 128 /***** ENTER MAIN LOOP *****/ 132 ENetEvent *event = calloc(sizeof(ENetEvent) );133 if( !event)129 ENetEvent *event = calloc(sizeof(ENetEvent), sizeof(char)); 130 if( event == NULL ) 134 131 { fprintf( stderr, "Could not create ENetEvent structure, exiting.\n" ); 135 132 exit( EXIT_FAILURE ); 136 133 } 137 134 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 */ 138 139 /* Wait up to 1000 milliseconds for an event. */ 139 140 while (enet_host_service (client, event, 1000) > 0) -
code/branches/masterserver/src/modules/masterserver/MasterServer.h
r7565 r7568 4 4 /* orxonox includes */ 5 5 #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> 12 12 13 13 /* my includes */ 14 #include <ServerList.h>14 #include "ServerList.h" 15 15 16 16 /* c compatibility */ -
code/branches/masterserver/src/modules/masterserver/ServerList.h
r7565 r7568 32 32 #include <list> 33 33 #include <string> 34 #include "ServerInformation.h"34 #include <network/packet/ServerInformation.h> 35 35 36 36 /* methods necessary */ … … 54 54 * Add server to the game server list 55 55 */ 56 int addServer( ServerInformation *toadd );56 int addServer( packet::ServerInformation *toadd ); 57 57 58 58 /** \param name Name of the server to remove … … 79 79 private: 80 80 /** the list of servers for internal storage */ 81 std::list< ServerInformation *> serverlist;81 std::list<packet::ServerInformation *> serverlist; 82 82 }; 83 83 }
Note: See TracChangeset
for help on using the changeset viewer.