SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
GameServer.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 
10 #include "GameLink.h"
11 
12 #include <memory>
13 
14 class CharacterDatabase;
15 class GameServerData;
16 
17 class GameServer final : public EventProcessor
18 {
19  class PrivateData;
20 public:
22  ~GameServer() override;
23  GameServer(int id);
24  bool ReadConfigAndRestart();
25  const ACE_INET_Addr & getAddress();
26 
27  uint8_t getId();
28  uint16_t getCurrentPlayers();
29  uint16_t getMaxPlayers();
30  int getMaxCharacterSlots() const;
31 protected:
32  int handle_close(ACE_HANDLE handle, ACE_Reactor_Mask close_mask) override;
33  void dispatch(SEGSEvents::Event *ev) override;
34  void serialize_from(std::istream &is) override;
35  void serialize_to(std::ostream &os) override;
36  std::unique_ptr<PrivateData> d;
37 };
void serialize_to(std::ostream &os) override
Definition: GameServer.cpp:97
~GameServer() override
Definition: GameServer.cpp:119
std::unique_ptr< PrivateData > d
Definition: GameServer.h:36
Definition: SEGSEvent.h:35
const ACE_INET_Addr & getAddress()
Definition: GameServer.cpp:179
int handle_close(ACE_HANDLE handle, ACE_Reactor_Mask close_mask) override
Definition: GameServer.cpp:204
void dispatch(SEGSEvents::Event *ev) override
Definition: GameServer.cpp:79
Definition: GameServer.cpp:52
void serialize_from(std::istream &is) override
Definition: GameServer.cpp:92
uint16_t getCurrentPlayers()
Definition: GameServer.cpp:189
int getMaxCharacterSlots() const
Definition: GameServer.cpp:199
bool ReadConfigAndRestart()
Definition: GameServer.cpp:126
GameServer(int id)
Definition: GameServer.cpp:101
Definition: EventProcessor.h:22
uint8_t getId()
Definition: GameServer.cpp:184
uint16_t getMaxPlayers()
Definition: GameServer.cpp:194
#define IMPL_ID(EventProcessorChildType)
Definition: EventProcessor.h:44
Definition: GameServer.h:17