GameServer.h 707 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef GAMESERVER_H
  2. #define GAMESERVER_H
  3. #include <iostream>
  4. #include "../network/server/IServerListener.h"
  5. #include "ICommandSource.h"
  6. #include "CommandManager.h"
  7. using namespace std;
  8. class GameServer : public IServerListener, public ICommandSource
  9. {
  10. public:
  11. GameServer();
  12. virtual ~GameServer();
  13. void start(unsigned short port, unsigned short maxClients);
  14. void onFullServerClientConnect(int socket) override;
  15. void onClientConnect(int socket) override;
  16. void onClientPackage(int socket, Stream& in) override;
  17. void onClientDisconnect(int socket) override;
  18. void stop();
  19. private:
  20. bool isRunning = false;
  21. CommandManager commandManager;
  22. };
  23. #endif