From 3c8c95d4010175f035d52d56ac81afaf37347c9a Mon Sep 17 00:00:00 2001 From: Spiller <71810100+vancityspiller@users.noreply.github.com> Date: Sun, 7 Jul 2024 14:36:43 +0530 Subject: [PATCH] Update VCMP plugin header (0.4.7.0) --- module/Entity/Player.cpp | 16 ++++------------ module/Entity/Player.hpp | 12 ++++++------ module/Entity/Vehicle.cpp | 4 ---- module/Entity/Vehicle.hpp | 4 ++-- module/Misc/Constants.cpp | 16 ---------------- module/Misc/Official.cpp | 8 ++++---- module/VCMP/vcmp20.h | 36 ++++++++++++++++++++++++++++++++---- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/module/Entity/Player.cpp b/module/Entity/Player.cpp index 85031e56..efece98c 100644 --- a/module/Entity/Player.cpp +++ b/module/Entity/Player.cpp @@ -227,7 +227,6 @@ const SQChar * CPlayer::GetUID2() const // Return the requested information return s_Buffer; } -#if SQMOD_SDK_LEAST(2, 1) // ------------------------------------------------------------------------------------------------ void CPlayer::Kill() const { @@ -236,7 +235,6 @@ void CPlayer::Kill() const // Perform the requested operation _Func->KillPlayer(m_ID); } -#endif // ------------------------------------------------------------------------------------------------ void CPlayer::Kick() const { @@ -1422,7 +1420,7 @@ void CPlayer::Unspectate() const // Spectate the given target _Func->SetPlayerSpectateTarget(m_ID, -1); } -#if SQMOD_SDK_LEAST(2, 1) + // ------------------------------------------------------------------------------------------------ void CPlayer::SetPlayer3DArrow(CPlayer & target, bool toggle) const { @@ -1475,7 +1473,7 @@ bool CPlayer::InterpolateCameraLookAtEx(float x, float y, float z, uint32_t ms) // Perform the requested operation return _Func->InterpolateCameraLookAt(m_ID, x, y, z, ms) != vcmpErrorRequestDenied; } -#endif + // ------------------------------------------------------------------------------------------------ void CPlayer::Redirect(StackStrF & ip, uint32_t port, StackStrF & nick, StackStrF & server_pass, StackStrF & user_pass) const @@ -1508,7 +1506,7 @@ void CPlayer::PlaySound(int32_t sound_id) const // Perform the requested operation _Func->PlaySound(_Func->GetPlayerUniqueWorld(m_ID), sound_id, NAN, NAN, NAN); } -#if SQMOD_SDK_LEAST(2, 1) + // ------------------------------------------------------------------------------------------------ void CPlayer::SetDrunkHandling(SQInteger level) const { @@ -1544,7 +1542,7 @@ SQInteger CPlayer::GetDrunkVisuals() const // Perform the requested operation return _Func->GetPlayerDrunkVisuals(m_ID); } -#endif + // ------------------------------------------------------------------------------------------------ LightObj & CPlayer::CreateCheckpointEx1a(int32_t world, bool sphere, float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a, float radius) const @@ -2864,10 +2862,8 @@ void Register_CPlayer(HSQUIRRELVM vm) .Prop(_SC("Away"), &CPlayer::IsAway) .Prop(_SC("Spec"), &CPlayer::GetSpectator, &CPlayer::SetSpectator) .Prop(_SC("SpecID"), &CPlayer::GetSpectatorID, &CPlayer::SetSpectatorID) -#if SQMOD_SDK_LEAST(2, 1) .Prop(_SC("DrunkHandling"), &CPlayer::GetDrunkHandling, &CPlayer::SetDrunkHandling) .Prop(_SC("DrunkVisuals"), &CPlayer::GetDrunkVisuals, &CPlayer::SetDrunkVisuals) -#endif .Prop(_SC("CollideAreas"), &CPlayer::GetCollideAreas, &CPlayer::SetCollideAreas) .Prop(_SC("Authority"), &CPlayer::GetAuthority, &CPlayer::SetAuthority) .Prop(_SC("TrackPosition"), &CPlayer::GetTrackPosition, &CPlayer::SetTrackPosition) @@ -2890,9 +2886,7 @@ void Register_CPlayer(HSQUIRRELVM vm) .Prop(_SC("Blue"), &CPlayer::GetColorB, &CPlayer::SetColorB) // Member Methods .Func(_SC("StreamedFor"), &CPlayer::IsStreamedFor) -#if SQMOD_SDK_LEAST(2, 1) .Func(_SC("Kill"), &CPlayer::Kill) -#endif .Func(_SC("Kick"), &CPlayer::Kick) .Func(_SC("Ban"), &CPlayer::Ban) .Func(_SC("KickBecause"), &CPlayer::KickBecause) @@ -2926,14 +2920,12 @@ void Register_CPlayer(HSQUIRRELVM vm) .Func(_SC("Spectating"), &CPlayer::GetSpectator) .Func(_SC("Unspectate"), &CPlayer::Unspectate) .Func(_SC("Spectate"), &CPlayer::SetSpectator) -#if SQMOD_SDK_LEAST(2, 1) .Func(_SC("SetPlayer3DArrow"), &CPlayer::SetPlayer3DArrow) .Func(_SC("GetPlayer3DArrow"), &CPlayer::GetPlayer3DArrow) .Func(_SC("SetPlayer3DArrowID"), &CPlayer::SetPlayer3DArrowID) .Func(_SC("GetPlayer3DArrowID"), &CPlayer::GetPlayer3DArrowID) .Func(_SC("InterpolateCameraLookAt"), &CPlayer::InterpolateCameraLookAt) .Func(_SC("InterpolateCameraLookAtEx"), &CPlayer::InterpolateCameraLookAtEx) -#endif .Func(_SC("Redirect"), &CPlayer::Redirect) .Func(_SC("GetModuleList"), &CPlayer::GetModuleList) .Func(_SC("PlaySound"), &CPlayer::PlaySound) diff --git a/module/Entity/Player.hpp b/module/Entity/Player.hpp index c10ef971..f9dd2258 100644 --- a/module/Entity/Player.hpp +++ b/module/Entity/Player.hpp @@ -260,12 +260,12 @@ public: * Retrieve the unique user identifier version 2 of the managed player entity. */ SQMOD_NODISCARD const SQChar * GetUID2() const; -#if SQMOD_SDK_LEAST(2, 1) + /* -------------------------------------------------------------------------------------------- * Set player's health to 0 and reset the death reason. */ void Kill() const; -#endif + /* -------------------------------------------------------------------------------------------- * Kick the managed player entity from the server. */ @@ -750,7 +750,7 @@ public: * Set the managed player entity to spectate no one. */ void Unspectate() const; -#if SQMOD_SDK_LEAST(2, 1) + /* -------------------------------------------------------------------------------------------- * Set whether the target player will see an objective arrow over a player. */ @@ -780,7 +780,7 @@ public: * Smoothly pivots the camera angle. */ SQMOD_NODISCARD bool InterpolateCameraLookAtEx(float x, float y, float z, uint32_t ms) const; -#endif + /* -------------------------------------------------------------------------------------------- * Redirect the managed player entity to the specified server. */ @@ -796,7 +796,7 @@ public: * Retrieve the authority level of the managed player entity. */ void PlaySound(int32_t sound_id) const; -#if SQMOD_SDK_LEAST(2, 1) + /* -------------------------------------------------------------------------------------------- * Set how delayed a player's turn handling is when in a vehicle. */ @@ -816,7 +816,7 @@ public: * Retrieve how intense the drunk blur overlay is for a player. */ SQMOD_NODISCARD SQInteger GetDrunkVisuals() const; -#endif + /* -------------------------------------------------------------------------------------------- * Create a checkpoint or sphere for this player. */ diff --git a/module/Entity/Vehicle.cpp b/module/Entity/Vehicle.cpp index 9d4464ba..57d7c211 100644 --- a/module/Entity/Vehicle.cpp +++ b/module/Entity/Vehicle.cpp @@ -1205,7 +1205,6 @@ bool CVehicle::EmbarkEx(CPlayer & player, int32_t slot, bool allocate, bool warp return (_Func->PutPlayerInVehicle(player.GetID(), m_ID, slot, static_cast< uint8_t >(allocate), static_cast< uint8_t >(warp)) != vcmpErrorRequestDenied); } -#if SQMOD_SDK_LEAST(2, 1) // ------------------------------------------------------------------------------------------------ void CVehicle::SetPlayer3DArrow(CPlayer & target, bool toggle) const { @@ -1241,7 +1240,6 @@ bool CVehicle::GetPlayer3DArrowID(SQInteger id) const // Spectate the given target return _Func->GetVehicle3DArrowForPlayer(m_ID, id); } -#endif // ------------------------------------------------------------------------------------------------ bool CVehicle::GetCollideAreas() const { @@ -2191,12 +2189,10 @@ void Register_CVehicle(HSQUIRRELVM vm) .Func(_SC("SetHandlingRule"), &CVehicle::SetHandlingRule) .Func(_SC("ResetHandlingRule"), &CVehicle::ResetHandlingRule) .Func(_SC("ResetHandlings"), &CVehicle::ResetHandlings) -#if SQMOD_SDK_LEAST(2, 1) .Func(_SC("SetPlayer3DArrow"), &CVehicle::SetPlayer3DArrow) .Func(_SC("GetPlayer3DArrow"), &CVehicle::GetPlayer3DArrow) .Func(_SC("SetPlayer3DArrowID"), &CVehicle::SetPlayer3DArrowID) .Func(_SC("GetPlayer3DArrowID"), &CVehicle::GetPlayer3DArrowID) -#endif .Func(_SC("AreasCollide"), &CVehicle::SetAreasCollide) // Member Overloads .Overload(_SC("SetPos"), &CVehicle::SetPosition) diff --git a/module/Entity/Vehicle.hpp b/module/Entity/Vehicle.hpp index 10d5e98d..078ea426 100644 --- a/module/Entity/Vehicle.hpp +++ b/module/Entity/Vehicle.hpp @@ -622,7 +622,7 @@ public: * Embark the specified player entity into the managed vehicle entity. */ bool EmbarkEx(CPlayer & player, int32_t slot, bool allocate, bool warp); -#if SQMOD_SDK_LEAST(2, 1) + /* -------------------------------------------------------------------------------------------- * Set whether the target player will see an objective arrow over a vehicle. */ @@ -642,7 +642,7 @@ public: * See whether the target player sees an objective arrow over a vehicle. */ SQMOD_NODISCARD bool GetPlayer3DArrowID(SQInteger id) const; -#endif + /* -------------------------------------------------------------------------------------------- * See whether the managed vehicle entity collides with user defined areas. */ diff --git a/module/Misc/Constants.cpp b/module/Misc/Constants.cpp index 94670def..36aed4bb 100644 --- a/module/Misc/Constants.cpp +++ b/module/Misc/Constants.cpp @@ -266,9 +266,6 @@ static const EnumElement g_EntityPoolEnum[] = { static const EnumElement g_PlayerUpdateEnum[] = { {_SC("Unknown"), SQMOD_UNKNOWN}, {_SC("Normal"), vcmpPlayerUpdateNormal}, -#if SQMOD_SDK_PRIOR(2, 1) - {_SC("Aiming"), vcmpPlayerUpdateAiming}, -#endif {_SC("Driver"), vcmpPlayerUpdateDriver}, {_SC("Passenger"), vcmpPlayerUpdatePassenger}, {_SC("Max"), vcmpPlayerUpdatePassenger} @@ -344,12 +341,8 @@ static const EnumElement g_ServerOptionEnum[] = { {_SC("WallGlitch"), vcmpServerOptionWallGlitch}, {_SC("DisableBackfaceCulling"), vcmpServerOptionDisableBackfaceCulling}, {_SC("DisableHeliBladeDamage"), vcmpServerOptionDisableHeliBladeDamage}, -//#if SQMOD_SDK_LEAST(2, 1) {_SC("DisableCrouch"), vcmpServerOptionDisableCrouch}, {_SC("Max"), vcmpServerOptionDisableCrouch} -//#else -// {_SC("Max"), vcmpServerOptionDisableHeliBladeDamage} -//#endif }; // ------------------------------------------------------------------------------------------------ @@ -364,13 +357,8 @@ static const EnumElement g_PlayerOptionEnum[] = { {_SC("CanAttack"), vcmpPlayerOptionCanAttack}, {_SC("HasMarker"), vcmpPlayerOptionHasMarker}, {_SC("ChatTagsEnabled"), vcmpPlayerOptionChatTagsEnabled}, -#if SQMOD_SDK_LEAST(2, 1) {_SC("DrunkEffects"), vcmpPlayerOptionBleeding}, {_SC("Max"), vcmpPlayerOptionBleeding} -#else - {_SC("DrunkEffects"), vcmpPlayerOptionDrunkEffects}, - {_SC("Max"), vcmpPlayerOptionDrunkEffects} -#endif }; // ------------------------------------------------------------------------------------------------ @@ -383,14 +371,10 @@ static const EnumElement g_VehicleOptionEnum[] = { {_SC("Ghost"), vcmpVehicleOptionGhost}, {_SC("Siren"), vcmpVehicleOptionSiren}, {_SC("SingleUse"), vcmpVehicleOptionSingleUse}, -#if SQMOD_SDK_LEAST(2, 1) {_SC("EngineDisabled"), vcmpVehicleOptionEngineDisabled}, {_SC("BootOpen"), vcmpVehicleOptionBootOpen}, {_SC("BonnetOpen"), vcmpVehicleOptionBonnetOpen}, {_SC("Max"), vcmpVehicleOptionBonnetOpen} -#else - {_SC("Max"), vcmpVehicleOptionSingleUse} -#endif }; // ------------------------------------------------------------------------------------------------ diff --git a/module/Misc/Official.cpp b/module/Misc/Official.cpp index a780a741..b0ef7be6 100644 --- a/module/Misc/Official.cpp +++ b/module/Misc/Official.cpp @@ -736,7 +736,7 @@ struct LgPlayer void SetSpectateTarget(LightObj & player) const { player.IsNull() ? Get().SetSpectatorID(-1) : Get().SetSpectator(player.CastI< LgPlayer >()->Get()); } void SetMarkerVisible(bool toggle) const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionHasMarker, static_cast< uint8_t >(toggle)); } void SetCanUseColors(bool toggle) const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionChatTagsEnabled, static_cast< uint8_t >(toggle)); } - void SetDrunkStatus(bool toggle) const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionDrunkEffects, static_cast< uint8_t >(toggle)); } + void SetDrunkStatus(bool toggle) const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionBleeding, static_cast< uint8_t >(toggle)); } void SetWantedLevel(int level) const { Get().SetWantedLevel(level); } // -------------------------------------------------------------------------------------------- SQMOD_NODISCARD LgEntityVector GetPosition() const @@ -787,7 +787,7 @@ struct LgPlayer { return {mID, LgEntityType::Player, LgPlayerVectorFlag::Speed, Get().GetSpeed()}; } SQMOD_NODISCARD bool GetCanUseColors() const { return _Func->GetPlayerOption(GetIdentifier(), vcmpPlayerOptionChatTagsEnabled) >= 1; } SQMOD_NODISCARD bool GetMarkerVisible() const { return _Func->GetPlayerOption(GetIdentifier(), vcmpPlayerOptionHasMarker) >= 1; } - SQMOD_NODISCARD bool GetDrunkStatus() const { return _Func->GetPlayerOption(GetIdentifier(), vcmpPlayerOptionDrunkEffects) >= 1; } + SQMOD_NODISCARD bool GetDrunkStatus() const { return _Func->GetPlayerOption(GetIdentifier(), vcmpPlayerOptionBleeding) >= 1; } SQMOD_NODISCARD double GetFPS() const { return Get().GetFPS(); } SQMOD_NODISCARD const SQChar * GetUniqueID() const { return Get().GetUID(); } SQMOD_NODISCARD const SQChar * GetUniqueID2() const { return Get().GetUID2(); } @@ -828,8 +828,8 @@ struct LgPlayer void RemoveMarker() const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionHasMarker, 0); } void SetMarker(int toggle) const { _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionShowMarkers, static_cast< uint8_t >(toggle)); } void SetDrunkLevel(int visuals, int handling) const { - if (visuals <= 0 && handling <= 0) _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionDrunkEffects, 0); - else _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionDrunkEffects, 1); + if (visuals <= 0 && handling <= 0) _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionBleeding, 0); + else _Func->SetPlayerOption(GetIdentifier(), vcmpPlayerOptionBleeding, 1); } void RedirectPlayerToServer(StackStrF & ip, uint32_t port, StackStrF & nick, StackStrF & spass, StackStrF & upass) const { Get().Redirect(ip, port, nick, spass, upass); } diff --git a/module/VCMP/vcmp20.h b/module/VCMP/vcmp20.h index efb266c0..11bade3e 100644 --- a/module/VCMP/vcmp20.h +++ b/module/VCMP/vcmp20.h @@ -101,7 +101,7 @@ typedef enum { typedef enum { vcmpPlayerUpdateNormal = 0, - vcmpPlayerUpdateAiming = 1, + vcmpPlayerUpdateAimingDeprecated = 1, vcmpPlayerUpdateDriver = 2, vcmpPlayerUpdatePassenger = 3, forceSizeVcmpPlayerUpdate = INT32_MAX @@ -170,7 +170,8 @@ typedef enum { vcmpPlayerOptionCanAttack = 6, vcmpPlayerOptionHasMarker = 7, vcmpPlayerOptionChatTagsEnabled = 8, - vcmpPlayerOptionDrunkEffects = 9, + vcmpPlayerOptionDrunkEffectsDeprecated = 9, + vcmpPlayerOptionBleeding = 10, forceSizeVcmpPlayerOption = INT32_MAX } vcmpPlayerOption; @@ -182,6 +183,9 @@ typedef enum { vcmpVehicleOptionGhost = 4, vcmpVehicleOptionSiren = 5, vcmpVehicleOptionSingleUse = 6, + vcmpVehicleOptionEngineDisabled = 7, + vcmpVehicleOptionBootOpen = 8, + vcmpVehicleOptionBonnetOpen = 9, forceSizeVcmpVehicleOption = INT32_MAX } vcmpVehicleOption; @@ -904,9 +908,33 @@ typedef struct { uint16_t (*GetFallTimer) (void); /* vcmpErrorNoSuchEntity */ - vcmpError(*SetVehicleLightsData) (int32_t vehicleId, uint32_t lightsData); + vcmpError (*SetVehicleLightsData) (int32_t vehicleId, uint32_t lightsData); /* GetLastError: vcmpErrorNoSuchEntity */ - uint32_t(*GetVehicleLightsData) (int32_t vehicleId); + uint32_t (*GetVehicleLightsData) (int32_t vehicleId); + + /* vcmpErrorNoSuchEntity */ + vcmpError (*KillPlayer) (int32_t playerId); + + /* vcmpErrorNoSuchEntity */ + vcmpError (*SetVehicle3DArrowForPlayer) (int32_t nVehicleId, int32_t nTargetPlayerId, uint8_t bEnabled); + /* GetLastError: vcmpErrorNoSuchEntity */ + uint8_t (*GetVehicle3DArrowForPlayer) (int32_t nVehicleId, int32_t nTargetPlayerId); + /* vcmpErrorNoSuchEntity */ + vcmpError (*SetPlayer3DArrowForPlayer) (int32_t nPlayerId, int32_t nTargetPlayerId, uint8_t bEnabled); + /* GetLastError: vcmpErrorNoSuchEntity */ + uint8_t (*GetPlayer3DArrowForPlayer) (int32_t nVehicleId, int32_t nTargetPlayerId); + + /* vcmpErrorNoSuchEntity */ + vcmpError (*SetPlayerDrunkHandling) (int32_t playerId, uint32_t drunkLevel); + /* GetLastError: vcmpErrorNoSuchEntity */ + uint32_t (*GetPlayerDrunkHandling) (int32_t playerId); + /* vcmpErrorNoSuchEntity */ + vcmpError (*SetPlayerDrunkVisuals) (int32_t playerId, uint8_t drunkLevel); + /* GetLastError: vcmpErrorNoSuchEntity */ + uint8_t (*GetPlayerDrunkVisuals) (int32_t playerId); + + /* vcmpErrorNoSuchEntity, vcmpErrorRequestDenied */ + vcmpError (*InterpolateCameraLookAt) (int32_t playerId, float lookX, float lookY, float lookZ, uint32_t interpTimeMS); } PluginFuncs;