Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
AuthSocket.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_AUTHSOCKET_H
7#define SF_AUTHSOCKET_H
8
9#include "CryptoHash.h"
10#include "Common.h"
11#include "NetworkAddress.h"
12#include "RealmSocket.h"
13#include "SRP6.h"
14
15struct Realm;
16
17// Handle login commands
19{
20public:
21 const static int s_BYTE_SIZE = 32;
22
24 virtual ~AuthSocket(void);
25
26 virtual void OnRead(void);
27 virtual void OnAccept(void);
28 virtual void OnClose(void);
29
30 static Skyfire::Net::Address const& GetAddressForClient(Realm const& realm, Skyfire::Net::Address const& clientAddr);
31
33 bool _HandleLogonProof();
36 bool _HandleRealmList();
37
38 //data transfer handle for patch
39 bool _HandleXferResume();
40 bool _HandleXferCancel();
41 bool _HandleXferAccept();
42
43private:
45 RealmSocket& socket(void) { return socket_; }
46
47 std::optional<SkyFire::Crypto::SRP6> _srp6;
49 std::array<uint8, 16> _reconnectProof = {};
50
51 bool _authed;
52
53 std::string _login;
54 std::string _tokenKey;
55
56 // Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
57 // between enUS and enGB, which is important for the patch system
58 std::string _localizationName;
59 std::string _os;
63};
64
65#endif
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
Definition AuthDefines.h:8
AccountTypes
Definition Common.h:129
std::uint8_t uint8
Definition Define.h:79
std::uint16_t uint16
Definition Define.h:78
virtual void OnClose(void)
AuthSocket(RealmSocket &socket)
uint16 _build
Definition AuthSocket.h:60
bool _HandleRealmList()
bool _HandleXferResume()
bool _HandleLogonProof()
virtual void OnAccept(void)
std::optional< SkyFire::Crypto::SRP6 > _srp6
Definition AuthSocket.h:47
bool _HandleReconnectChallenge()
AccountTypes _accountSecurityLevel
Definition AuthSocket.h:62
bool _HandleXferAccept()
static Skyfire::Net::Address const & GetAddressForClient(Realm const &realm, Skyfire::Net::Address const &clientAddr)
bool _HandleXferCancel()
static const int s_BYTE_SIZE
Definition AuthSocket.h:21
bool _HandleLogonChallenge()
uint8 _expversion
Definition AuthSocket.h:61
std::string _os
Definition AuthSocket.h:59
virtual void OnRead(void)
SessionKey _sessionKey
Definition AuthSocket.h:48
virtual ~AuthSocket(void)
RealmSocket & socket(void)
Definition AuthSocket.h:45
std::string _tokenKey
Definition AuthSocket.h:54
std::array< uint8, 16 > _reconnectProof
Definition AuthSocket.h:49
std::string _login
Definition AuthSocket.h:53
bool _HandleReconnectProof()
RealmSocket & socket_
Definition AuthSocket.h:44
bool _authed
Definition AuthSocket.h:51
std::string _localizationName
Definition AuthSocket.h:58