Horizon Official Technical Documentation
AuthSession.hpp
Go to the documentation of this file.
1/***************************************************
2* _ _ _ *
3* | | | | (_) *
4* | |_| | ___ _ __ _ _______ _ __ *
5* | _ |/ _ \| '__| |_ / _ \| '_ \ *
6* | | | | (_) | | | |/ / (_) | | | | *
7* \_| |_/\___/|_| |_/___\___/|_| |_| *
8***************************************************
9* This file is part of Horizon (c).
10*
11* Copyright (c) 2019 Sagun K. (sagunxp@gmail.com).
12* Copyright (c) 2019 Horizon Dev Team.
13*
14* Base Author - Sagun K. (sagunxp@gmail.com)
15*
16* This library is free software; you can redistribute it and/or modify
17* it under the terms of the GNU General Public License as published by
18* the Free Software Foundation, either version 3 of the License, or
19* (at your option) any later version.
20*
21* This library is distributed in the hope that it will be useful,
22* but WITHOUT ANY WARRANTY; without even the implied warranty of
23* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24* GNU General Public License for more details.
25*
26* You should have received a copy of the GNU General Public License
27* along with this library. If not, see <http://www.gnu.org/licenses/>.
28**************************************************/
29#ifndef HORIZON_AUTH_AUTHSESSION_HPP
30#define HORIZON_AUTH_AUTHSESSION_HPP
31
34
35#include <memory>
36
37#if CLIENT_TYPE == 'S'
39#elif CLIENT_TYPE == 'R'
41#elif CLIENT_TYPE == 'Z'
43#elif CLIENT_TYPE == 'M'
45#elif CLIENT_TYPE == 'A'
47#endif
48
49namespace Horizon
50{
51namespace Auth
52{
53class AuthClientInterface;
54class AuthSocket;
55class AuthSession : public Horizon::Networking::Session<AuthSocket, AuthSession>
56{
57public:
58 AuthSession(uint64_t uid);
60
61 /* */
62 void initialize() override;
63 virtual void update(uint32_t diff) override;
64
65 std::unique_ptr<AuthClientInterface> &clif() { return _clif; }
66 std::unique_ptr<ClientPacketLengthTable> &pkt_tbl() { return _pkt_tbl; }
67
68 void transmit_buffer(ByteBuffer _buffer, std::size_t size);
69
70private:
71 std::unique_ptr<AuthClientInterface> _clif;
72 std::unique_ptr<ClientPacketLengthTable> _pkt_tbl;
73};
74}
75}
76#endif /* HORIZON_SESSION_AuthSession_HPP */
Definition: ByteBuffer.hpp:78
Definition: AuthSession.hpp:56
~AuthSession()
Definition: AuthSession.cpp:43
std::unique_ptr< AuthClientInterface > _clif
Definition: AuthSession.hpp:71
void transmit_buffer(ByteBuffer _buffer, std::size_t size)
Definition: AuthSession.cpp:55
std::unique_ptr< ClientPacketLengthTable > & pkt_tbl()
Definition: AuthSession.hpp:66
std::unique_ptr< AuthClientInterface > & clif()
Definition: AuthSession.hpp:65
std::unique_ptr< ClientPacketLengthTable > _pkt_tbl
Definition: AuthSession.hpp:72
AuthSession(uint64_t uid)
Definition: AuthSession.cpp:38
void initialize() override
Definition: AuthSession.cpp:48
virtual void update(uint32_t diff) override
Definition: AuthSession.cpp:92
A Session object that handles a single socket. Sockets are moved into the thread by SocketMgr,...
Definition: Session.hpp:55
Definition: Element.hpp:7