Horizon Official Technical Documentation
ClientPacketLengthTable.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 * Copyright (c) 2023 Horizon Dev Team.
11 *
12 * Base Author - Sephus. (sagunxp@gmail.com)
13 *
14 * This library is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this library. If not, see <http://www.gnu.org/licenses/>.
26 **************************************************/
27
28#ifndef HORIZON_AUTH_CLIENT_PACKET_LENGTH_TABLE
29#define HORIZON_AUTH_CLIENT_PACKET_LENGTH_TABLE
30
31#include "PacketLengthTable.hpp"
32
33namespace Horizon
34{
35namespace Auth
36{
40class ClientPacketLengthTable : public PacketLengthTable
41{
42public:
43 ClientPacketLengthTable(std::shared_ptr<AuthSession> s)
45 {
46#define ADD_HPKT(i, j, k) _hpacket_length_table.insert(i, std::make_pair(j, std::make_shared<k>(s)))
47#define ADD_TPKT(i, j, k) _tpacket_length_table.insert(i, std::make_pair(j, std::make_shared<k>(s)))
48// Packet Version 20090701: 1 Packets
49#if PACKET_VERSION >= 20090701
50 ADD_TPKT(0x0276, -1, AC_ACCEPT_LOGIN2);
51#endif
52// Packet Version 20100413: 3 Packets
53#if PACKET_VERSION >= 20100413
54 ADD_TPKT(0x0823, -1, AC_OTP_AUTH_ACK);
55 ADD_TPKT(0x0821, 2, AC_OTP_USER);
56 ADD_HPKT(0x0822, 9, CA_OTP_AUTH_REQ);
57#endif
58// Packet Version 20100601: 2 Packets
59#if PACKET_VERSION >= 20100601
60 ADD_TPKT(0x0826, 4, AC_SSO_LOGIN_ACK);
61 ADD_HPKT(0x0825, -1, CA_SSO_LOGIN_REQ);
62#endif
63// Packet Version 20100615: 1 Packets
64#if PACKET_VERSION >= 20100615
65 ADD_TPKT(0x083e, 26, AC_REFUSE_LOGIN2);
66#endif
67// Packet Version 20101228: 1 Packets
68#if PACKET_VERSION >= 20101228
69 ADD_TPKT(0x08b2, -1, AC_REALNAME_AUTH);
70#endif
71// Packet Version 20110726: 1 Packets
72#if PACKET_VERSION >= 20110726
73 ADD_HPKT(0x08cc, 109, CA_LOGIN5);
74#endif
75// Packet Version 20111025: 1 Packets
76#if PACKET_VERSION >= 20111025
77 ADD_TPKT(0x08e4, 6, AC_SHUTDOWN_INFO);
78#endif
79// Packet Version 20120626: 1 Packets
80#if PACKET_VERSION >= 20120626
81 ADD_TPKT(0x0986, 10, AC_SHUTDOWN_NOTIFY);
82#endif
83// Packet Version 20120702: 1 Packets
84#if PACKET_VERSION >= 20120702
85 ADD_HPKT(0x0987, 63, CA_LOGIN6);
86#endif
87// Packet Version 20120716: 2 Packets
88#if PACKET_VERSION >= 20120716
89 ADD_TPKT(0x098b, 2, AC_REQ_NEW_USER);
90 ADD_HPKT(0x098c, 4, CA_ACK_NEW_USER);
91#endif
92// Packet Version 20130130: 2 Packets
93#if PACKET_VERSION >= 20130130
94 ADD_TPKT(0x09a2, 6, AC_REQ_MOBILE_OTP);
95 ADD_HPKT(0x09a3, -1, CA_ACK_MOBILE_OTP);
96#endif
97// Packet Version 20130220: 1 Packets
98#if PACKET_VERSION >= 20130220
99 ADD_TPKT(0x09a5, 7, AC_REFUSE_LOGIN3);
100#endif
101// Packet Version 20130605: 1 Packets
102#if PACKET_VERSION >= 20130605
103 ADD_HPKT(0x09c8, -1, CA_LOGIN_OTP);
104#endif
105// Packet Version 20170228: 1 Packets
106#if PACKET_VERSION >= 20170228
107 ADD_TPKT(0x0ac4, -1, AC_ACCEPT_LOGIN);
108#endif
109// Packet Version 20170614: 1 Packets
110#if PACKET_VERSION >= 20170614
111 ADD_HPKT(0x0ad0, 11, CA_OTP_CODE);
112#endif
113// Packet Version 20171115: 1 Packets
114#if PACKET_VERSION >= 20171115
115 ADD_HPKT(0x0acf, 68, CA_LOGIN_OTP);
116#endif
117// Packet Version 20171213: 1 Packets
118#if PACKET_VERSION >= 20171213
119 ADD_TPKT(0x0ae3, -1, AC_LOGIN_OTP);
120#endif
121// Packet Version 20180704: 1 Packets
122#if PACKET_VERSION >= 20180704
123 ADD_TPKT(0x0b02, 26, AC_REFUSE_LOGIN4);
124#endif
125#undef ADD_TPKT
126#undef ADD_HPKT
127 }
128
130
131};
132}
133}
134#endif /* HORIZON_AUTH_CLIENT_PACKET_LENGTH_TABLE */
#define ADD_HPKT(i, j, k)
#define ADD_TPKT(i, j, k)
Main object for the aegis packet: AC_ACCEPT_LOGIN2.
Definition: TransmittedPackets.hpp:138
Main object for the aegis packet: AC_ACCEPT_LOGIN.
Definition: TransmittedPackets.hpp:104
Main object for the aegis packet: AC_LOGIN_OTP.
Definition: TransmittedPackets.hpp:673
Main object for the aegis packet: AC_OTP_AUTH_ACK.
Definition: TransmittedPackets.hpp:752
Main object for the aegis packet: AC_OTP_USER.
Definition: TransmittedPackets.hpp:784
Main object for the aegis packet: AC_REALNAME_AUTH.
Definition: TransmittedPackets.hpp:816
Main object for the aegis packet: AC_REFUSE_LOGIN2.
Definition: TransmittedPackets.hpp:915
Main object for the aegis packet: AC_REFUSE_LOGIN3.
Definition: TransmittedPackets.hpp:947
Main object for the aegis packet: AC_REFUSE_LOGIN4.
Definition: TransmittedPackets.hpp:979
Main object for the aegis packet: AC_REQ_MOBILE_OTP.
Definition: TransmittedPackets.hpp:1201
Main object for the aegis packet: AC_REQ_NEW_USER.
Definition: TransmittedPackets.hpp:1233
Main object for the aegis packet: AC_SHUTDOWN_INFO.
Definition: TransmittedPackets.hpp:1265
Main object for the aegis packet: AC_SHUTDOWN_NOTIFY.
Definition: TransmittedPackets.hpp:1297
Main object for the aegis packet: AC_SSO_LOGIN_ACK.
Definition: TransmittedPackets.hpp:1326
Main object for the aegis packet: CA_ACK_MOBILE_OTP.
Definition: HandledPackets.hpp:210
Main object for the aegis packet: CA_ACK_NEW_USER.
Definition: HandledPackets.hpp:242
Main object for the aegis packet: CA_LOGIN5.
Definition: HandledPackets.hpp:545
Main object for the aegis packet: CA_LOGIN6.
Definition: HandledPackets.hpp:577
Main object for the aegis packet: CA_LOGIN_OTP.
Definition: HandledPackets.hpp:656
Main object for the aegis packet: CA_OTP_AUTH_REQ.
Definition: HandledPackets.hpp:726
Main object for the aegis packet: CA_OTP_CODE.
Definition: HandledPackets.hpp:758
Main object for the aegis packet: CA_SSO_LOGIN_REQ.
Definition: HandledPackets.hpp:904
ClientPacketLengthTable(std::shared_ptr< AuthSession > s)
Definition: ClientPacketLengthTable.hpp:43
~ClientPacketLengthTable()
Definition: ClientPacketLengthTable.hpp:129
Auto-generated with a python generator tool authored by Sephus (sagunxp@gmail.com).
Definition: PacketLengthTable.hpp:47
Definition: Element.hpp:7