1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-07 13:27:13 +01:00

Update the plugin SDK.

Expose new constants and remove deprecated ones.
This commit is contained in:
Sandu Liviu Catalin 2019-08-13 18:23:01 +03:00
parent f1a2e8f003
commit 5266465df6
2 changed files with 93 additions and 40 deletions

View File

@ -103,7 +103,7 @@ typedef enum {
typedef enum { typedef enum {
vcmpPlayerUpdateNormal = 0, vcmpPlayerUpdateNormal = 0,
vcmpPlayerUpdateAiming = 1, vcmpPlayerUpdateAimingDeprecated = 1,
vcmpPlayerUpdateDriver = 2, vcmpPlayerUpdateDriver = 2,
vcmpPlayerUpdatePassenger = 3, vcmpPlayerUpdatePassenger = 3,
forceSizeVcmpPlayerUpdate = INT32_MAX forceSizeVcmpPlayerUpdate = INT32_MAX
@ -187,6 +187,7 @@ typedef enum {
vcmpVehicleOptionSingleUse = 6, vcmpVehicleOptionSingleUse = 6,
vcmpVehicleOptionEngineDisabled = 7, vcmpVehicleOptionEngineDisabled = 7,
vcmpVehicleOptionBootOpen = 8, vcmpVehicleOptionBootOpen = 8,
vcmpVehicleOptionBonnetOpen = 9,
forceSizeVcmpVehicleOption = INT32_MAX forceSizeVcmpVehicleOption = INT32_MAX
} vcmpVehicleOption; } vcmpVehicleOption;
@ -195,6 +196,31 @@ typedef enum {
forceSizeVcmpPickupOption = INT32_MAX forceSizeVcmpPickupOption = INT32_MAX
} vcmpPickupOption; } vcmpPickupOption;
typedef enum {
vcmpNetworkStatisticsOptionDataSentPerSecond = 0,
vcmpNetworkStatisticsOptionDataResentPerSecond = 1,
vcmpNetworkStatisticsOptionDataReceivedPerSecond = 2,
vcmpNetworkStatisticsOptionDataDiscardedPerSecond = 3,
vcmpNetworkStatisticsOptionAllBytesSentPerSecond = 4,
vcmpNetworkStatisticsOptionAllBytesReceivedPerSecond = 5,
vcmpNetworkStatisticsOptionDataSentTotal = 6,
vcmpNetworkStatisticsOptionDataResentTotal = 7,
vcmpNetworkStatisticsOptionDataReceivedTotal = 8,
vcmpNetworkStatisticsOptionDataDiscardedTotal = 9,
vcmpNetworkStatisticsOptionAllBytesSentTotal = 10,
vcmpNetworkStatisticsOptionAllBytesReceivedTotal = 11,
vcmpNetworkStatisticsOptionMessagesWaiting = 12,
vcmpNetworkStatisticsOptionMessagesResending = 13,
vcmpNetworkStatisticsOptionBytesResending = 14,
vcmpNetworkStatisticsOptionPacketLossPerSecond = 15,
vcmpNetworkStatisticsOptionPacketLossTotal = 16,
forceSizeVcmpNetworkStatisticsOption = INT32_MAX
} vcmpNetworkStatisticsOption;
typedef struct { typedef struct {
uint32_t structSize; uint32_t structSize;
@ -212,7 +238,7 @@ typedef struct {
uint32_t (*GetNumberOfPlugins) (void); uint32_t (*GetNumberOfPlugins) (void);
/* vcmpErrorNoSuchEntity, vcmpErrorNullArgument */ /* vcmpErrorNoSuchEntity, vcmpErrorNullArgument */
vcmpError (*GetPluginInfo) (int32_t pluginId, PluginInfo* pluginInfo); vcmpError (*GetPluginInfo) (int32_t pluginId, PluginInfo* pluginInfo);
/* -1 == vcmpEntityNone */ /* Return value of -1 indicates vcmpErrorNoSuchEntity */
int32_t (*FindPlugin) (const char* pluginName); int32_t (*FindPlugin) (const char* pluginName);
/* GetLastError: vcmpErrorNoSuchEntity */ /* GetLastError: vcmpErrorNoSuchEntity */
const void** (*GetPluginExports) (int32_t pluginId, size_t* exportCount); const void** (*GetPluginExports) (int32_t pluginId, size_t* exportCount);
@ -352,7 +378,7 @@ typedef struct {
* Key binds * Key binds
*/ */
/* -1 == vcmpEntityNone */ /* Return value of -1 indicates vcmpErrorNoSuchEntity */
int32_t (*GetKeyBindUnusedSlot) (void); int32_t (*GetKeyBindUnusedSlot) (void);
/* vcmpErrorNoSuchEntity */ /* vcmpErrorNoSuchEntity */
vcmpError (*GetKeyBindData) (int32_t bindId, uint8_t* isCalledOnReleaseOut, int32_t* keyOneOut, int32_t* keyTwoOut, int32_t* keyThreeOut); vcmpError (*GetKeyBindData) (int32_t bindId, uint8_t* isCalledOnReleaseOut, int32_t* keyOneOut, int32_t* keyTwoOut, int32_t* keyThreeOut);
@ -425,7 +451,7 @@ typedef struct {
* Player access and basic info * Player access and basic info
*/ */
/* -1 == vcmpEntityNone */ /* Return value of -1 indicates vcmpErrorNoSuchEntity */
int32_t (*GetPlayerIdFromName) (const char* name); int32_t (*GetPlayerIdFromName) (const char* name);
/* success */ /* success */
uint8_t (*IsPlayerConnected) (int32_t playerId); uint8_t (*IsPlayerConnected) (int32_t playerId);
@ -920,25 +946,28 @@ typedef struct {
vcmpError (*KillPlayer) (int32_t playerId); vcmpError (*KillPlayer) (int32_t playerId);
/* vcmpErrorNoSuchEntity */ /* vcmpErrorNoSuchEntity */
vcmpError (*SetVehicle3DArrowForPlayer) (int32_t nVehicleId, int32_t nTargetPlayerId, uint8_t bEnabled); vcmpError (*SetVehicle3DArrowForPlayer) (int32_t vehicleId, int32_t targetPlayerId, uint8_t isEnabled);
/* GetLastError: vcmpErrorNoSuchEntity */ /* GetLastError: vcmpErrorNoSuchEntity */
uint8_t (*GetVehicle3DArrowForPlayer) (int32_t nVehicleId, int32_t nTargetPlayerId); uint8_t (*GetVehicle3DArrowForPlayer) (int32_t vehicleId, int32_t targetPlayerId);
/* vcmpErrorNoSuchEntity */ /* vcmpErrorNoSuchEntity */
vcmpError (*SetPlayer3DArrowForPlayer) (int32_t nPlayerId, int32_t nTargetPlayerId, uint8_t bEnabled); vcmpError (*SetPlayer3DArrowForPlayer) (int32_t playerId, int32_t targetPlayerId, uint8_t isEnabled);
/* GetLastError: vcmpErrorNoSuchEntity */ /* GetLastError: vcmpErrorNoSuchEntity */
uint8_t (*GetPlayer3DArrowForPlayer) (int32_t nPlayerId, int32_t nTargetPlayerId); uint8_t (*GetPlayer3DArrowForPlayer) (int32_t playerId, int32_t targetPlayerId);
/* vcmpErrorNoSuchEntity */ /* vcmpErrorNoSuchEntity */
vcmpError (*SetPlayerDrunkHandling) (int32_t nPlayerId, uint32_t dwDrunkLevel); vcmpError (*SetPlayerDrunkHandling) (int32_t playerId, uint32_t drunkLevel);
/* GetLastError: vcmpErrorNoSuchEntity */ /* GetLastError: vcmpErrorNoSuchEntity */
uint32_t (*GetPlayerDrunkHandling) (int32_t nPlayerId); uint32_t (*GetPlayerDrunkHandling) (int32_t playerId);
/* vcmpErrorNoSuchEntity */ /* vcmpErrorNoSuchEntity */
vcmpError (*SetPlayerDrunkVisuals) (int32_t nPlayerId, uint8_t byteDrunkLevel); vcmpError (*SetPlayerDrunkVisuals) (int32_t playerId, uint8_t drunkLevel);
/* GetLastError: vcmpErrorNoSuchEntity */ /* GetLastError: vcmpErrorNoSuchEntity */
uint8_t (*GetPlayerDrunkVisuals) (int32_t nPlayerId); uint8_t (*GetPlayerDrunkVisuals) (int32_t playerId);
/* vcmpErrorNoSuchEntity, vcmpErrorRequestDenied */ /* vcmpErrorNoSuchEntity, vcmpErrorRequestDenied */
vcmpError (*InterpolateCameraLookAt) (int32_t playerId, float lookX, float lookY, float lookZ, uint32_t dwInterpTimeMS); vcmpError (*InterpolateCameraLookAt) (int32_t playerId, float lookX, float lookY, float lookZ, uint32_t interpTimeMS);
/* GetLastError: vcmpErrorNoSuchEntity, vcmpErrorArgumentOutOfBounds */
double (*GetNetworkStatistics) (int32_t playerId, vcmpNetworkStatisticsOption option);
} PluginFuncs; } PluginFuncs;

View File

@ -262,7 +262,6 @@ static const EnumElement g_EntityPoolEnum[] = {
static const EnumElement g_PlayerUpdateEnum[] = { static const EnumElement g_PlayerUpdateEnum[] = {
{_SC("Unknown"), SQMOD_UNKNOWN}, {_SC("Unknown"), SQMOD_UNKNOWN},
{_SC("Normal"), vcmpPlayerUpdateNormal}, {_SC("Normal"), vcmpPlayerUpdateNormal},
{_SC("Aiming"), vcmpPlayerUpdateAiming},
{_SC("Driver"), vcmpPlayerUpdateDriver}, {_SC("Driver"), vcmpPlayerUpdateDriver},
{_SC("Passenger"), vcmpPlayerUpdatePassenger}, {_SC("Passenger"), vcmpPlayerUpdatePassenger},
{_SC("Max"), vcmpPlayerUpdatePassenger} {_SC("Max"), vcmpPlayerUpdatePassenger}
@ -370,6 +369,7 @@ static const EnumElement g_VehicleOptionEnum[] = {
{_SC("SingleUse"), vcmpVehicleOptionSingleUse}, {_SC("SingleUse"), vcmpVehicleOptionSingleUse},
{_SC("EngineDisabled"), vcmpVehicleOptionEngineDisabled}, {_SC("EngineDisabled"), vcmpVehicleOptionEngineDisabled},
{_SC("BootOpen"), vcmpVehicleOptionBootOpen}, {_SC("BootOpen"), vcmpVehicleOptionBootOpen},
{_SC("BonnetOpen"), vcmpVehicleOptionBonnetOpen},
{_SC("Max"), vcmpVehicleOptionBootOpen} {_SC("Max"), vcmpVehicleOptionBootOpen}
}; };
@ -380,6 +380,29 @@ static const EnumElement g_PickupOptionEnum[] = {
{_SC("Max"), vcmpPickupOptionSingleUse} {_SC("Max"), vcmpPickupOptionSingleUse}
}; };
// ------------------------------------------------------------------------------------------------
static const EnumElement g_NetworkStatisticsOptionEnum[] = {
{_SC("Unknown"), SQMOD_UNKNOWN},
{_SC("DataSentPerSecond"), vcmpNetworkStatisticsOptionDataSentPerSecond},
{_SC("DataResentPerSecond"), vcmpNetworkStatisticsOptionDataResentPerSecond},
{_SC("DataReceivedPerSecond"), vcmpNetworkStatisticsOptionDataReceivedPerSecond},
{_SC("DataDiscardedPerSecond"), vcmpNetworkStatisticsOptionDataDiscardedPerSecond},
{_SC("AllBytesSentPerSecond"), vcmpNetworkStatisticsOptionAllBytesSentPerSecond},
{_SC("AllBytesReceivedPerSecond"), vcmpNetworkStatisticsOptionAllBytesReceivedPerSecond},
{_SC("DataSentTotal"), vcmpNetworkStatisticsOptionDataSentTotal},
{_SC("DataResentTotal"), vcmpNetworkStatisticsOptionDataResentTotal},
{_SC("DataReceivedTotal"), vcmpNetworkStatisticsOptionDataReceivedTotal},
{_SC("DataDiscardedTotal"), vcmpNetworkStatisticsOptionDataDiscardedTotal},
{_SC("AllBytesSentTotal"), vcmpNetworkStatisticsOptionAllBytesSentTotal},
{_SC("AllBytesReceivedTotal"), vcmpNetworkStatisticsOptionAllBytesReceivedTotal},
{_SC("MessagesWaiting"), vcmpNetworkStatisticsOptionMessagesWaiting},
{_SC("MessagesResending"), vcmpNetworkStatisticsOptionMessagesResending},
{_SC("BytesResending"), vcmpNetworkStatisticsOptionBytesResending},
{_SC("PacketLossPerSecond"), vcmpNetworkStatisticsOptionPacketLossPerSecond},
{_SC("PacketLossTotal"), vcmpNetworkStatisticsOptionPacketLossTotal},
{_SC("Max"), vcmpNetworkStatisticsOptionPacketLossTotal}
};
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static const EnumElement g_BodyPartEnum[] = { static const EnumElement g_BodyPartEnum[] = {
{_SC("Unknown"), SQMOD_UNKNOWN}, {_SC("Unknown"), SQMOD_UNKNOWN},
@ -1190,32 +1213,33 @@ static const EnumElement g_AsciiEnum[] = {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
static const EnumElements g_EnumList[] = { static const EnumElements g_EnumList[] = {
{_SC("SqMod"), g_SqMod}, {_SC("SqMod"), g_SqMod},
{_SC("SqArchitecture"), g_ArchitectureEnum}, {_SC("SqArchitecture"), g_ArchitectureEnum},
{_SC("SqPlatform"), g_PlatformEnum}, {_SC("SqPlatform"), g_PlatformEnum},
{_SC("SqEvent"), g_EventEnum}, {_SC("SqEvent"), g_EventEnum},
{_SC("SqCreate"), g_CreateEnum}, {_SC("SqCreate"), g_CreateEnum},
{_SC("SqDestroy"), g_DestroyEnum}, {_SC("SqDestroy"), g_DestroyEnum},
{_SC("SqServerError"), g_ServerErrorEnum}, {_SC("SqServerError"), g_ServerErrorEnum},
{_SC("SqEntityPool"), g_EntityPoolEnum}, {_SC("SqEntityPool"), g_EntityPoolEnum},
{_SC("SqPlayerUpdate"), g_PlayerUpdateEnum}, {_SC("SqPlayerUpdate"), g_PlayerUpdateEnum},
{_SC("SqVehicleUpdate"), g_VehicleUpdateEnum}, {_SC("SqVehicleUpdate"), g_VehicleUpdateEnum},
{_SC("SqPlayerVehicle"), g_PlayerVehicleEnum}, {_SC("SqPlayerVehicle"), g_PlayerVehicleEnum},
{_SC("SqVehicleSync"), g_VehicleSyncEnum}, {_SC("SqVehicleSync"), g_VehicleSyncEnum},
{_SC("SqPartReason"), g_PartReasonEnum}, {_SC("SqPartReason"), g_PartReasonEnum},
{_SC("SqServerOption"), g_ServerOptionEnum}, {_SC("SqServerOption"), g_ServerOptionEnum},
{_SC("SqPlayerOption"), g_PlayerOptionEnum}, {_SC("SqPlayerOption"), g_PlayerOptionEnum},
{_SC("SqVehicleOption"), g_VehicleOptionEnum}, {_SC("SqVehicleOption"), g_VehicleOptionEnum},
{_SC("SqPickupOption"), g_PickupOptionEnum}, {_SC("SqPickupOption"), g_PickupOptionEnum},
{_SC("SqBodyPart"), g_BodyPartEnum}, {_SC("NetworkStatisticsOption"), g_NetworkStatisticsOptionEnum},
{_SC("SqPlayerState"), g_PlayerStateEnum}, {_SC("SqBodyPart"), g_BodyPartEnum},
{_SC("SqPlayerAction"), g_PlayerActionEnum}, {_SC("SqPlayerState"), g_PlayerStateEnum},
{_SC("SqWeather"), g_WeatherEnum}, {_SC("SqPlayerAction"), g_PlayerActionEnum},
{_SC("SqWep"), g_WeaponEnum}, {_SC("SqWeather"), g_WeatherEnum},
{_SC("SqVeh"), g_VehicleEnum}, {_SC("SqWep"), g_WeaponEnum},
{_SC("SqSkin"), g_SkinEnum}, {_SC("SqVeh"), g_VehicleEnum},
{_SC("SqKeyCode"), g_KeyCodeEnum}, {_SC("SqSkin"), g_SkinEnum},
{_SC("SqASCII"), g_AsciiEnum} {_SC("SqKeyCode"), g_KeyCodeEnum},
{_SC("SqASCII"), g_AsciiEnum}
}; };
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------