Main Page   Class Hierarchy   Compound List   File List   Compound Members  

serverbase.h

00001 #ifndef GGZ_AGS_SERVERBASE_H
00002 #define GGZ_AGS_SERVERBASE_H
00003 
00004 // Include server core
00005 #include "servercore.h"
00006 #include "serverggz.h"
00007 
00008 // GGZ Advanced Game Server namespace
00009 namespace AGS
00010 {
00014         struct agspacket_t
00015         {
00016                 char type;
00017                 char opcode;
00018                 short length;
00019                 void *data;
00020         };
00021 
00025         class ServerBase : public ServerCore, public ServerGGZ
00026         {
00027                 public:
00030                         ServerBase(int port);
00031 
00033                         enum RunModes
00034                         {
00035                                 GGZMode,
00036                                 ServerMode
00037                         };
00038 
00040                         void run(int runmode);
00041 
00042                 protected:
00044                         virtual void handleJoin();
00045 
00047                         virtual void handleLeave();
00048 
00050                         virtual void handleData(void *data, int length);
00051 
00052                 private:
00053                         void joinEvent(int player);
00054                         void leaveEvent(int player);
00055                         void dataEvent(int player);
00056                         void handleConnection(int mode, int fd);
00057                         char *localsock();
00058 
00059                         int m_port;
00060         };
00061 };
00062 
00063 #endif
00064 

Generated on Mon May 6 10:52:13 2002 for GGZ Advanced Game Server by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001