src/Server.h

00001 #ifndef SERVER_H_
00002 #define SERVER_H_
00003 
00004 #include <map>
00005 
00006 #include "SDL.h"
00007 
00008 #include "Connection.h"
00009 
00010 class Message;  // Forward declarations.
00011 class MessageIn;
00012 class MessageOut;
00013 class Client;
00014 
00021 class Server : public Connection
00022 {
00023 public:
00024 
00036         Server(int port);
00037 
00041         virtual ~Server();
00042 
00055         void startListen(ConnectionData * data);
00056 
00065         bool addClient(Client* newClient);
00066 
00075         bool removeClient(Client* oldClient);
00076 
00084         void requestExit();
00085 
00094         void setChatMode(bool value = true);
00095 
00107         void generalChatMsg(Uint32 sender, std::string msg);
00108 
00117     void getNextGoSerial(Uint32& validSerial);
00118 
00126     void setInit(bool value = true);
00127 
00128 private:
00129 
00137         std::map<Uint32, Client*> mClients;
00138 
00139         SDL_mutex* mxClients;       
00140         bool exit_request;          
00141         bool chat_mode;             
00142         SDL_mutex* mxGoSerial;      
00143         Uint32 gameObjectSerial;    
00144         bool initialized;           
00145 };
00146 
00147 #endif /*SERVER_H_*/

Generated on Mon Dec 3 04:30:13 2007 for lo-testserver by  doxygen 1.3.9.1