Compare commits

..

2 Commits

Author SHA1 Message Date
Xiphoseer
b78ece8919 wip: Http Client experiments 2024-05-01 23:41:59 +02:00
Xiphoseer
776a9c36a4 wip: test chat client 2024-05-01 22:34:01 +02:00
270 changed files with 1976 additions and 3223 deletions

View File

@@ -1,11 +1,5 @@
cmake_minimum_required(VERSION 3.25)
project(Darkflame)
# check if the path to the source directory contains a space
if("${CMAKE_SOURCE_DIR}" MATCHES " ")
message(FATAL_ERROR "The server cannot build in the path (" ${CMAKE_SOURCE_DIR} ") because it contains a space. Please move the server to a path without spaces.")
endif()
include(CTest)
set(CMAKE_CXX_STANDARD 20)
@@ -102,6 +96,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
find_package(MariaDB)
find_package(JSON)
# Create a /resServer directory
make_directory(${CMAKE_BINARY_DIR}/resServer)
@@ -290,7 +285,7 @@ add_subdirectory(dPhysics)
add_subdirectory(dServer)
# Create a list of common libraries shared between all binaries
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum")
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum" "nlohmann_json::nlohmann_json")
# Add platform specific common libraries
if(UNIX)
@@ -306,6 +301,7 @@ add_subdirectory(dWorldServer)
add_subdirectory(dAuthServer)
add_subdirectory(dChatServer)
add_subdirectory(dMasterServer) # Add MasterServer last so it can rely on the other binaries
add_subdirectory(dChatClient)
target_precompile_headers(
dZoneManager PRIVATE

View File

@@ -1,6 +1,6 @@
PROJECT_VERSION_MAJOR=2
PROJECT_VERSION_MINOR=3
PROJECT_VERSION_PATCH=0
PROJECT_VERSION_MAJOR=1
PROJECT_VERSION_MINOR=1
PROJECT_VERSION_PATCH=1
# Debugging
# Set DYNAMIC to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs.

View File

@@ -31,7 +31,7 @@ COPY --from=build /app/build/*Server /app/
# Necessary suplimentary files
COPY --from=build /app/build/*.ini /app/configs/
COPY --from=build /app/build/vanity/*.* /app/vanity/
COPY --from=build /app/build/vanity/*.* /app/vanity/*
COPY --from=build /app/build/navmeshes /app/navmeshes
COPY --from=build /app/build/migrations /app/migrations
COPY --from=build /app/build/*.dcf /app/
@@ -39,7 +39,7 @@ COPY --from=build /app/build/*.dcf /app/
# backup of config and vanity files to copy to the host incase
# of a mount clobbering the copy from above
COPY --from=build /app/build/*.ini /app/default-configs/
COPY --from=build /app/build/vanity/*.* /app/default-vanity/
COPY --from=build /app/build/vanity/*.* /app/default-vanity/*
# needed as the container runs with the root user
# and therefore sudo doesn't exist

20
cmake/FindJSON.cmake Normal file
View File

@@ -0,0 +1,20 @@
include(FetchContent)
message(STATUS "Fetching json...")
FetchContent_Declare(
json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(json)
message(STATUS "json fetched and is now ready.")
set(JSON_FOUND TRUE)

View File

@@ -0,0 +1,5 @@
add_executable(ChatClient ChatClient.cpp)
target_link_libraries(ChatClient raknet dCommon)
add_executable(ChatHttpClient ChatHttpClient.cpp)
target_link_libraries(ChatHttpClient raknet dCommon)

View File

@@ -0,0 +1,93 @@
#include <iostream>
#include <RakPeerInterface.h>
#include <RakNetworkFactory.h>
#include <MessageIdentifiers.h>
#include <BitStream.h>
#include "eConnectionType.h"
#include "eChatMessageType.h"
#include "dCommonVars.h"
static constexpr uint16_t CHAT_PORT = 2005;
static const char PASS_INTERNAL[16] = "3.25 DARKFLAME1";
static const char PASS_EXTERNAL[9] = "3.25 ND1";
int main(int argc, const char** argv) {
std::cout << "Hello World!" << std::endl;
SocketDescriptor socketDescriptor(0, 0);
RakPeerInterface* peer = RakNetworkFactory::GetRakPeerInterface();
uint16_t maxConnections = 1; // one outgoing
bool useEncryption = true;
if (!peer) {
std::cerr << "Failed to get RakPeer interface!" << std::endl;
return 1;
}
if (!peer->Startup(maxConnections, 10, &socketDescriptor, 1)) {
std::cerr << "Failed to startup rak peer interface!" << std::endl;
return 1;
}
if (useEncryption) peer->InitializeSecurity(NULL, NULL, NULL, NULL);
if (!peer->Connect("localhost", CHAT_PORT, PASS_EXTERNAL, 8)) {
std::cerr << "Failed to initiate connection to chat server" << std::endl;
return 1;
}
// Establish connection
Packet* packet;
bool connected = false;
SystemAddress remote;
while (!connected) {
packet = peer->Receive();
if (!packet) continue;
uint8_t packet_id = packet->data[0];
switch (packet_id) {
case ID_INVALID_PASSWORD:
std::cerr << "Password invalid" << std::endl;
return 1;
case ID_CONNECTION_REQUEST_ACCEPTED:
std::cout << "Connection accepted" << std::endl;
remote = packet->systemAddress;
connected = true;
break;
default:
std::cout << "Packet: " << static_cast<uint32_t>(packet_id) << std::endl;
}
peer->DeallocatePacket(packet);
}
std::cout << "Starting tests" << std::endl;
//Notify chat about it
CBITSTREAM;
BitStreamUtils::WriteHeader(bitStream, eConnectionType::CHAT, eChatMessageType::GM_ANNOUNCE);
std::string title = "My Title";
std::string message = "My Message";
bitStream.Write<uint32_t>(title.size());
bitStream.Write(title.c_str(), title.size());
bitStream.Write<uint32_t>(message.size());
bitStream.Write(message.c_str(), message.size());
peer->Send(&bitStream, SYSTEM_PRIORITY, RELIABLE, 0, remote, false);
while (true) {
packet = peer->Receive();
if (!packet) continue;
uint8_t packet_id = packet->data[0];
switch (packet_id) {
default:
std::cout << "Packet: " << static_cast<uint32_t>(packet_id) << std::endl;
}
peer->DeallocatePacket(packet);
}
return 0;
}

View File

@@ -0,0 +1,32 @@
#include <iostream>
#include <TCPInterface.h>
#include <HTTPConnection.h>
#include <RakSleep.h>
int main(int argc, const char** argv) {
std::cout << "Hello World!" << std::endl;
TCPInterface tcp;
if (!tcp.Start(0, 0)) {
std::cerr << "Failed to start TCP Interface" << std::endl;
return 1;
}
SystemAddress addr = tcp.Connect("127.0.0.1", 8000);
std::cout << "addr: " << addr.ToString() << std::endl;
std::string req = "\
GET /helloFromRakNet.txt HTTP/1.1\r\n\
User-Agent: raknet / 3.25\r\n\
\r\n";
std::cout << req;
tcp.Send(req.c_str(), req.size(), addr);
RakSleep(500);
tcp.CloseConnection(addr);
return 0;
}

View File

@@ -1,5 +1,5 @@
#ifndef CHATIGNORELIST_H
#define CHATIGNORELIST_H
#ifndef __CHATIGNORELIST__H__
#define __CHATIGNORELIST__H__
struct Packet;
@@ -24,4 +24,4 @@ namespace ChatIgnoreList {
};
};
#endif //!CHATIGNORELIST_H
#endif //!__CHATIGNORELIST__H__

View File

@@ -355,6 +355,18 @@ void ChatPacketHandler::HandleGMLevelUpdate(Packet* packet) {
inStream.Read(player.gmLevel);
}
void ChatPacketHandler::HandleGMAnnounce(Packet* packet) {
CINSTREAM_SKIP_HEADER;
uint32_t titleLen, messageLen;
inStream.Read(titleLen);
std::string title(titleLen, 0);
inStream.Read(title.data(), titleLen);
inStream.Read(messageLen);
std::string message(messageLen, 0);
inStream.Read(message.data(), messageLen);
LOG("GM Announcement from %s: '%s' '%s'", packet->systemAddress.ToString(), title.c_str(), message.c_str());
}
void ChatPacketHandler::HandleWho(Packet* packet) {
CINSTREAM_SKIP_HEADER;

View File

@@ -50,6 +50,7 @@ namespace ChatPacketHandler {
void HandleFriendResponse(Packet* packet);
void HandleRemoveFriend(Packet* packet);
void HandleGMLevelUpdate(Packet* packet);
void HandleGMAnnounce(Packet* packet);
void HandleWho(Packet* packet);
void HandleShowAll(Packet* packet);

View File

@@ -122,10 +122,13 @@ int main(int argc, char** argv) {
uint32_t framesSinceMasterDisconnect = 0;
uint32_t framesSinceLastSQLPing = 0;
// Independant chat server
bool isStandalone = argc > 1 && strcmp(argv[1], "--standalone") == 0;
Game::logger->Flush(); // once immediately before main loop
while (!Game::ShouldShutdown()) {
//Check if we're still connected to master:
if (!Game::server->GetIsConnectedToMaster()) {
if (!isStandalone && !Game::server->GetIsConnectedToMaster()) {
framesSinceMasterDisconnect++;
if (framesSinceMasterDisconnect >= chatFramerate)
@@ -179,7 +182,6 @@ int main(int argc, char** argv) {
}
void HandlePacket(Packet* packet) {
if (packet->length < 1) return;
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
LOG("A server has disconnected, erasing their connected players from the list.");
} else if (packet->data[0] == ID_NEW_INCOMING_CONNECTION) {
@@ -282,6 +284,7 @@ void HandlePacket(Packet* packet) {
break;
case eChatMessageType::GM_ANNOUNCE:{
// we just forward this packet to every connected server
ChatPacketHandler::HandleGMAnnounce(packet);
inStream.ResetReadPointer();
Game::server->Send(inStream, packet->systemAddress, true); // send to everyone except origin
}

View File

@@ -36,19 +36,16 @@ void PlayerContainer::InsertPlayer(Packet* packet) {
data.playerID = playerId;
uint32_t len;
if (!inStream.Read<uint32_t>(len)) return;
inStream.Read<uint32_t>(len);
if (len > 33) {
LOG("Received a really long player name, probably a fake packet %i.", len);
return;
for (int i = 0; i < len; i++) {
char character; inStream.Read<char>(character);
data.playerName += character;
}
data.playerName.resize(len);
inStream.ReadAlignedBytes(reinterpret_cast<unsigned char*>(data.playerName.data()), len);
if (!inStream.Read(data.zoneID)) return;
if (!inStream.Read(data.muteExpire)) return;
if (!inStream.Read(data.gmLevel)) return;
inStream.Read(data.zoneID);
inStream.Read(data.muteExpire);
inStream.Read(data.gmLevel);
data.sysAddr = packet->systemAddress;
m_Names[data.playerID] = GeneralUtils::UTF8ToUTF16(data.playerName);
@@ -125,11 +122,6 @@ void PlayerContainer::CreateTeamServer(Packet* packet) {
size_t membersSize = 0;
inStream.Read(membersSize);
if (membersSize >= 4) {
LOG("Tried to create a team with more than 4 players");
return;
}
std::vector<LWOOBJID> members;
members.reserve(membersSize);

View File

@@ -1,5 +1,5 @@
#ifndef AMF3_H
#define AMF3_H
#ifndef __AMF3__H__
#define __AMF3__H__
#include "dCommonVars.h"
#include "Logger.h"
@@ -377,4 +377,4 @@ private:
AMFDense m_Dense;
};
#endif //!AMF3_H
#endif //!__AMF3__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef BINARYIO_H
#define BINARYIO_H
#ifndef __BINARYIO__H__
#define __BINARYIO__H__
#include <iostream>
#include <fstream>
@@ -71,4 +71,4 @@ namespace BinaryIO {
}
}
#endif //!BINARYIO_H
#endif //!__BINARYIO__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef BINARYPATHFINDER_H
#define BINARYPATHFINDER_H
#ifndef __BINARYPATHFINDER__H__
#define __BINARYPATHFINDER__H__
#include <filesystem>
@@ -12,4 +12,4 @@ public:
static std::filesystem::path GetBinaryDir();
};
#endif //!BINARYPATHFINDER_H
#endif //!__BINARYPATHFINDER__H__

View File

@@ -1,5 +1,5 @@
#ifndef BRICK_H
#define BRICK_H
#ifndef __BRICK__H__
#define __BRICK__H__
#include <cstdint>
@@ -8,4 +8,4 @@ struct Brick {
uint32_t materialID;
};
#endif //!BRICK_H
#endif //!__BRICK__H__

View File

@@ -201,7 +201,7 @@ void OnTerminate() {
}
void MakeBacktrace() {
struct sigaction sigact{};
struct sigaction sigact;
sigact.sa_sigaction = CritErrHdlr;
sigact.sa_flags = SA_RESTART | SA_SIGINFO;

View File

@@ -1,5 +1,5 @@
#ifndef DLUASSERT_H
#define DLUASSERT_H
#ifndef __DLUASSERT__H__
#define __DLUASSERT__H__
#include <assert.h>
@@ -9,4 +9,4 @@
# define DluAssert(expression)
#endif
#endif //!DLUASSERT_H
#endif //!__DLUASSERT__H__

View File

@@ -1,5 +1,5 @@
#ifndef FDBTOSQLITE_H
#define FDBTOSQLITE_H
#ifndef __FDBTOSQLITE__H__
#define __FDBTOSQLITE__H__
#pragma once
@@ -142,4 +142,4 @@ namespace FdbToSqlite {
}; //! class FdbToSqlite
}; //! namespace FdbToSqlite
#endif //!FDBTOSQLITE_H
#endif //!__FDBTOSQLITE__H__

View File

@@ -1,5 +1,5 @@
#ifndef LDFFORMAT_H
#define LDFFORMAT_H
#ifndef __LDFFORMAT__H__
#define __LDFFORMAT__H__
// Custom Classes
#include "dCommonVars.h"
@@ -31,22 +31,22 @@ public:
virtual ~LDFBaseData() {}
virtual void WriteToPacket(RakNet::BitStream& packet) const = 0;
virtual void WriteToPacket(RakNet::BitStream& packet) = 0;
virtual const std::u16string& GetKey() const = 0;
virtual const std::u16string& GetKey() = 0;
virtual eLDFType GetValueType() const = 0;
virtual eLDFType GetValueType() = 0;
/** Gets a string from the key/value pair
* @param includeKey Whether or not to include the key in the data
* @param includeTypeId Whether or not to include the type id in the data
* @return The string representation of the data
*/
virtual std::string GetString(bool includeKey = true, bool includeTypeId = true) const = 0;
virtual std::string GetString(bool includeKey = true, bool includeTypeId = true) = 0;
virtual std::string GetValueAsString() const = 0;
virtual std::string GetValueAsString() = 0;
virtual LDFBaseData* Copy() const = 0;
virtual LDFBaseData* Copy() = 0;
/**
* Given an input string, return the data as a LDF key.
@@ -62,7 +62,7 @@ private:
T value;
//! Writes the key to the packet
void WriteKey(RakNet::BitStream& packet) const {
void WriteKey(RakNet::BitStream& packet) {
packet.Write<uint8_t>(this->key.length() * sizeof(uint16_t));
for (uint32_t i = 0; i < this->key.length(); ++i) {
packet.Write<uint16_t>(this->key[i]);
@@ -70,7 +70,7 @@ private:
}
//! Writes the value to the packet
void WriteValue(RakNet::BitStream& packet) const {
void WriteValue(RakNet::BitStream& packet) {
packet.Write<uint8_t>(this->GetValueType());
packet.Write(this->value);
}
@@ -90,7 +90,7 @@ public:
/*!
\return The value
*/
const T& GetValue(void) const { return this->value; }
const T& GetValue(void) { return this->value; }
//! Sets the value
/*!
@@ -102,13 +102,13 @@ public:
/*!
\return The value string
*/
std::string GetValueString(void) const { return ""; }
std::string GetValueString(void) { return ""; }
//! Writes the data to a packet
/*!
\param packet The packet
*/
void WriteToPacket(RakNet::BitStream& packet) const override {
void WriteToPacket(RakNet::BitStream& packet) override {
this->WriteKey(packet);
this->WriteValue(packet);
}
@@ -117,13 +117,13 @@ public:
/*!
\return The key
*/
const std::u16string& GetKey(void) const override { return this->key; }
const std::u16string& GetKey(void) override { return this->key; }
//! Gets the LDF Type
/*!
\return The LDF value type
*/
eLDFType GetValueType(void) const override { return LDF_TYPE_UNKNOWN; }
eLDFType GetValueType(void) override { return LDF_TYPE_UNKNOWN; }
//! Gets the string data
/*!
@@ -131,7 +131,7 @@ public:
\param includeTypeId Whether or not to include the type id in the data
\return The string representation of the data
*/
std::string GetString(const bool includeKey = true, const bool includeTypeId = true) const override {
std::string GetString(const bool includeKey = true, const bool includeTypeId = true) override {
if (GetValueType() == -1) {
return GeneralUtils::UTF16ToWTF8(this->key) + "=-1:<server variable>";
}
@@ -154,11 +154,11 @@ public:
return stream.str();
}
std::string GetValueAsString() const override {
std::string GetValueAsString() override {
return this->GetValueString();
}
LDFBaseData* Copy() const override {
LDFBaseData* Copy() override {
return new LDFData<T>(key, value);
}
@@ -166,19 +166,19 @@ public:
};
// LDF Types
template<> inline eLDFType LDFData<std::u16string>::GetValueType(void) const { return LDF_TYPE_UTF_16; };
template<> inline eLDFType LDFData<int32_t>::GetValueType(void) const { return LDF_TYPE_S32; };
template<> inline eLDFType LDFData<float>::GetValueType(void) const { return LDF_TYPE_FLOAT; };
template<> inline eLDFType LDFData<double>::GetValueType(void) const { return LDF_TYPE_DOUBLE; };
template<> inline eLDFType LDFData<uint32_t>::GetValueType(void) const { return LDF_TYPE_U32; };
template<> inline eLDFType LDFData<bool>::GetValueType(void) const { return LDF_TYPE_BOOLEAN; };
template<> inline eLDFType LDFData<uint64_t>::GetValueType(void) const { return LDF_TYPE_U64; };
template<> inline eLDFType LDFData<LWOOBJID>::GetValueType(void) const { return LDF_TYPE_OBJID; };
template<> inline eLDFType LDFData<std::string>::GetValueType(void) const { return LDF_TYPE_UTF_8; };
template<> inline eLDFType LDFData<std::u16string>::GetValueType(void) { return LDF_TYPE_UTF_16; };
template<> inline eLDFType LDFData<int32_t>::GetValueType(void) { return LDF_TYPE_S32; };
template<> inline eLDFType LDFData<float>::GetValueType(void) { return LDF_TYPE_FLOAT; };
template<> inline eLDFType LDFData<double>::GetValueType(void) { return LDF_TYPE_DOUBLE; };
template<> inline eLDFType LDFData<uint32_t>::GetValueType(void) { return LDF_TYPE_U32; };
template<> inline eLDFType LDFData<bool>::GetValueType(void) { return LDF_TYPE_BOOLEAN; };
template<> inline eLDFType LDFData<uint64_t>::GetValueType(void) { return LDF_TYPE_U64; };
template<> inline eLDFType LDFData<LWOOBJID>::GetValueType(void) { return LDF_TYPE_OBJID; };
template<> inline eLDFType LDFData<std::string>::GetValueType(void) { return LDF_TYPE_UTF_8; };
// The specialized version for std::u16string (UTF-16)
template<>
inline void LDFData<std::u16string>::WriteValue(RakNet::BitStream& packet) const {
inline void LDFData<std::u16string>::WriteValue(RakNet::BitStream& packet) {
packet.Write<uint8_t>(this->GetValueType());
packet.Write<uint32_t>(this->value.length());
@@ -189,7 +189,7 @@ inline void LDFData<std::u16string>::WriteValue(RakNet::BitStream& packet) const
// The specialized version for bool
template<>
inline void LDFData<bool>::WriteValue(RakNet::BitStream& packet) const {
inline void LDFData<bool>::WriteValue(RakNet::BitStream& packet) {
packet.Write<uint8_t>(this->GetValueType());
packet.Write<uint8_t>(this->value);
@@ -197,7 +197,7 @@ inline void LDFData<bool>::WriteValue(RakNet::BitStream& packet) const {
// The specialized version for std::string (UTF-8)
template<>
inline void LDFData<std::string>::WriteValue(RakNet::BitStream& packet) const {
inline void LDFData<std::string>::WriteValue(RakNet::BitStream& packet) {
packet.Write<uint8_t>(this->GetValueType());
packet.Write<uint32_t>(this->value.length());
@@ -206,18 +206,18 @@ inline void LDFData<std::string>::WriteValue(RakNet::BitStream& packet) const {
}
}
template<> inline std::string LDFData<std::u16string>::GetValueString() const {
template<> inline std::string LDFData<std::u16string>::GetValueString() {
return GeneralUtils::UTF16ToWTF8(this->value, this->value.size());
}
template<> inline std::string LDFData<int32_t>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<float>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<double>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<uint32_t>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<bool>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<uint64_t>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<LWOOBJID>::GetValueString() const { return std::to_string(this->value); }
template<> inline std::string LDFData<int32_t>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<float>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<double>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<uint32_t>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<bool>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<uint64_t>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<LWOOBJID>::GetValueString() { return std::to_string(this->value); }
template<> inline std::string LDFData<std::string>::GetValueString() const { return this->value; }
template<> inline std::string LDFData<std::string>::GetValueString() { return this->value; }
#endif //!LDFFORMAT_H
#endif //!__LDFFORMAT__H__

View File

@@ -1,5 +1,5 @@
#ifndef NIPOINT3_H
#define NIPOINT3_H
#ifndef __NIPOINT3_H__
#define __NIPOINT3_H__
/*!
\file NiPoint3.hpp
@@ -201,4 +201,4 @@ namespace NiPoint3Constant {
// .inl file needed for code organization and to circumvent circular dependency issues
#include "NiPoint3.inl"
#endif // !NIPOINT3_H
#endif // !__NIPOINT3_H__

View File

@@ -1,5 +1,5 @@
#pragma once
#ifndef NIPOINT3_H
#ifndef __NIPOINT3_H__
#error "This should only be included inline in NiPoint3.h: Do not include directly!"
#endif

View File

@@ -1,5 +1,5 @@
#ifndef NIQUATERNION_H
#define NIQUATERNION_H
#ifndef __NIQUATERNION_H__
#define __NIQUATERNION_H__
// Custom Classes
#include "NiPoint3.h"
@@ -155,4 +155,4 @@ namespace NiQuaternionConstant {
// Include constexpr and inline function definitions in a seperate file for readability
#include "NiQuaternion.inl"
#endif // !NIQUATERNION_H
#endif // !__NIQUATERNION_H__

View File

@@ -1,5 +1,5 @@
#pragma once
#ifndef NIQUATERNION_H
#ifndef __NIQUATERNION_H__
#error "This should only be included inline in NiQuaternion.h: Do not include directly!"
#endif

View File

@@ -1,5 +1,5 @@
#ifndef POSITIONUPDATE_H
#define POSITIONUPDATE_H
#ifndef __POSITIONUPDATE__H__
#define __POSITIONUPDATE__H__
#include "NiPoint3.h"
#include "NiQuaternion.h"
@@ -33,4 +33,4 @@ struct PositionUpdate {
RemoteInputInfo remoteInputInfo;
};
#endif //!POSITIONUPDATE_H
#endif //!__POSITIONUPDATE__H__

View File

@@ -1,5 +1,5 @@
#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
#ifndef __CLIENTVERSION_H__
#define __CLIENTVERSION_H__
#include <cstdint>
@@ -9,4 +9,4 @@ namespace ClientVersion {
constexpr uint16_t minor = 64;
}
#endif // !CLIENTVERSION_H
#endif // !__CLIENTVERSION_H__

View File

@@ -1,7 +1,6 @@
#include "dConfig.h"
#include <sstream>
#include <algorithm>
#include "BinaryPathFinder.h"
#include "GeneralUtils.h"

View File

@@ -1,5 +1,5 @@
#ifndef STRINGIFIEDENUM_H
#define STRINGIFIEDENUM_H
#ifndef __STRINGIFIEDENUM_H__
#define __STRINGIFIEDENUM_H__
#include <string>
#include "magic_enum.hpp"
@@ -26,4 +26,4 @@ namespace StringifiedEnum {
}
}
#endif // !STRINGIFIEDENUM_H
#endif // !__STRINGIFIEDENUM_H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef DCOMMONVARS_H
#define DCOMMONVARS_H
#ifndef __DCOMMONVARS__H__
#define __DCOMMONVARS__H__
#include <cstdint>
#include <string>
@@ -158,4 +158,4 @@ public:
}
};
#endif //!DCOMMONVARS_H
#endif //!__DCOMMONVARS__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EADDFRIENDRESPONSECODE_H
#define EADDFRIENDRESPONSECODE_H
#ifndef __EADDFRIENDRESPONSECODE__H__
#define __EADDFRIENDRESPONSECODE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eAddFriendResponseCode : uint8_t {
CANCELLED
};
#endif //!ADDFRIENDRESPONSECODE_H
#endif //!__ADDFRIENDRESPONSECODE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EADDFRIENDRESPONSETYPE_H
#define EADDFRIENDRESPONSETYPE_H
#ifndef __EADDFRIENDRESPONSETYPE__H__
#define __EADDFRIENDRESPONSETYPE__H__
#include <cstdint>
@@ -21,4 +21,4 @@ enum class eAddFriendResponseType : uint8_t {
FRIENDISFREETRIAL
};
#endif //!EADDFRIENDRESPONSETYPE_H
#endif //!__EADDFRIENDRESPONSETYPE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EANINMATIONFLAGS_H
#define EANINMATIONFLAGS_H
#ifndef __EANINMATIONFLAGS__H__
#define __EANINMATIONFLAGS__H__
#include <cstdint>
@@ -41,4 +41,4 @@ enum class eAnimationFlags : uint32_t {
IDLE_MISC12
};
#endif //!EANINMATIONFLAGS_H
#endif //!__EANINMATIONFLAGS__H__

View File

@@ -1,5 +1,5 @@
#ifndef EAUTHMESSAGETYPE_H
#define EAUTHMESSAGETYPE_H
#ifndef __EAUTHMESSAGETYPE__H__
#define __EAUTHMESSAGETYPE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eAuthMessageType : uint32_t {
RUNTIME_CONFIG
};
#endif //!EAUTHMESSAGETYPE_H
#endif //!__EAUTHMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EBASICATTACKSUCCESSTYPES_H
#define EBASICATTACKSUCCESSTYPES_H
#ifndef __EBASICATTACKSUCCESSTYPES__H__
#define __EBASICATTACKSUCCESSTYPES__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eBasicAttackSuccessTypes : uint8_t {
FAILIMMUNE
};
#endif //!EBASICATTACKSUCCESSTYPES_H
#endif //!__EBASICATTACKSUCCESSTYPES__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EBLUEPRINTSAVERESPONSETYPE_H
#define EBLUEPRINTSAVERESPONSETYPE_H
#ifndef __EBLUEPRINTSAVERESPONSETYPE__H__
#define __EBLUEPRINTSAVERESPONSETYPE__H__
#include <cstdint>
@@ -23,4 +23,4 @@ enum class eBlueprintSaveResponseType : uint32_t {
FindMatchesFailed
};
#endif //!EBLUEPRINTSAVERESPONSETYPE_H
#endif //!__EBLUEPRINTSAVERESPONSETYPE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EBUBBLETYPE_H
#define EBUBBLETYPE_H
#ifndef __EBUBBLETYPE__H__
#define __EBUBBLETYPE__H__
#include <cstdint>
@@ -11,4 +11,4 @@ enum class eBubbleType : uint32_t {
SKUNK
};
#endif //!EBUBBLETYPE_H
#endif //!__EBUBBLETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EBUILDTYPE_H
#define EBUILDTYPE_H
#ifndef __EBUILDTYPE__H__
#define __EBUILDTYPE__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eBuildType :uint32_t {
ON_PROPERTY
};
#endif //!EBUILDTYPE_H
#endif //!__EBUILDTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECHARACTERCREATIONRESPONSE_H
#define ECHARACTERCREATIONRESPONSE_H
#ifndef __ECHARACTERCREATIONRESPONSE__H__
#define __ECHARACTERCREATIONRESPONSE__H__
#include <cstdint>
@@ -11,4 +11,4 @@ enum class eCharacterCreationResponse : uint8_t {
CUSTOM_NAME_IN_USE
};
#endif //!ECHARACTERCREATIONRESPONSE_H
#endif //!__ECHARACTERCREATIONRESPONSE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef ECHARACTERVERSION_H
#define ECHARACTERVERSION_H
#ifndef __ECHARACTERVERSION__H__
#define __ECHARACTERVERSION__H__
#include <cstdint>
@@ -18,4 +18,4 @@ enum class eCharacterVersion : uint32_t {
UP_TO_DATE, // will become SPEED_BASE
};
#endif //!ECHARACTERVERSION_H
#endif //!__ECHARACTERVERSION__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECHATMESSAGETYPE_H
#define ECHATMESSAGETYPE_H
#ifndef __ECHATMESSAGETYPE__H__
#define __ECHATMESSAGETYPE__H__
#include <cstdint>
@@ -77,4 +77,4 @@ enum class eChatMessageType :uint32_t {
CREATE_TEAM,
};
#endif //!ECHATMESSAGETYPE_H
#endif //!__ECHATMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECINEMATICEVENT_H
#define ECINEMATICEVENT_H
#ifndef __ECINEMATICEVENT__H__
#define __ECINEMATICEVENT__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eCinematicEvent : uint32_t {
ENDED,
};
#endif //!ECINEMATICEVENT_H
#endif //!__ECINEMATICEVENT__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECLIENTMESSAGETYPE_H
#define ECLIENTMESSAGETYPE_H
#ifndef __ECLIENTMESSAGETYPE__H__
#define __ECLIENTMESSAGETYPE__H__
#include <cstdint>
@@ -73,4 +73,4 @@ enum class eClientMessageType : uint32_t {
UGC_DOWNLOAD_FAILED = 120
};
#endif //!ECLIENTMESSAGETYPE_H
#endif //!__ECLIENTMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECONNECTIONTYPE_H
#define ECONNECTIONTYPE_H
#ifndef __ECONNECTIONTYPE__H__
#define __ECONNECTIONTYPE__H__
enum class eConnectionType : uint16_t {
SERVER = 0,
@@ -10,4 +10,4 @@ enum class eConnectionType : uint16_t {
MASTER
};
#endif //!ECONNECTIONTYPE_H
#endif //!__ECONNECTIONTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECONTROLSCHEME_H
#define ECONTROLSCHEME_H
#ifndef __ECONTROLSCHEME__H__
#define __ECONTROLSCHEME__H__
#include <cstdint>
@@ -15,4 +15,4 @@ enum class eControlScheme : uint32_t {
SCHEME_WEAR_A_ROBOT //== freecam?
};
#endif //!ECONTROLSCHEME_H
#endif //!__ECONTROLSCHEME__H__

View File

@@ -1,5 +1,5 @@
#ifndef ECYCLINGMODE_H
#define ECYCLINGMODE_H
#ifndef __ECYCLINGMODE__H__
#define __ECYCLINGMODE__H__
#include <cstdint>
@@ -8,4 +8,4 @@ enum class eCyclingMode : uint32_t {
DISALLOW_CYCLING
};
#endif //!ECYCLINGMODE_H
#endif //!__ECYCLINGMODE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EENDBEHAVIOR_H
#define EENDBEHAVIOR_H
#ifndef __EENDBEHAVIOR__H__
#define __EENDBEHAVIOR__H__
#include <cstdint>
@@ -8,4 +8,4 @@ enum class eEndBehavior : uint32_t {
WAIT
};
#endif //!EENDBEHAVIOR_H
#endif //!__EENDBEHAVIOR__H__

View File

@@ -1,5 +1,5 @@
#ifndef EGAMEACTIVITY_H
#define EGAMEACTIVITY_H
#ifndef __EGAMEACTIVITY__H__
#define __EGAMEACTIVITY__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eGameActivity : uint32_t {
PET_TAMING
};
#endif //!EGAMEACTIVITY_H
#endif //!__EGAMEACTIVITY__H__

View File

@@ -1,5 +1,5 @@
#ifndef EGAMEMASTERLEVEL_H
#define EGAMEMASTERLEVEL_H
#ifndef __EGAMEMASTERLEVEL__H__
#define __EGAMEMASTERLEVEL__H__
#include <cstdint>
@@ -17,4 +17,4 @@ enum class eGameMasterLevel : uint8_t {
};
#endif //!EGAMEMASTERLEVEL_H
#endif //!__EGAMEMASTERLEVEL__H__

View File

@@ -1,5 +1,5 @@
#ifndef EGAMEMESSAGETYPE_H
#define EGAMEMESSAGETYPE_H
#ifndef __EGAMEMESSAGETYPE__H__
#define __EGAMEMESSAGETYPE__H__
#include <cstdint>
@@ -1611,4 +1611,4 @@ struct magic_enum::customize::enum_range<eGameMessageType> {
static constexpr int max = 1772;
};
#endif //!EGAMEMESSAGETYPE_H
#endif //!__EGAMEMESSAGETYPE__H__

View File

@@ -1,6 +1,6 @@
#ifndef EHELPTYPE_H
#define EHELPTYPE_H
#ifndef __EHELPTYPE__H__
#define __EHELPTYPE__H__
#include <cstdint>
@@ -38,4 +38,4 @@ enum class eHelpType : int32_t {
UI_INVENTORY_FULL_CANNOT_PICKUP_ITEM = 86
};
#endif //!EHELPTYPE_H
#endif //!__EHELPTYPE__H__

View File

@@ -1,12 +1,9 @@
#pragma once
#ifndef EINVENTORYTYPE_H
#define EINVENTORYTYPE_H
#ifndef __EINVENTORYTYPE__H__
#define __EINVENTORYTYPE__H__
#include <cstdint>
#include "magic_enum.hpp"
static const uint8_t NUMBER_OF_INVENTORIES = 17;
/**
* Represents the different types of inventories an entity may have
@@ -59,10 +56,4 @@ public:
};
};
template <>
struct magic_enum::customize::enum_range<eInventoryType> {
static constexpr int min = 0;
static constexpr int max = 16;
};
#endif //!EINVENTORYTYPE_H
#endif //!__EINVENTORYTYPE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EITEMSETPASSIVEABILITYID_H
#define EITEMSETPASSIVEABILITYID_H
#ifndef __EITEMSETPASSIVEABILITYID__H__
#define __EITEMSETPASSIVEABILITYID__H__
enum class eItemSetPassiveAbilityID {
EngineerRank1 = 2,
@@ -55,4 +55,4 @@ enum class eItemSetPassiveAbilityID {
LightningSpinjitzu = 52
};
#endif //!EITEMSETPASSIVEABILITYID_H
#endif //!__EITEMSETPASSIVEABILITYID__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EITEMTYPE_H
#define EITEMTYPE_H
#ifndef __EITEMTYPE__H__
#define __EITEMTYPE__H__
#include <cstdint>
@@ -33,4 +33,4 @@ enum class eItemType : int32_t {
MOUNT
};
#endif //!EITEMTYPE_H
#endif //!__EITEMTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EKILLTYPE_H
#define EKILLTYPE_H
#ifndef __EKILLTYPE__H__
#define __EKILLTYPE__H__
#include <cstdint>
@@ -8,4 +8,4 @@ enum class eKillType : uint32_t {
SILENT
};
#endif //!EKILLTYPE_H
#endif //!__EKILLTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ELOGINRESPONSE_H
#define ELOGINRESPONSE_H
#ifndef __ELOGINRESPONSE__H__
#define __ELOGINRESPONSE__H__
#include <cstdint>
@@ -21,4 +21,4 @@ enum class eLoginResponse : uint8_t {
ACCOUNT_NOT_ACTIVATED
};
#endif //!ELOGINRESPONSE_H
#endif //!__ELOGINRESPONSE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ELOOTSOURCETYPE_H
#define ELOOTSOURCETYPE_H
#ifndef __ELOOTSOURCETYPE__H__
#define __ELOOTSOURCETYPE__H__
#include <cstdint>
@@ -28,4 +28,4 @@ enum class eLootSourceType : uint32_t {
RELOCATE
};
#endif //!ELOOTSOURCETYPE_H
#endif //!__ELOOTSOURCETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EMASTERMESSAGETYPE_H
#define EMASTERMESSAGETYPE_H
#ifndef __EMASTERMESSAGETYPE__H__
#define __EMASTERMESSAGETYPE__H__
#include <cstdint>
@@ -33,4 +33,4 @@ enum class eMasterMessageType : uint32_t {
NEW_SESSION_ALERT
};
#endif //!EMASTERMESSAGETYPE_H
#endif //!__EMASTERMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EMATCHUPDATE_H
#define EMATCHUPDATE_H
#ifndef __EMATCHUPDATE__H__
#define __EMATCHUPDATE__H__
#include <cstdint>
@@ -14,4 +14,4 @@ enum class eMatchUpdate : int32_t {
PLAYER_UPDATE
};
#endif //!EMATCHUPDATE_H
#endif //!__EMATCHUPDATE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EMISSIONLOCKSTATE_H
#define EMISSIONLOCKSTATE_H
#ifndef __EMISSIONLOCKSTATE__H__
#define __EMISSIONLOCKSTATE__H__
enum class eMissionLockState : int {
LOCKED,
@@ -9,4 +9,4 @@ enum class eMissionLockState : int {
UNLOCKED,
};
#endif //!EMISSIONLOCKSTATE_H
#endif //!__EMISSIONLOCKSTATE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef MISSIONSTATE_H
#define MISSIONSTATE_H
#ifndef __MISSIONSTATE__H__
#define __MISSIONSTATE__H__
/**
* Represents the possible states a mission can be in
@@ -53,4 +53,4 @@ enum class eMissionState : int {
COMPLETE_READY_TO_COMPLETE = 12
};
#endif //!MISSIONSTATE_H
#endif //!__MISSIONSTATE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EMISSIONTASKTYPE_H
#define EMISSIONTASKTYPE_H
#ifndef __EMISSIONTASKTYPE__H__
#define __EMISSIONTASKTYPE__H__
enum class eMissionTaskType : int {
UNKNOWN = -1,
@@ -40,4 +40,4 @@ enum class eMissionTaskType : int {
DONATION
};
#endif //!EMISSIONTASKTYPE_H
#endif //!__EMISSIONTASKTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EMOVEMENTPLATFORMSTATE_H
#define EMOVEMENTPLATFORMSTATE_H
#ifndef __EMOVEMENTPLATFORMSTATE__H__
#define __EMOVEMENTPLATFORMSTATE__H__
#include <cstdint>
@@ -13,4 +13,4 @@ enum class eMovementPlatformState : uint32_t
Stopped = 0b01100
};
#endif //!EMOVEMENTPLATFORMSTATE_H
#endif //!__EMOVEMENTPLATFORMSTATE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EOBJECTBITS_H
#define EOBJECTBITS_H
#ifndef __EOBJECTBITS__H__
#define __EOBJECTBITS__H__
#include <cstdint>
@@ -10,4 +10,4 @@ enum class eObjectBits : size_t {
CHARACTER = 60
};
#endif //!EOBJECTBITS_H
#endif //!__EOBJECTBITS__H__

View File

@@ -1,5 +1,5 @@
#ifndef EOBJECTWORLDSTATE_H
#define EOBJECTWORLDSTATE_H
#ifndef __EOBJECTWORLDSTATE__H__
#define __EOBJECTWORLDSTATE__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eObjectWorldState : uint32_t {
INVENTORY
};
#endif //!EOBJECTWORLDSTATE_H
#endif //!__EOBJECTWORLDSTATE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EPACKAGETYPE_H
#define EPACKAGETYPE_H
#ifndef __EPACKAGETYPE__H__
#define __EPACKAGETYPE__H__
enum class ePackageType {
INVALID = -1,
@@ -10,4 +10,4 @@ enum class ePackageType {
};
#endif //!EPACKAGETYPE_H
#endif //!__EPACKAGETYPE__H__

View File

@@ -2,8 +2,8 @@
#include <cstdint>
#ifndef EPERMISSIONMAP_H
#define EPERMISSIONMAP_H
#ifndef __EPERMISSIONMAP__H__
#define __EPERMISSIONMAP__H__
/**
* Bitmap of permissions and restrictions for characters.
@@ -29,4 +29,4 @@ enum class ePermissionMap : uint64_t {
RestrictedChatAccess = 0x1 << 6,
};
#endif //!EPERMISSIONMAP_H
#endif //!__EPERMISSIONMAP__H__

View File

@@ -1,5 +1,5 @@
#ifndef EPETABILITYTYPE_H
#define EPETABILITYTYPE_H
#ifndef __EPETABILITYTYPE__H__
#define __EPETABILITYTYPE__H__
#include <cstdint>
@@ -10,4 +10,4 @@ enum class ePetAbilityType : uint32_t {
DigAtPosition
};
#endif //!EPETABILITYTYPE_H
#endif //!__EPETABILITYTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EPETTAMINGNOTIFYTYPE_H
#define EPETTAMINGNOTIFYTYPE_H
#ifndef __EPETTAMINGNOTIFYTYPE__H__
#define __EPETTAMINGNOTIFYTYPE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class ePetTamingNotifyType : uint32_t {
NAMINGPET
};
#endif //!EPETTAMINGNOTIFYTYPE_H
#endif //!__EPETTAMINGNOTIFYTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EPHYSICSEFFECTTYPE_H
#define EPHYSICSEFFECTTYPE_H
#ifndef __EPHYSICSEFFECTTYPE__H__
#define __EPHYSICSEFFECTTYPE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class ePhysicsEffectType : uint32_t {
FRICTION
};
#endif //!EPHYSICSEFFECTTYPE_H
#endif //!__EPHYSICSEFFECTTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EPLAYERFLAG_H
#define EPLAYERFLAG_H
#ifndef __EPLAYERFLAG__H__
#define __EPLAYERFLAG__H__
#include <cstdint>
@@ -170,4 +170,4 @@ enum ePlayerFlag : int32_t {
DLU_SKIP_CINEMATICS = 1'000'000,
};
#endif //!EPLAYERFLAG_H
#endif //!__EPLAYERFLAG__H__

View File

@@ -1,5 +1,5 @@
#ifndef EQUICKBUILDFAILREASON_H
#define EQUICKBUILDFAILREASON_H
#ifndef __EQUICKBUILDFAILREASON__H__
#define __EQUICKBUILDFAILREASON__H__
#include <cstdint>
@@ -10,4 +10,4 @@ enum class eQuickBuildFailReason : uint32_t {
BUILD_ENDED
};
#endif //!EQUICKBUILDFAILREASON_H
#endif //!__EQUICKBUILDFAILREASON__H__

View File

@@ -1,5 +1,5 @@
#ifndef EQUICKBUILDSTATE_H
#define EQUICKBUILDSTATE_H
#ifndef __EQUICKBUILDSTATE__H__
#define __EQUICKBUILDSTATE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eQuickBuildState : uint32_t {
};
#endif //!EQUICKBUILDSTATE_H
#endif //!__EQUICKBUILDSTATE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef ERACINGTASKPARAM_H
#define ERACINGTASKPARAM_H
#ifndef __ERACINGTASKPARAM__H__
#define __ERACINGTASKPARAM__H__
#include <cstdint>
@@ -22,4 +22,4 @@ enum class eRacingTaskParam : int32_t {
SMASH_SPECIFIC_SMASHABLE
};
#endif //!ERACINGTASKPARAM_H
#endif //!__ERACINGTASKPARAM__H__

View File

@@ -1,5 +1,5 @@
#ifndef ERENAMERESPONSE_H
#define ERENAMERESPONSE_H
#ifndef __ERENAMERESPONSE__H__
#define __ERENAMERESPONSE__H__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eRenameResponse : uint8_t {
};
#endif //!ERENAMERESPONSE_H
#endif //!__ERENAMERESPONSE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EREPLICACOMPONENTTYPE_H
#define EREPLICACOMPONENTTYPE_H
#ifndef __EREPLICACOMPONENTTYPE__H__
#define __EREPLICACOMPONENTTYPE__H__
#include <cstdint>
@@ -124,4 +124,4 @@ enum class eReplicaComponentType : uint32_t {
DESTROYABLE = 1000 // Actually 7
};
#endif //!EREPLICACOMPONENTTYPE_H
#endif //!__EREPLICACOMPONENTTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EREPLICAPACKETTYPE_H
#define EREPLICAPACKETTYPE_H
#ifndef __EREPLICAPACKETTYPE__H__
#define __EREPLICAPACKETTYPE__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eReplicaPacketType : uint8_t {
DESTRUCTION
};
#endif //!EREPLICAPACKETTYPE_H
#endif //!__EREPLICAPACKETTYPE__H__

View File

@@ -1,21 +0,0 @@
#ifndef EREPONSEMOVEITEMBETWEENINVENTORYTYPECODE_H
#define EREPONSEMOVEITEMBETWEENINVENTORYTYPECODE_H
#include <cstdint>
enum class eReponseMoveItemBetweenInventoryTypeCode : int32_t {
SUCCESS,
FAIL_GENERIC,
FAIL_INV_FULL,
FAIL_ITEM_NOT_FOUND,
FAIL_CANT_MOVE_TO_THAT_INV_TYPE,
FAIL_NOT_NEAR_BANK,
FAIL_CANT_SWAP_ITEMS,
FAIL_SOURCE_TYPE,
FAIL_WRONG_DEST_TYPE,
FAIL_SWAP_DEST_TYPE,
FAIL_CANT_MOVE_THINKING_HAT,
FAIL_DISMOUNT_BEFORE_MOVING
};
#endif //!EREPONSEMOVEITEMBETWEENINVENTORYTYPECODE_H

View File

@@ -1,5 +1,5 @@
#ifndef ESERVERDISCONNECTIDENTIFIERS_H
#define ESERVERDISCONNECTIDENTIFIERS_H
#ifndef __ESERVERDISCONNECTIDENTIFIERS__H__
#define __ESERVERDISCONNECTIDENTIFIERS__H__
#include <cstdint>
@@ -21,4 +21,4 @@ enum class eServerDisconnectIdentifiers : uint32_t {
PLAY_SCHEDULE_TIME_DONE
};
#endif //!ESERVERDISCONNECTIDENTIFIERS_H
#endif //!__ESERVERDISCONNECTIDENTIFIERS__H__

View File

@@ -1,5 +1,5 @@
#ifndef ESERVERMESSAGETYPE_H
#define ESERVERMESSAGETYPE_H
#ifndef __ESERVERMESSAGETYPE__H__
#define __ESERVERMESSAGETYPE__H__
#include <cstdint>
//! The Internal Server Packet Identifiers
@@ -9,4 +9,4 @@ enum class eServerMessageType : uint32_t {
GENERAL_NOTIFY
};
#endif //!ESERVERMESSAGETYPE_H
#endif //!__ESERVERMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ESQLITEDATATYPE_H
#define ESQLITEDATATYPE_H
#ifndef __ESQLITEDATATYPE__H__
#define __ESQLITEDATATYPE__H__
#include <cstdint>
@@ -13,4 +13,4 @@ enum class eSqliteDataType : int32_t {
TEXT_8 = 8
};
#endif //!ESQLITEDATATYPE_H
#endif //!__ESQLITEDATATYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ESTATECHANGETYPE_H
#define ESTATECHANGETYPE_H
#ifndef __ESTATECHANGETYPE__H__
#define __ESTATECHANGETYPE__H__
#include <cstdint>
@@ -8,4 +8,4 @@ enum class eStateChangeType : uint32_t {
POP
};
#endif //!ESTATECHANGETYPE_H
#endif //!__ESTATECHANGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ETERMINATETYPE_H
#define ETERMINATETYPE_H
#ifndef __ETERMINATETYPE__H__
#define __ETERMINATETYPE__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eTerminateType : uint32_t {
FROM_INTERACTION
};
#endif //!ETERMINATETYPE_H
#endif //!__ETERMINATETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ETRIGGERCOMMANDTYPE_H
#define ETRIGGERCOMMANDTYPE_H
#ifndef __ETRIGGERCOMMANDTYPE__H__
#define __ETRIGGERCOMMANDTYPE__H__
// For info about Trigger Command see:
// https://docs.lu-dev.net/en/latest/file-structures/lutriggers.html?highlight=trigger#possible-values-commands
@@ -116,4 +116,4 @@ public:
};
};
#endif //!ETRIGGERCOMMANDTYPE_H
#endif //!__ETRIGGERCOMMANDTYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef ETRIGGEREVENTTYPE_H
#define ETRIGGEREVENTTYPE_H
#ifndef __ETRIGGEREVENTTYPE__H__
#define __ETRIGGEREVENTTYPE__H__
enum class eTriggerEventType {
INVALID,
@@ -50,4 +50,4 @@ public:
};
};
#endif //!ETRIGGEREVENTTYPE_H
#endif //!__ETRIGGEREVENTTYPE__H__

View File

@@ -1,7 +1,7 @@
#pragma once
#ifndef EUNEQUIPPABLEACTIVETYPE_H
#define EUNEQUIPPABLEACTIVETYPE_H
#ifndef __EUNEQUIPPABLEACTIVETYPE__H__
#define __EUNEQUIPPABLEACTIVETYPE__H__
#include <cstdint>
@@ -11,4 +11,4 @@ enum class eUnequippableActiveType : int32_t {
MOUNT
};
#endif //!EUNEQUIPPABLEACTIVETYPE_H
#endif //!__EUNEQUIPPABLEACTIVETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EUSEITEMRESPONSE_H
#define EUSEITEMRESPONSE_H
#ifndef __EUSEITEMRESPONSE__H__
#define __EUSEITEMRESPONSE__H__
#include <cstdint>
@@ -9,4 +9,4 @@ enum class eUseItemResponse : uint32_t {
MountsNotAllowed
};
#endif //!EUSEITEMRESPONSE_H
#endif //!__EUSEITEMRESPONSE__H__

View File

@@ -1,5 +1,5 @@
#ifndef EVENDORTRANSACTIONRESULT_H
#define EVENDORTRANSACTIONRESULT_H
#ifndef __EVENDORTRANSACTIONRESULT__
#define __EVENDORTRANSACTIONRESULT__
#include <cstdint>
@@ -12,4 +12,4 @@ enum class eVendorTransactionResult : uint32_t {
DONATION_FULL
};
#endif // !EVENDORTRANSACTIONRESULT_H
#endif // !__EVENDORTRANSACTIONRESULT__

View File

@@ -1,6 +1,6 @@
#ifndef EWAYPOINTCOMMANDTYPES_H
#define EWAYPOINTCOMMANDTYPES_H
#ifndef __EWAYPOINTCOMMANDTYPES__H__
#define __EWAYPOINTCOMMANDTYPES__H__
#include <cstdint>
@@ -56,4 +56,4 @@ public:
};
#endif //!EWAYPOINTCOMMANDTYPES_H
#endif //!__EWAYPOINTCOMMANDTYPES__H__

View File

@@ -1,5 +1,5 @@
#ifndef EWORLDMESSAGETYPE_H
#define EWORLDMESSAGETYPE_H
#ifndef __EWORLDMESSAGETYPE__H__
#define __EWORLDMESSAGETYPE__H__
#include <cstdint>
@@ -48,4 +48,4 @@ struct magic_enum::customize::enum_range<eWorldMessageType> {
static constexpr int max = 91;
};
#endif //!EWORLDMESSAGETYPE_H
#endif //!__EWORLDMESSAGETYPE__H__

View File

@@ -1,5 +1,5 @@
#ifndef CDCLIENTMANAGER_H
#define CDCLIENTMANAGER_H
#ifndef __CDCLIENTMANAGER__H__
#define __CDCLIENTMANAGER__H__
#define UNUSED_TABLE(v)
@@ -41,4 +41,4 @@ T* CDClientManager::GetTable() {
return &T::Instance();
};
#endif //!CDCLIENTMANAGER_H
#endif //!__CDCLIENTMANAGER__H__

View File

@@ -1,5 +1,5 @@
#ifndef GAMEDATABASE_H
#define GAMEDATABASE_H
#ifndef __GAMEDATABASE__H__
#define __GAMEDATABASE__H__
#include <optional>
@@ -23,7 +23,6 @@
#include "IActivityLog.h"
#include "IIgnoreList.h"
#include "IAccountsRewardCodes.h"
#include "IBehaviors.h"
namespace sql {
class Statement;
@@ -41,8 +40,7 @@ class GameDatabase :
public IMail, public ICommandLog, public IPlayerCheatDetections, public IBugReports,
public IPropertyContents, public IProperty, public IPetNames, public ICharXml,
public IMigrationHistory, public IUgc, public IFriends, public ICharInfo,
public IAccounts, public IActivityLog, public IAccountsRewardCodes, public IIgnoreList,
public IBehaviors {
public IAccounts, public IActivityLog, public IAccountsRewardCodes, public IIgnoreList {
public:
virtual ~GameDatabase() = default;
// TODO: These should be made private.
@@ -56,4 +54,4 @@ public:
virtual void DeleteCharacter(const uint32_t characterId) = 0;
};
#endif //!GAMEDATABASE_H
#endif //!__GAMEDATABASE__H__

View File

@@ -1,5 +1,5 @@
#ifndef IACCOUNTS_H
#define IACCOUNTS_H
#ifndef __IACCOUNTS__H__
#define __IACCOUNTS__H__
#include <cstdint>
#include <optional>
@@ -33,9 +33,6 @@ public:
// Add a new account to the database.
virtual void InsertNewAccount(const std::string_view username, const std::string_view bcryptpassword) = 0;
// Update the GameMaster level of an account.
virtual void UpdateAccountGmLevel(const uint32_t accountId, const eGameMasterLevel gmLevel) = 0;
};
#endif //!IACCOUNTS_H
#endif //!__IACCOUNTS__H__

View File

@@ -1,5 +1,5 @@
#ifndef IACCOUNTSREWARDCODES_H
#define IACCOUNTSREWARDCODES_H
#ifndef __IACCOUNTSREWARDCODES__H__
#define __IACCOUNTSREWARDCODES__H__
#include <cstdint>
#include <vector>
@@ -10,4 +10,4 @@ public:
virtual std::vector<uint32_t> GetRewardCodesByAccountID(const uint32_t account_id) = 0;
};
#endif //!IACCOUNTSREWARDCODES_H
#endif //!__IACCOUNTSREWARDCODES__H__

View File

@@ -1,5 +1,5 @@
#ifndef IACTIVITYLOG_H
#define IACTIVITYLOG_H
#ifndef __IACTIVITYLOG__H__
#define __IACTIVITYLOG__H__
#include <cstdint>
@@ -16,4 +16,4 @@ public:
virtual void UpdateActivityLog(const uint32_t characterId, const eActivityType activityType, const LWOMAPID mapId) = 0;
};
#endif //!IACTIVITYLOG_H
#endif //!__IACTIVITYLOG__H__

View File

@@ -1,22 +0,0 @@
#ifndef IBEHAVIORS_H
#define IBEHAVIORS_H
#include <cstdint>
#include "dCommonVars.h"
class IBehaviors {
public:
struct Info {
int32_t behaviorId{};
uint32_t characterId{};
std::string behaviorInfo;
};
// This Add also takes care of updating if it exists.
virtual void AddBehavior(const Info& info) = 0;
virtual std::string GetBehavior(const int32_t behaviorId) = 0;
virtual void RemoveBehavior(const int32_t behaviorId) = 0;
};
#endif //!IBEHAVIORS_H

View File

@@ -1,5 +1,5 @@
#ifndef IBUGREPORTS_H
#define IBUGREPORTS_H
#ifndef __IBUGREPORTS__H__
#define __IBUGREPORTS__H__
#include <cstdint>
#include <string_view>
@@ -17,4 +17,4 @@ public:
// Add a new bug report to the database.
virtual void InsertNewBugReport(const Info& info) = 0;
};
#endif //!IBUGREPORTS_H
#endif //!__IBUGREPORTS__H__

View File

@@ -1,5 +1,5 @@
#ifndef ICHARINFO_H
#define ICHARINFO_H
#ifndef __ICHARINFO__H__
#define __ICHARINFO__H__
#include <cstdint>
#include <optional>
@@ -46,4 +46,4 @@ public:
virtual void UpdateLastLoggedInCharacter(const uint32_t characterId) = 0;
};
#endif //!ICHARINFO_H
#endif //!__ICHARINFO__H__

View File

@@ -1,5 +1,5 @@
#ifndef ICHARXML_H
#define ICHARXML_H
#ifndef __ICHARXML__H__
#define __ICHARXML__H__
#include <cstdint>
#include <string>
@@ -17,4 +17,4 @@ public:
virtual void InsertCharacterXml(const uint32_t characterId, const std::string_view lxfml) = 0;
};
#endif //!ICHARXML_H
#endif //!__ICHARXML__H__

View File

@@ -1,5 +1,5 @@
#ifndef ICOMMANDLOG_H
#define ICOMMANDLOG_H
#ifndef __ICOMMANDLOG__H__
#define __ICOMMANDLOG__H__
#include <cstdint>
#include <string_view>
@@ -11,4 +11,4 @@ public:
virtual void InsertSlashCommandUsage(const uint32_t characterId, const std::string_view command) = 0;
};
#endif //!ICOMMANDLOG_H
#endif //!__ICOMMANDLOG__H__

View File

@@ -1,5 +1,5 @@
#ifndef IFRIENDS_H
#define IFRIENDS_H
#ifndef __IFRIENDS__H__
#define __IFRIENDS__H__
#include <cstdint>
#include <optional>
@@ -29,4 +29,4 @@ public:
virtual void RemoveFriend(const uint32_t playerCharacterId, const uint32_t friendCharacterId) = 0;
};
#endif //!IFRIENDS_H
#endif //!__IFRIENDS__H__

Some files were not shown because too many files have changed in this diff Show More