mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Merge branch 'main' into item-component
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "dLogger.h"
|
||||
|
||||
enum eInventoryType : uint32_t;
|
||||
enum class eReplicaComponentType : uint32_t;
|
||||
|
||||
/*!
|
||||
\file GeneralUtils.hpp
|
||||
@@ -181,6 +182,11 @@ namespace GeneralUtils {
|
||||
return static_cast<eInventoryType>(std::stoul(value));
|
||||
}
|
||||
|
||||
template <>
|
||||
inline eReplicaComponentType Parse(const char* value) {
|
||||
return static_cast<eReplicaComponentType>(std::stoul(value));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool TryParse(const char* value, T& dst) {
|
||||
try {
|
||||
|
19
dCommon/Singleton.h
Normal file
19
dCommon/Singleton.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
template <typename T>
|
||||
class Singleton {
|
||||
public:
|
||||
static T& Instance() {
|
||||
static T instance{};
|
||||
return instance;
|
||||
}
|
||||
|
||||
virtual ~Singleton() = default;
|
||||
Singleton(const Singleton& other) = delete;
|
||||
Singleton(Singleton&& other) = delete;
|
||||
Singleton& operator=(const Singleton& other) = delete;
|
||||
Singleton& operator=(Singleton&& other) = delete;
|
||||
|
||||
protected:
|
||||
Singleton() = default;
|
||||
};
|
@@ -43,8 +43,7 @@ typedef uint32_t LWOCLONEID; //!< Used for Clone IDs
|
||||
typedef uint16_t LWOMAPID; //!< Used for Map IDs
|
||||
typedef uint16_t LWOINSTANCEID; //!< Used for Instance IDs
|
||||
typedef uint32_t PROPERTYCLONELIST; //!< Used for Property Clone IDs
|
||||
typedef uint32_t STRIPID;
|
||||
typedef uint32_t BEHAVIORSTATE;
|
||||
typedef uint32_t StripId;
|
||||
|
||||
typedef int32_t PetTamingPiece; //!< Pet Taming Pieces
|
||||
|
||||
@@ -65,11 +64,6 @@ typedef std::set<LWOOBJID> TSetObjID;
|
||||
|
||||
const float PI = 3.14159f;
|
||||
|
||||
#if defined(__unix) || defined(__APPLE__)
|
||||
//For Linux:
|
||||
typedef __int64_t __int64;
|
||||
#endif
|
||||
|
||||
//============ STRUCTS ==============
|
||||
|
||||
struct LWOSCENEID {
|
||||
@@ -262,20 +256,6 @@ enum eReplicaPacketType {
|
||||
PACKET_TYPE_DESTRUCTION //!< A destruction packet
|
||||
};
|
||||
|
||||
enum ServerDisconnectIdentifiers {
|
||||
SERVER_DISCON_UNKNOWN_SERVER_ERROR = 0, //!< Unknown server error
|
||||
SERVER_DISCON_DUPLICATE_LOGIN = 4, //!< Used when another user with the same username is logged in (duplicate login)
|
||||
SERVER_DISCON_SERVER_SHUTDOWN = 5, //!< Used when the server is shutdown
|
||||
SERVER_DISCON_SERVER_MAP_LOAD_FAILURE = 6, //!< Used when the server cannot load a map
|
||||
SERVER_DISCON_INVALID_SESSION_KEY = 7, //!< Used if the session is invalid
|
||||
SERVER_DISCON_ACCOUNT_NOT_IN_PENDING_LIST = 8, //!< ???
|
||||
SERVER_DISCON_CHARACTER_NOT_FOUND = 9, //!< Used if a character that the server has is not found (i.e, corruption with user-player data)
|
||||
SERVER_DISCON_CHARACTER_CORRUPTED = 10, //!< Similar to abovce
|
||||
SERVER_DISCON_KICK = 11, //!< Used if the user is kicked from the server
|
||||
SERVER_DISCON_FREE_TRIAL_EXPIRED = 12, //!< Used if the user's free trial expired
|
||||
SERVER_DISCON_PLAY_SCHEDULE_TIME_DONE = 13 //!< Used if the user's play time is used up
|
||||
};
|
||||
|
||||
//! The Behavior Types for use with the AI system
|
||||
enum eCombatBehaviorTypes : uint32_t {
|
||||
PASSIVE = 0, //!< The object is passive
|
||||
@@ -380,57 +360,6 @@ enum eNotifyType {
|
||||
NOTIFY_TYPE_NAMINGPET
|
||||
};
|
||||
|
||||
enum eReplicaComponentType : int32_t {
|
||||
COMPONENT_TYPE_CONTROLLABLE_PHYSICS = 1, //!< The ControllablePhysics Component
|
||||
COMPONENT_TYPE_RENDER = 2, //!< The Render Component
|
||||
COMPONENT_TYPE_SIMPLE_PHYSICS = 3, //!< The SimplePhysics Component
|
||||
COMPONENT_TYPE_CHARACTER = 4, //!< The Character Component
|
||||
COMPONENT_TYPE_SCRIPT = 5, //!< The Script Component
|
||||
COMPONENT_TYPE_BOUNCER = 6, //!< The Bouncer Component
|
||||
COMPONENT_TYPE_BUFF = 7, //!< The Buff Component
|
||||
COMPONENT_TYPE_SKILL = 9, //!< The Skill Component
|
||||
COMPONENT_TYPE_ITEM = 11, //!< The Item Component
|
||||
COMPONENT_TYPE_VENDOR = 16, //!< The Vendor Component
|
||||
COMPONENT_TYPE_INVENTORY = 17, //!< The Inventory Component
|
||||
COMPONENT_TYPE_SHOOTING_GALLERY = 19, //!< The Shooting Gallery Component
|
||||
COMPONENT_TYPE_RIGID_BODY_PHANTOM_PHYSICS = 20, //!< The RigidBodyPhantomPhysics Component
|
||||
COMPONENT_TYPE_COLLECTIBLE = 23, //!< The Collectible Component
|
||||
COMPONENT_TYPE_MOVING_PLATFORM = 25, //!< The MovingPlatform Component
|
||||
COMPONENT_TYPE_PET = 26, //!< The Pet Component
|
||||
COMPONENT_TYPE_VEHICLE_PHYSICS = 30, //!< The VehiclePhysics Component
|
||||
COMPONENT_TYPE_MOVEMENT_AI = 31, //!< The MovementAI Component
|
||||
COMPONENT_TYPE_PROPERTY = 36, //!< The Property Component
|
||||
COMPONENT_TYPE_SCRIPTED_ACTIVITY = 39, //!< The ScriptedActivity Component
|
||||
COMPONENT_TYPE_PHANTOM_PHYSICS = 40, //!< The PhantomPhysics Component
|
||||
COMPONENT_TYPE_MODEL = 42, //!< The Model Component
|
||||
COMPONENT_TYPE_PROPERTY_ENTRANCE = 43, //!< The PhantomPhysics Component
|
||||
COMPONENT_TYPE_PROPERTY_MANAGEMENT = 45, //!< The PropertyManagement Component
|
||||
COMPONENT_TYPE_REBUILD = 48, //!< The Rebuild Component
|
||||
COMPONENT_TYPE_SWITCH = 49, //!< The Switch Component
|
||||
COMPONENT_TYPE_ZONE_CONTROL = 50, //!< The ZoneControl Component
|
||||
COMPONENT_TYPE_PACKAGE = 53, //!< The Package Component
|
||||
COMPONENT_TYPE_PLAYER_FLAG = 58, //!< The PlayerFlag Component
|
||||
COMPONENT_TYPE_BASE_COMBAT_AI = 60, //!< The BaseCombatAI Component
|
||||
COMPONENT_TYPE_MODULE_ASSEMBLY = 61, //!< The ModuleAssembly Component
|
||||
COMPONENT_TYPE_PROPERTY_VENDOR = 65, //!< The PropertyVendor Component
|
||||
COMPONENT_TYPE_ROCKET_LAUNCH = 67, //!< The RocketLaunch Component
|
||||
COMPONENT_TYPE_TRIGGER = 69,
|
||||
COMPONENT_TYPE_RACING_CONTROL = 71, //!< The RacingControl Component
|
||||
COMPONENT_TYPE_MISSION_OFFER = 73, //!< The MissionOffer Component
|
||||
COMPONENT_TYPE_EXHIBIT = 75, //!< The Exhibit Component
|
||||
COMPONENT_TYPE_RACING_STATS = 74, //!< The Racing Stats Component
|
||||
COMPONENT_TYPE_SOUND_TRIGGER = 77, //!< The Sound Trigger Component
|
||||
COMPONENT_TYPE_PROXIMITY_MONITOR = 78, //!< The Proximity Monitor Component
|
||||
COMPONENT_TYPE_MISSION = 84, //!< The Mission Component
|
||||
COMPONENT_TYPE_ROCKET_LAUNCH_LUP = 97, //!< The LUP Launchpad Componen
|
||||
COMPONENT_TYPE_RAIL_ACTIVATOR = 104, //!< The Rail Activator Component
|
||||
COMPONENT_TYPE_PLAYER_FORCED_MOVEMENT = 106, //!< The Player Forced Movement Component
|
||||
COMPONENT_TYPE_POSSESSABLE = 108, //!< The Possessable Component
|
||||
COMPONENT_TYPE_LEVEL_PROGRESSION = 109, //!< The Level Progression Component
|
||||
COMPONENT_TYPE_POSSESSOR = 110, //!< The Possessor Component
|
||||
COMPONENT_TYPE_BUILD_BORDER = 114, //!< The Build Border Component
|
||||
COMPONENT_TYPE_DESTROYABLE = 1000, //!< The Destroyable Component
|
||||
};
|
||||
|
||||
enum class UseItemResponse : uint32_t {
|
||||
NoImaginationForPet = 1,
|
||||
|
@@ -546,6 +546,8 @@ enum GAME_MSG : unsigned short {
|
||||
GAME_MSG_REMOVE_RUN_SPEED_MODIFIER = 1506,
|
||||
GAME_MSG_UPDATE_PROPERTY_PERFORMANCE_COST = 1547,
|
||||
GAME_MSG_PROPERTY_ENTRANCE_BEGIN = 1553,
|
||||
GAME_MSG_SET_RESURRECT_RESTORE_VALUES = 1591,
|
||||
GAME_MSG_VEHICLE_STOP_BOOST = 1617,
|
||||
GAME_MSG_REMOVE_BUFF = 1648,
|
||||
GAME_MSG_REQUEST_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1666,
|
||||
GAME_MSG_RESPONSE_MOVE_ITEM_BETWEEN_INVENTORY_TYPES = 1667,
|
||||
|
127
dCommon/dEnums/eReplicaComponentType.h
Normal file
127
dCommon/dEnums/eReplicaComponentType.h
Normal file
@@ -0,0 +1,127 @@
|
||||
#ifndef __EREPLICACOMPONENTTYPE__H__
|
||||
#define __EREPLICACOMPONENTTYPE__H__
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
enum class eReplicaComponentType : uint32_t {
|
||||
INVALID = 0,
|
||||
CONTROLLABLE_PHYSICS,
|
||||
RENDER,
|
||||
SIMPLE_PHYSICS,
|
||||
CHARACTER,
|
||||
SCRIPT,
|
||||
BOUNCER,
|
||||
BUFF, // buff is really 98, this is DESTROYABLE
|
||||
GHOST,
|
||||
SKILL,
|
||||
SPAWNER,
|
||||
ITEM,
|
||||
REBUILD,
|
||||
REBUILD_START,
|
||||
REBUILD_ACTIVATOR,
|
||||
ICON_ONLY,
|
||||
VENDOR,
|
||||
INVENTORY,
|
||||
PROJECTILE_PHYSICS,
|
||||
SHOOTING_GALLERY,
|
||||
RIGID_BODY_PHANTOM_PHYSICS,
|
||||
DROP_EFFECT,
|
||||
CHEST,
|
||||
COLLECTIBLE,
|
||||
BLUEPRINT,
|
||||
MOVING_PLATFORM,
|
||||
PET,
|
||||
PLATFORM_BOUNDARY,
|
||||
MODULE,
|
||||
ARCADE,
|
||||
VEHICLE_PHYSICS, // Havok demo based
|
||||
MOVEMENT_AI,
|
||||
EXHIBIT,
|
||||
OVERHEAD_ICON,
|
||||
PET_CONTROL,
|
||||
MINIFIG,
|
||||
PROPERTY,
|
||||
PET_CREATOR,
|
||||
MODEL_BUILDER,
|
||||
SCRIPTED_ACTIVITY,
|
||||
PHANTOM_PHYSICS,
|
||||
SPRINGPAD,
|
||||
MODEL,
|
||||
PROPERTY_ENTRANCE,
|
||||
FX,
|
||||
PROPERTY_MANAGEMENT,
|
||||
VEHICLE_PHYSICS_NEW, // internal physics based on havok
|
||||
PHYSICS_SYSTEM,
|
||||
QUICK_BUILD,
|
||||
SWITCH,
|
||||
ZONE_CONTROL, // Minigame
|
||||
CHANGLING,
|
||||
CHOICE_BUILD,
|
||||
PACKAGE,
|
||||
SOUND_REPEATER,
|
||||
SOUND_AMBIENT_2D,
|
||||
SOUND_AMBIENT_3D,
|
||||
PRECONDITION,
|
||||
PLAYER_FLAG,
|
||||
CUSTOM_BUILD_ASSEMBLY,
|
||||
BASE_COMBAT_AI,
|
||||
MODULE_ASSEMBLY,
|
||||
SHOWCASE_MODEL_HANDLER,
|
||||
RACING_MODULE,
|
||||
GENERIC_ACTIVATOR,
|
||||
PROPERTY_VENDOR,
|
||||
HF_LIGHT_DIRECTION_GADGET,
|
||||
ROCKET_LAUNCH,
|
||||
ROCKET_LANDING,
|
||||
TRIGGER,
|
||||
DROPPED_LOOT,
|
||||
RACING_CONTROL,
|
||||
FACTION_TRIGGER,
|
||||
MISSION_OFFER,
|
||||
RACING_STATS,
|
||||
LUP_EXHIBIT,
|
||||
BBB,
|
||||
SOUND_TRIGGER,
|
||||
PROXIMITY_MONITOR,
|
||||
RACING_SOUND_TRIGGER,
|
||||
CHAT,
|
||||
FRIENDS_LIST,
|
||||
GUILD,
|
||||
LOCAL_SYSTEM,
|
||||
MISSION,
|
||||
MUTABLE_MODEL_BEHAVIORS,
|
||||
PATHFINDING,
|
||||
PET_TAMING_CONTROL,
|
||||
PROPERTY_EDITOR,
|
||||
SKINNED_RENDER,
|
||||
SLASH_COMMAND,
|
||||
STATUS_EFFECT,
|
||||
TEAMS,
|
||||
TEXT_EFFECT,
|
||||
TRADE,
|
||||
USER_CONTROL,
|
||||
IGNORE_LIST,
|
||||
ROCKET_LAUNCH_LUP,
|
||||
BUFF_REAL, // the real buff component, should just be name BUFF
|
||||
INTERACTION_MANAGER,
|
||||
DONATION_VENDOR,
|
||||
COMBAT_MEDIATOR,
|
||||
COMMENDATION_VENDOR,
|
||||
UNKNOWN_103,
|
||||
RAIL_ACTIVATOR,
|
||||
ROLLER,
|
||||
PLAYER_FORCED_MOVEMENT,
|
||||
CRAFTING,
|
||||
POSSESSABLE,
|
||||
LEVEL_PROGRESSION,
|
||||
POSSESSOR,
|
||||
MOUNT_CONTROL,
|
||||
UNKNOWN_112,
|
||||
PROPERTY_PLAQUE,
|
||||
BUILD_BORDER,
|
||||
UNKOWN_115,
|
||||
CULLING_PLANE,
|
||||
DESTROYABLE = 1000 // Actually 7
|
||||
};
|
||||
|
||||
#endif //!__EREPLICACOMPONENTTYPE__H__
|
24
dCommon/dEnums/eServerDisconnectIdentifiers.h
Normal file
24
dCommon/dEnums/eServerDisconnectIdentifiers.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __ESERVERDISCONNECTIDENTIFIERS__H__
|
||||
#define __ESERVERDISCONNECTIDENTIFIERS__H__
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
enum class eServerDisconnectIdentifiers : uint32_t {
|
||||
UNKNOWN_SERVER_ERROR = 0,
|
||||
WRONG_GAME_VERSION,
|
||||
WRONG_SERVER_VERSION,
|
||||
CONNECTION_ON_INVALID_PORT,
|
||||
DUPLICATE_LOGIN,
|
||||
SERVER_SHUTDOWN,
|
||||
SERVER_MAP_LOAD_FAILURE,
|
||||
INVALID_SESSION_KEY,
|
||||
ACCOUNT_NOT_IN_PENDING_LIST,
|
||||
CHARACTER_NOT_FOUND,
|
||||
CHARACTER_CORRUPTED,
|
||||
KICK,
|
||||
SAVE_FAILURE,
|
||||
FREE_TRIAL_EXPIRED,
|
||||
PLAY_SCHEDULE_TIME_DONE
|
||||
};
|
||||
|
||||
#endif //!__ESERVERDISCONNECTIDENTIFIERS__H__
|
Reference in New Issue
Block a user