Everything done, now to test

This commit is contained in:
Aronwk 2025-05-16 22:11:16 -05:00
parent c8a3a2c6de
commit b98470331d
4 changed files with 33 additions and 24 deletions

View File

@ -7,6 +7,7 @@
#include <cstdint> #include <cstdint>
#include <set> #include <set>
#include <string> #include <string>
#include "dTypeDefs.h"
#include "BitStream.h" #include "BitStream.h"
#include "BitStreamUtils.h" #include "BitStreamUtils.h"
#include "MessageType/Client.h" #include "MessageType/Client.h"
@ -38,29 +39,6 @@ constexpr uint32_t lowFrameDelta = FRAMES_TO_MS(lowFramerate);
#define SEND_PACKET Game::server->Send(bitStream, sysAddr, false); #define SEND_PACKET Game::server->Send(bitStream, sysAddr, false);
#define SEND_PACKET_BROADCAST Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true); #define SEND_PACKET_BROADCAST Game::server->Send(bitStream, UNASSIGNED_SYSTEM_ADDRESS, true);
//=========== TYPEDEFS ==========
using LOT = int32_t; //!< A LOT
using LWOOBJID = int64_t; //!< An object ID (should be unsigned actually but ok)
using TSkillID = int32_t; //!< A skill ID
using LWOCLONEID = uint32_t; //!< Used for Clone IDs
using LWOMAPID = uint16_t; //!< Used for Map IDs
using LWOINSTANCEID = uint16_t; //!< Used for Instance IDs
using PROPERTYCLONELIST = uint32_t; //!< Used for Property Clone IDs
using StripId = uint32_t;
constexpr LWOOBJID LWOOBJID_EMPTY = 0; //!< An empty object ID
constexpr LOT LOT_NULL = -1; //!< A null LOT
constexpr int32_t LOOTTYPE_NONE = 0; //!< No loot type available
constexpr float SECONDARY_PRIORITY = 1.0f; //!< Secondary Priority
constexpr uint32_t INVENTORY_MAX = 9999999; //!< The Maximum Inventory Size
constexpr LWOCLONEID LWOCLONEID_INVALID = -1; //!< Invalid LWOCLONEID
constexpr LWOINSTANCEID LWOINSTANCEID_INVALID = -1; //!< Invalid LWOINSTANCEID
constexpr LWOMAPID LWOMAPID_INVALID = -1; //!< Invalid LWOMAPID
constexpr uint64_t LWOZONEID_INVALID = 0; //!< Invalid LWOZONEID
constexpr float PI = 3.14159f;
//============ STRUCTS ============== //============ STRUCTS ==============
struct LWOSCENEID { struct LWOSCENEID {

29
dCommon/dTypeDefs.h Normal file
View File

@ -0,0 +1,29 @@
#pragma once
#ifndef __DTYPEDEFS__H__
#define __DTYPEDEFS__H__
#include <cstdint>
using LOT = int32_t; //!< A LOT
using LWOOBJID = int64_t; //!< An object ID (should be unsigned actually but ok)
using TSkillID = int32_t; //!< A skill ID
using LWOCLONEID = uint32_t; //!< Used for Clone IDs
using LWOMAPID = uint16_t; //!< Used for Map IDs
using LWOINSTANCEID = uint16_t; //!< Used for Instance IDs
using PROPERTYCLONELIST = uint32_t; //!< Used for Property Clone IDs
using StripId = uint32_t;
constexpr LWOOBJID LWOOBJID_EMPTY = 0; //!< An empty object ID
constexpr LOT LOT_NULL = -1; //!< A null LOT
constexpr int32_t LOOTTYPE_NONE = 0; //!< No loot type available
constexpr float SECONDARY_PRIORITY = 1.0f; //!< Secondary Priority
constexpr uint32_t INVENTORY_MAX = 9999999; //!< The Maximum Inventory Size
constexpr LWOCLONEID LWOCLONEID_INVALID = -1; //!< Invalid LWOCLONEID
constexpr LWOINSTANCEID LWOINSTANCEID_INVALID = -1; //!< Invalid LWOINSTANCEID
constexpr LWOMAPID LWOMAPID_INVALID = -1; //!< Invalid LWOMAPID
constexpr uint64_t LWOZONEID_INVALID = 0; //!< Invalid LWOZONEID
constexpr float PI = 3.14159f;
#endif // __DTYPEDEFS__H__

View File

@ -29,4 +29,5 @@ target_include_directories(dNet PRIVATE
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via PossessableComponent.h "${PROJECT_SOURCE_DIR}/dGame/dInventory" # via PossessableComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # via Item.h "${PROJECT_SOURCE_DIR}/dGame/dUtilities" # via Item.h
"${PROJECT_SOURCE_DIR}/dScripts" # transitive through components "${PROJECT_SOURCE_DIR}/dScripts" # transitive through components
"${PROJECT_SOURCE_DIR}/dChatFilter" # for chat message handling
) )

View File

@ -8,6 +8,7 @@
#include "User.h" #include "User.h"
#include "Character.h" #include "Character.h"
#include "dChatFilter.h" #include "dChatFilter.h"
#include "ChatPackets.h"
namespace WorldPackets { namespace WorldPackets {
@ -154,7 +155,7 @@ namespace WorldPackets {
void PositionUpdate::Handle() { void PositionUpdate::Handle() {
Entity* entity = Game::entityManager->GetEntity(objectID); Entity* entity = Game::entityManager->GetEntity(objectID);
if (entity) entity->ProcessPositionUpdate(positionUpdate); if (entity) entity->ProcessPositionUpdate(*this);
} }