SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
AuthServer.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 // SEGS includes
11 #include "EventProcessor.h"
12 
13 // ACE includes
14 #include <ace/INET_Addr.h>
15 #include <ace/Synch.h>
16 
17 class AuthLink;
18 class AuthHandler;
19 struct ClientAcceptor;
20 class AuthServer final : public EventProcessor
21 {
22 public:
24  AuthServer();
25  ~AuthServer() override;
26 
27 
28 protected:
29  void per_thread_shutdown() override;
30  bool per_thread_startup() override;
31  bool Run();
32  bool ReadConfigAndRestart();
33  std::unique_ptr<ClientAcceptor> m_acceptor;
34  ACE_INET_Addr m_location;
35  bool m_running;
36  ACE_Thread_Mutex m_mutex;
37  std::unique_ptr<AuthHandler> m_handler;
38 
39  // EventProcessor interface
40  void dispatch(SEGSEvents::Event *ev) override;
41  void serialize_from(std::istream &is) override;
42  void serialize_to(std::ostream &is) override;
43 };
void dispatch(SEGSEvents::Event *ev) override
Definition: AuthServer.cpp:67
Definition: SEGSEvent.h:35
AuthServer()
Definition: AuthServer.cpp:53
void serialize_from(std::istream &is) override
Definition: AuthServer.cpp:80
Definition: AuthServer.cpp:33
bool m_running
true if this server is running
Definition: AuthServer.h:35
bool Run()
Starts this server up, by opening the connection acceptor on given location. This method can be calle...
Definition: AuthServer.cpp:124
void serialize_to(std::ostream &is) override
Definition: AuthServer.cpp:85
void per_thread_shutdown() override
Shuts the server down.
Definition: AuthServer.cpp:144
bool per_thread_startup() override
Definition: AuthServer.cpp:157
ACE_INET_Addr m_location
address this server will bind at.
Definition: AuthServer.h:34
std::unique_ptr< AuthHandler > m_handler
holds the AuthHandler
Definition: AuthServer.h:37
Definition: EventProcessor.h:22
std::unique_ptr< ClientAcceptor > m_acceptor
ace acceptor wrapping AuthClientService
Definition: AuthServer.h:33
~AuthServer() override
Definition: AuthServer.cpp:61
main class of the authentication server, it controls the AuthHandler instances
Definition: AuthServer.h:20
ACE_Thread_Mutex m_mutex
used to prevent multiple threads accessing config reload function
Definition: AuthServer.h:36
#define IMPL_ID(EventProcessorChildType)
Definition: EventProcessor.h:44
bool ReadConfigAndRestart()
Read server configuration.
Definition: AuthServer.cpp:95
Definition: AuthHandler.h:77