2021-12-05 17:54:36 +00:00
|
|
|
#ifndef AUTHPACKETS_H
|
|
|
|
#define AUTHPACKETS_H
|
|
|
|
|
|
|
|
#define _VARIADIC_MAX 10
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
#include "dNetCommon.h"
|
|
|
|
|
2022-11-07 09:27:48 +00:00
|
|
|
enum class ServerType : uint32_t;
|
2023-05-02 22:39:21 +00:00
|
|
|
enum class eLoginResponse : uint8_t;
|
2023-08-05 02:28:07 +00:00
|
|
|
enum class eStamps : uint32_t;
|
2021-12-05 17:54:36 +00:00
|
|
|
class dServer;
|
|
|
|
|
2023-08-05 02:28:07 +00:00
|
|
|
struct Stamp {
|
|
|
|
eStamps type;
|
|
|
|
uint32_t value;
|
|
|
|
uint64_t timestamp;
|
|
|
|
|
|
|
|
Stamp(eStamps type, uint32_t value, uint64_t timestamp){
|
|
|
|
this->type = type;
|
|
|
|
this->value = value;
|
|
|
|
this->timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Serialize(RakNet::BitStream* outBitStream);
|
|
|
|
};
|
|
|
|
|
2023-08-05 03:20:38 +00:00
|
|
|
enum class ClientOS : uint8_t {
|
|
|
|
UNKNOWN,
|
|
|
|
WINDOWS,
|
|
|
|
MACOS
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class LanguageCodeID : uint16_t {
|
|
|
|
en_US = 0x0409,
|
|
|
|
de_DE = 0x0407,
|
|
|
|
en_GB = 0x0809
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class Language : uint32_t {
|
|
|
|
en_US,
|
|
|
|
pl_US,
|
|
|
|
de_DE,
|
|
|
|
en_GB,
|
|
|
|
};
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
namespace AuthPackets {
|
|
|
|
void HandleHandshake(dServer* server, Packet* packet);
|
2022-11-07 09:27:48 +00:00
|
|
|
void SendHandshake(dServer* server, const SystemAddress& sysAddr, const std::string& nextServerIP, uint16_t nextServerPort, const ServerType serverType);
|
2021-12-05 17:54:36 +00:00
|
|
|
void HandleLoginRequest(dServer* server, Packet* packet);
|
|
|
|
void SendLoginResponse(dServer* server, const SystemAddress& sysAddr, eLoginResponse responseCode, const std::string& errorMsg, const std::string& wServerIP, uint16_t wServerPort, std::string username);
|
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
#endif // AUTHPACKETS_H
|