Merge remote-tracking branch 'upstream/main' into more-cdclient-cleanup

This commit is contained in:
David Markowitz
2023-03-26 03:00:21 -07:00
52 changed files with 721 additions and 309 deletions

View File

@@ -319,3 +319,7 @@ std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::stri
return sortedFiles;
}
bool GeneralUtils::TryParse(const std::string& x, const std::string& y, const std::string& z, NiPoint3& dst) {
return TryParse<float>(x.c_str(), dst.x) && TryParse<float>(y.c_str(), dst.y) && TryParse<float>(z.c_str(), dst.z);
}

View File

@@ -10,6 +10,7 @@
#include <type_traits>
#include <stdexcept>
#include <BitStream.h>
#include "NiPoint3.h"
#include "Game.h"
#include "dLogger.h"
@@ -208,6 +209,8 @@ namespace GeneralUtils {
return TryParse<T>(value.c_str(), dst);
}
bool TryParse(const std::string& x, const std::string& y, const std::string& z, NiPoint3& dst);
template<typename T>
std::u16string to_u16string(T value) {
return GeneralUtils::ASCIIToUTF16(std::to_string(value));

View File

@@ -128,6 +128,12 @@ NiPoint3 NiPoint3::operator+(const NiPoint3& point) const {
return NiPoint3(this->x + point.x, this->y + point.y, this->z + point.z);
}
//! Operator for addition of vectors
NiPoint3 NiPoint3::operator+=(const NiPoint3& point) const {
return NiPoint3(this->x + point.x, this->y + point.y, this->z + point.z);
}
//! Operator for subtraction of vectors
NiPoint3 NiPoint3::operator-(const NiPoint3& point) const {
return NiPoint3(this->x - point.x, this->y - point.y, this->z - point.z);

View File

@@ -135,6 +135,9 @@ public:
//! Operator for addition of vectors
NiPoint3 operator+(const NiPoint3& point) const;
//! Operator for addition of vectors
NiPoint3 operator+=(const NiPoint3& point) const;
//! Operator for subtraction of vectors
NiPoint3 operator-(const NiPoint3& point) const;

View File

@@ -175,21 +175,6 @@ union suchar {
char svalue;
};
//=========== DLU ENUMS ============
enum eGameMasterLevel : int32_t {
GAME_MASTER_LEVEL_CIVILIAN = 0, // Normal player.
GAME_MASTER_LEVEL_FORUM_MODERATOR = 1, // No permissions on live servers.
GAME_MASTER_LEVEL_JUNIOR_MODERATOR = 2, // Can kick/mute and pull chat logs.
GAME_MASTER_LEVEL_MODERATOR = 3, // Can return lost items.
GAME_MASTER_LEVEL_SENIOR_MODERATOR = 4, // Can ban.
GAME_MASTER_LEVEL_LEAD_MODERATOR = 5, // Can approve properties.
GAME_MASTER_LEVEL_JUNIOR_DEVELOPER = 6, // Junior developer & future content team. Civilan on live.
GAME_MASTER_LEVEL_INACTIVE_DEVELOPER = 7, // Inactive developer, limited permissions.
GAME_MASTER_LEVEL_DEVELOPER = 8, // Active developer, full permissions on live.
GAME_MASTER_LEVEL_OPERATOR = 9 // Can shutdown server for restarts & updates.
};
//=========== LU ENUMS ============
//! An enum for object ID bits

View File

@@ -445,6 +445,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_BBB_SAVE_RESPONSE = 1006,
GAME_MSG_NOTIFY_CLIENT_OBJECT = 1042,
GAME_MSG_DISPLAY_ZONE_SUMMARY = 1043,
GAME_MSG_ZONE_SUMMARY_DISMISSED = 1044,
GAME_MSG_ACTIVITY_STATE_CHANGE_REQUEST = 1053,
GAME_MSG_MODIFY_PLAYER_ZONE_STATISTIC = 1046,
GAME_MSG_START_BUILDING_WITH_ITEM = 1057,
@@ -484,6 +485,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_LOCK_NODE_ROTATION = 1260,
GAME_MSG_VEHICLE_SET_WHEEL_LOCK_STATE = 1273,
GAME_MSG_NOTIFY_VEHICLE_OF_RACING_OBJECT = 1276,
GAME_MSG_SET_NAME_BILLBOARD_STATE = 1284,
GAME_MSG_PLAYER_REACHED_RESPAWN_CHECKPOINT = 1296,
GAME_MSG_HANDLE_UGC_EQUIP_POST_DELETE_BASED_ON_EDIT_MODE = 1300,
GAME_MSG_HANDLE_UGC_EQUIP_PRE_CREATE_BASED_ON_EDIT_MODE = 1301,
@@ -494,6 +496,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_MATCH_UPDATE = 1310,
GAME_MSG_MODULE_ASSEMBLY_DB_DATA_FOR_CLIENT = 1131,
GAME_MSG_MODULE_ASSEMBLY_QUERY_DATA = 1132,
GAME_MSG_SHOW_BILLBOARD_INTERACT_ICON = 1337,
GAME_MSG_CHANGE_IDLE_FLAGS = 1338,
GAME_MSG_VEHICLE_ADD_PASSIVE_BOOST_ACTION = 1340,
GAME_MSG_VEHICLE_REMOVE_PASSIVE_BOOST_ACTION = 1341,

View File

@@ -0,0 +1,11 @@
#ifndef __EENDBEHAVIOR__H__
#define __EENDBEHAVIOR__H__
#include <cstdint>
enum class eEndBehavior : uint32_t {
RETURN,
WAIT
};
#endif //!__EENDBEHAVIOR__H__

View File

@@ -0,0 +1,20 @@
#ifndef __EGAMEMASTERLEVEL__H__
#define __EGAMEMASTERLEVEL__H__
#include <cstdint>
enum class eGameMasterLevel : uint8_t {
CIVILIAN = 0, // Normal player.
FORUM_MODERATOR = 1, // No permissions on live servers.
JUNIOR_MODERATOR = 2, // Can kick/mute and pull chat logs.
MODERATOR = 3, // Can return lost items.
SENIOR_MODERATOR = 4, // Can ban.
LEAD_MODERATOR = 5, // Can approve properties.
JUNIOR_DEVELOPER = 6, // Junior developer & future content team. Civilan on live.
INACTIVE_DEVELOPER = 7, // Inactive developer, limited permissions.
DEVELOPER = 8, // Active developer, full permissions on live.
OPERATOR = 9 // Can shutdown server for restarts & updates.
};
#endif //!__EGAMEMASTERLEVEL__H__

View File

@@ -0,0 +1,15 @@
#ifndef __EPHYSICSEFFECTTYPE__H__
#define __EPHYSICSEFFECTTYPE__H__
#include <cstdint>
enum class ePhysicsEffectType : uint32_t {
PUSH,
ATTRACT,
REPULSE,
GRAVITY_SCALE,
FRICTION
};
#endif //!__EPHYSICSEFFECTTYPE__H__

View File

@@ -35,7 +35,7 @@ public:
{"OnTimerDone", eTriggerEventType::TIMER_DONE},
{"OnRebuildComplete", eTriggerEventType::REBUILD_COMPLETE},
{"OnActivated", eTriggerEventType::ACTIVATED},
{"OnDeactivated", eTriggerEventType::DEACTIVATED},
{"OnDectivated", eTriggerEventType::DEACTIVATED}, // Dectivated vs Deactivated
{"OnArrived", eTriggerEventType::ARRIVED},
{"OnArrivedAtEndOfPath", eTriggerEventType::ARRIVED_AT_END_OF_PATH},
{"OnZoneSummaryDismissed", eTriggerEventType::ZONE_SUMMARY_DISMISSED},