Re-introduce Address as int64 and remove the opt-in (#2414)
This commit is contained in:
@@ -60,10 +60,9 @@ enum SDKCallType
|
||||
SDKCall_Player, /**< CBasePlayer call */
|
||||
SDKCall_GameRules, /**< CGameRules call */
|
||||
SDKCall_EntityList, /**< CGlobalEntityList call */
|
||||
SDKCall_Raw, /**< |this| pointer with an arbitrary address. This is not available if SM's virtual addresses are enabled */
|
||||
SDKCall_Raw, /**< |this| pointer with an arbitrary address. You should pass a SourceMod's Address */
|
||||
SDKCall_Server, /**< CBaseServer call */
|
||||
SDKCall_Engine, /**< CVEngineServer call */
|
||||
SDKCall_VirtualAddress /**< |this| pointer with an arbitrary SM virtual address */
|
||||
};
|
||||
|
||||
enum SDKLibrary
|
||||
@@ -90,7 +89,7 @@ enum SDKType
|
||||
SDKType_Edict, /**< edict_t (always as pointer) */
|
||||
SDKType_String, /**< NULL-terminated string (always as pointer) */
|
||||
SDKType_Bool, /**< Boolean (any) */
|
||||
SDKType_VirtualAddress, /**< SM Virtual Address */
|
||||
SDKType_Address, /**< SourceMod's Address */
|
||||
};
|
||||
|
||||
enum SDKPassMethod
|
||||
@@ -192,6 +191,7 @@ native Handle EndPrepSDKCall();
|
||||
* If the return value is a Vector or QAngles, the SECOND parameter must be a Float[3].
|
||||
* If the return value is a string, the THIRD parameter must be a String buffer, and the
|
||||
* FOURTH parameter must be the maximum length.
|
||||
* If the return value is a SourceMod's Address, the SECOND parameter must be an Address variable.
|
||||
* All parameters must be passed after the above is followed. Failure to follow these
|
||||
* rules will result in crashes or wildly unexpected behavior!
|
||||
*
|
||||
|
||||
@@ -78,6 +78,14 @@ struct Plugin
|
||||
#include <commandline>
|
||||
#include <entitylump>
|
||||
|
||||
typedef Address = int64;
|
||||
public const int64 __Int64_Address__ = 0;
|
||||
|
||||
/**< Equivallent to nullptr */
|
||||
public const int64 Address_Null = 0;
|
||||
/**< Size of a pointer in bytes (same as `sizeof(void*)`) */
|
||||
public const int64 Address_PointerSize = 0;
|
||||
|
||||
enum APLRes
|
||||
{
|
||||
APLRes_Success = 0, /**< Plugin should load */
|
||||
@@ -725,11 +733,6 @@ enum NumberType
|
||||
NumberType_Int32
|
||||
};
|
||||
|
||||
enum Address
|
||||
{
|
||||
Address_Null = 0 // a typical invalid result when an address lookup fails
|
||||
};
|
||||
|
||||
/**
|
||||
* Load up to 4 bytes from a memory address.
|
||||
*
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod (C)2004-2025 AlliedModders LLC. All rights reserved.
|
||||
* =============================================================================
|
||||
*
|
||||
* This file is part of the SourceMod/SourcePawn SDK.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
||||
* Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
||||
* this exception to all derivative works. AlliedModders LLC defines further
|
||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
||||
* or <http://www.sourcemod.net/license.php>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
|
||||
#if defined _virtual_address_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _virtual_address_included
|
||||
|
||||
public const Address __Virtual_Address__ = view_as<Address>(0);
|
||||
public const Address PointerSize = view_as<Address>(0); /**< Size of a pointer in bytes (same as `sizeof(void*)`) */
|
||||
Reference in New Issue
Block a user