Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
15
struct
Realm
;
16
17
// Handle login commands
18
class
AuthSocket
:
public
RealmSocket::Session
19
{
20
public
:
21
const
static
int
s_BYTE_SIZE
= 32;
22
23
AuthSocket
(
RealmSocket
&
socket
);
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
32
bool
_HandleLogonChallenge
();
33
bool
_HandleLogonProof
();
34
bool
_HandleReconnectChallenge
();
35
bool
_HandleReconnectProof
();
36
bool
_HandleRealmList
();
37
38
//data transfer handle for patch
39
bool
_HandleXferResume
();
40
bool
_HandleXferCancel
();
41
bool
_HandleXferAccept
();
42
43
private
:
44
RealmSocket
&
socket_
;
45
RealmSocket
&
socket
(
void
) {
return
socket_
; }
46
47
std::optional<SkyFire::Crypto::SRP6>
_srp6
;
48
SessionKey
_sessionKey
= {};
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
;
60
uint16
_build
;
61
uint8
_expversion
;
62
AccountTypes
_accountSecurityLevel
;
63
};
64
65
#endif
SessionKey
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
Definition
AuthDefines.h:8
Common.h
AccountTypes
AccountTypes
Definition
Common.h:129
CryptoHash.h
uint8
std::uint8_t uint8
Definition
Define.h:79
uint16
std::uint16_t uint16
Definition
Define.h:78
NetworkAddress.h
RealmSocket.h
SRP6.h
AuthSocket::OnClose
virtual void OnClose(void)
Definition
AuthSocket.cpp:185
AuthSocket::AuthSocket
AuthSocket(RealmSocket &socket)
Definition
AuthSocket.cpp:169
AuthSocket::_build
uint16 _build
Definition
AuthSocket.h:60
AuthSocket::_HandleRealmList
bool _HandleRealmList()
Definition
AuthSocket.cpp:757
AuthSocket::_HandleXferResume
bool _HandleXferResume()
Definition
AuthSocket.cpp:891
AuthSocket::_HandleLogonProof
bool _HandleLogonProof()
Definition
AuthSocket.cpp:465
AuthSocket::OnAccept
virtual void OnAccept(void)
Definition
AuthSocket.cpp:179
AuthSocket::_srp6
std::optional< SkyFire::Crypto::SRP6 > _srp6
Definition
AuthSocket.h:47
AuthSocket::_HandleReconnectChallenge
bool _HandleReconnectChallenge()
Definition
AuthSocket.cpp:631
AuthSocket::_accountSecurityLevel
AccountTypes _accountSecurityLevel
Definition
AuthSocket.h:62
AuthSocket::_HandleXferAccept
bool _HandleXferAccept()
Definition
AuthSocket.cpp:928
AuthSocket::GetAddressForClient
static Skyfire::Net::Address const & GetAddressForClient(Realm const &realm, Skyfire::Net::Address const &clientAddr)
Definition
AuthSocket.cpp:734
AuthSocket::_HandleXferCancel
bool _HandleXferCancel()
Definition
AuthSocket.cpp:912
AuthSocket::s_BYTE_SIZE
static const int s_BYTE_SIZE
Definition
AuthSocket.h:21
AuthSocket::_HandleLogonChallenge
bool _HandleLogonChallenge()
Definition
AuthSocket.cpp:245
AuthSocket::_expversion
uint8 _expversion
Definition
AuthSocket.h:61
AuthSocket::_os
std::string _os
Definition
AuthSocket.h:59
AuthSocket::OnRead
virtual void OnRead(void)
Definition
AuthSocket.cpp:191
AuthSocket::_sessionKey
SessionKey _sessionKey
Definition
AuthSocket.h:48
AuthSocket::~AuthSocket
virtual ~AuthSocket(void)
Definition
AuthSocket.cpp:176
AuthSocket::socket
RealmSocket & socket(void)
Definition
AuthSocket.h:45
AuthSocket::_tokenKey
std::string _tokenKey
Definition
AuthSocket.h:54
AuthSocket::_reconnectProof
std::array< uint8, 16 > _reconnectProof
Definition
AuthSocket.h:49
AuthSocket::_login
std::string _login
Definition
AuthSocket.h:53
AuthSocket::_HandleReconnectProof
bool _HandleReconnectProof()
Definition
AuthSocket.cpp:693
AuthSocket::socket_
RealmSocket & socket_
Definition
AuthSocket.h:44
AuthSocket::_authed
bool _authed
Definition
AuthSocket.h:51
AuthSocket::_localizationName
std::string _localizationName
Definition
AuthSocket.h:58
RealmSocket::Session
Definition
RealmSocket.h:26
RealmSocket
Definition
RealmSocket.h:23
Skyfire::Net::Address
Definition
NetworkAddress.h:18
Realm
Definition
RealmList.h:28
src
server
authserver
Server
AuthSocket.h
Generated on
for Project SkyFire Core by
1.17.0