Compare commits

..

17 Commits

Author SHA1 Message Date
BotoX
178202a5b3 Add "Restart Current Map" to sm_map menu. 2019-11-01 01:17:42 +01:00
BotoX
60f3268236 Fix GetClientCount(false) 2019-10-20 12:28:44 +02:00
BotoX
64b3c8fbd8 Add damageCustom argument to SDKHooks_TakeDamage native. 2019-10-20 12:28:44 +02:00
BotoX
4c4629fca7 fix IsMapValid behavior change by a2246af121 2019-10-20 12:28:44 +02:00
BotoX
8749877c62 fix rare crash bug in SDKTools GetGameRulesProxyEnt 2019-10-20 12:28:44 +02:00
BotoX
102b01c626 Add OnEntitySpawned to SDKHooks. 2019-10-20 12:28:44 +02:00
BotoX
8e07790997 Implement per-client randomized menus with MenuShufflePerClient native.
Add MenuSetClientMapping native.
2019-10-20 12:28:44 +02:00
BotoX
a701408c71 Changes on sm_*say 2019-10-20 12:28:44 +02:00
BotoX
2d0fff79a8 Fix HookEntityOutput/HookSingleEntityOutput bugs in sdktools. 2019-10-20 12:28:44 +02:00
BotoX
9da44d67f1 Add GetClientIClient native. 2019-10-20 12:28:44 +02:00
Obuss
1847f5e2dc Logging changes to various base plugins. 2019-10-20 12:28:44 +02:00
BotoX
0dd3361050 Avoid losing console messages.
Buffers up to 16k bytes of SVC_Print if buffer would overflow, then sends chunks every frame.
Sends up to 2048 bytes per frame and does not split messages.
2019-10-20 12:28:44 +02:00
BotoX
11d12aad11 Extend function calling API for natives and allow catching exceptions.
Change sourcepawn url.
2019-10-20 12:28:44 +02:00
BotoX
8ac0c18674 Fix @spec not targeting clients in unassigned team. 2019-10-20 12:28:44 +02:00
BotoX
a0b8153f4b Added hack to make plugins open a menu with all possible targets on ReplyToTargetError COMMAND_TARGET_AMBIGUOUS.
Explanation:
There are two clients in the server, one named gene, the other one "Ene ~special characters~".
An admin issues "sm_slay Ene" and gets following error message: More than one client matched the given pattern.
What this hack will do is: Use GetCmdArg(0, ...); to get the command name "sm_slay".
Use GetCmdArgString(...); to get the arguments supplied to the command.
Use GetLastProcessTargetString(...); (which was implemented in this commit) to retrieve the arguments that were passed to the last ProcessTargetString call.
It will then pass this data to the DynamicTargeting plugin through its AmbiguousMenu native.
The plugin will open up a menu on the client and list all targets which match the pattern that was supplied to ProcessTargetString.
If the client selects a menu entry, FakeClientCommand will be used to re-execute the command with the correct target.
2019-10-20 12:28:44 +02:00
BotoX
a363587be9 Added client id to MultiTargetFilter forward. 2019-10-20 12:28:44 +02:00
BotoX
fdcce81a41 Add more macros to CDetour. 2019-10-20 12:28:44 +02:00
15 changed files with 42 additions and 76 deletions

View File

@ -214,16 +214,6 @@ class SMConfig(object):
if cxx.like('msvc') and len(self.archs) > 1: if cxx.like('msvc') and len(self.archs) > 1:
raise Exception('Building multiple archs with MSVC is not currently supported') raise Exception('Building multiple archs with MSVC is not currently supported')
if cxx.family == 'msvc':
if cxx.version < 1900:
raise Exception('Only MSVC 2015 and later are supported, c++14 support is required.')
if cxx.family == 'gcc':
if cxx.version < 'gcc-4.9':
raise Exception('Only GCC versions 4.9 or greater are supported, c++14 support is required.')
if cxx.family == 'clang':
if cxx.version < 'clang-3.4':
raise Exception('Only clang versions 3.4 or greater are supported, c++14 support is required.')
if cxx.like('gcc'): if cxx.like('gcc'):
self.configure_gcc(cxx) self.configure_gcc(cxx)
elif cxx.family == 'msvc': elif cxx.family == 'msvc':
@ -389,16 +379,6 @@ class SMConfig(object):
def configure_windows(self, cxx): def configure_windows(self, cxx):
cxx.defines += ['WIN32', '_WINDOWS'] cxx.defines += ['WIN32', '_WINDOWS']
def add_libamtl(self):
# Add libamtl.
self.libamtl = {}
for arch in self.archs:
def get_configure_fn(arch):
return lambda builder, name: self.StaticLibrary(builder, name, arch)
extra_vars = {'Configure': get_configure_fn(arch)}
libamtl = builder.Build('public/amtl/amtl/AMBuilder', extra_vars)
self.libamtl[arch] = libamtl.binary
def AddVersioning(self, binary, arch): def AddVersioning(self, binary, arch):
if builder.target.platform == 'windows': if builder.target.platform == 'windows':
binary.sources += ['version.rc'] binary.sources += ['version.rc']
@ -518,7 +498,8 @@ class SMConfig(object):
if compiler.like('msvc'): if compiler.like('msvc'):
compiler.defines += ['COMPILER_MSVC', 'COMPILER_MSVC32'] compiler.defines += ['COMPILER_MSVC', 'COMPILER_MSVC32']
compiler.linkflags += ['legacy_stdio_definitions.lib'] if compiler.version >= 1900:
compiler.linkflags += ['legacy_stdio_definitions.lib']
else: else:
compiler.defines += ['COMPILER_GCC'] compiler.defines += ['COMPILER_GCC']
@ -632,7 +613,6 @@ SM = SMConfig()
SM.detectProductVersion() SM.detectProductVersion()
SM.detectSDKs() SM.detectSDKs()
SM.configure() SM.configure()
SM.add_libamtl()
if SM.use_auto_versioning(): if SM.use_auto_versioning():
SM.generated_headers = builder.Build( SM.generated_headers = builder.Build(

View File

@ -84,7 +84,9 @@ for sdk_name in SM.sdks:
elif builder.target.platform == 'windows': elif builder.target.platform == 'windows':
msvc_ver = compiler.version msvc_ver = compiler.version
vs_year = '' vs_year = ''
if 1900 <= msvc_ver < 2000: if msvc_ver == 1800:
vs_year = '2013'
elif 1900 <= msvc_ver < 2000:
vs_year = '2015' vs_year = '2015'
else: else:
raise Exception('Cannot find libprotobuf for MSVC version "' + str(compiler.version) + '"') raise Exception('Cannot find libprotobuf for MSVC version "' + str(compiler.version) + '"')

View File

@ -1575,10 +1575,7 @@ void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
} }
} }
auto userid = engine->GetPlayerUserId(pPlayer->m_pEdict); m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0;
if (userid != -1)
m_UserIdLookUp[userid] = 0;
pPlayer->Disconnect(); pPlayer->Disconnect();
} }

View File

@ -1364,7 +1364,7 @@ bool CLocalExtension::IsSameFile(const char *file)
bool CRemoteExtension::IsSameFile(const char *file) bool CRemoteExtension::IsSameFile(const char *file)
{ {
/* Check full path and name passed in from LoadExternal */ /* :TODO: this could be better, but no one uses this API anyway. */
return strcmp(file, m_Path.c_str()) == 0 || strcmp(file, m_File.c_str()) == 0; return strcmp(file, m_Path.c_str()) == 0;
} }

View File

@ -244,10 +244,10 @@
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "457" "windows" "456"
"linux" "458" "linux" "457"
"linux64" "458" "linux64" "457"
"mac64" "458" "mac64" "457"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
@ -286,10 +286,10 @@
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "507" "windows" "506"
"linux" "507" "linux" "506"
"linux64" "507" "linux64" "506"
"mac64" "507" "mac64" "506"
} }
"GetVelocity" "GetVelocity"
{ {
@ -335,10 +335,10 @@
} }
"PlayerRunCmd" "PlayerRunCmd"
{ {
"windows" "477" "windows" "476"
"linux" "478" "linux" "477"
"linux64" "478" "linux64" "477"
"mac64" "478" "mac64" "477"
} }
"GiveAmmo" "GiveAmmo"
{ {

View File

@ -107,7 +107,7 @@
"RoundRespawn" "RoundRespawn"
{ {
"library" "server" "library" "server"
"windows" "\x55\x8B\xEC\x83\xEC\x0C\x53\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01" "windows" "\x55\x8B\xEC\x83\xEC\x0C\x53\x56\x8B\xF1\x8B\x0D\x2A\x2A\x2A\x2A\x57\x8B\x01"
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x4C\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x89\x04\x24" "linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x4C\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x89\x04\x24"
"linux64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x53\x48\x89\xFB\x48\x83\xEC\x18\x4C\x8B\x25\x85\x17\xB4\x00" "linux64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x53\x48\x89\xFB\x48\x83\xEC\x18\x4C\x8B\x25\x85\x17\xB4\x00"
"mac64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x54\x53\x48\x83\xEC\x10\x49\x89\xFC\x4C\x8D\x3D\xD7\xB9\x90\x00" "mac64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x54\x53\x48\x83\xEC\x10\x49\x89\xFC\x4C\x8D\x3D\xD7\xB9\x90\x00"
@ -140,8 +140,8 @@
{ {
"library" "server" "library" "server"
"windows" "\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x2A\x53\x8B\xD9\xF3\x0F\x2A\x2A\x2A\x2A\x56\x57\x89\x2A\x2A\x2A\x83\xBB" "windows" "\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x2A\x53\x8B\xD9\xF3\x0F\x2A\x2A\x2A\x2A\x56\x57\x89\x2A\x2A\x2A\x83\xBB"
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\xBC\x00\x00\x00\x8B\x7D\x08\x8B\x87\xB4\x0B\x00\x00" "linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\xBC\x00\x00\x00\x8B\x7D\x08\x8B\x9F"
//"linux64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x49\x89\xFE\x41\x55\x41\x54\x53\x48\x81\xEC\x98\x00\x00\x00\x89\xB5\x68\xFF\xFF\xFF" "linux64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x49\x89\xFE\x41\x55\x41\x54\x53\x48\x81\xEC\x98\x00\x00\x00\x89\xB5\x68\xFF\xFF\xFF"
"mac64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x53\x48\x81\xEC\x08\x01\x00\x00\x41\x89\xF6" "mac64" "\x55\x48\x89\xE5\x41\x57\x41\x56\x41\x55\x41\x54\x53\x48\x81\xEC\x08\x01\x00\x00\x41\x89\xF6"
} }
//In CS:GO this is actually CCSGameRules::CheckRestartRound(void) but to keep same gamedata as cs:s. //In CS:GO this is actually CCSGameRules::CheckRestartRound(void) but to keep same gamedata as cs:s.
@ -204,10 +204,10 @@
{ {
"CScore" "CScore"
{ {
"windows" "59" "windows" "63"
"linux" "59" "linux" "63"
"linux64" "59" "linux64" "63"
"mac64" "59" "mac64" "63"
} }
} }
} }
@ -223,10 +223,10 @@
{ {
"MVPs" "MVPs"
{ {
"windows" "11" "windows" "15"
"linux" "11" "linux" "15"
"linux64" "11" "linux64" "15"
"mac64" "11" "mac64" "15"
} }
} }
} }

View File

@ -84,7 +84,7 @@ methodmap ArrayStack < Handle
// @param block Optionally specify which block to read from // @param block Optionally specify which block to read from
// (useful if the blocksize > 0). // (useful if the blocksize > 0).
// @param asChar Optionally read as a byte instead of a cell. // @param asChar Optionally read as a byte instead of a cell.
// @return Value popped from the stack. // @return True on success, false if the stack is empty.
// @error The stack is empty. // @error The stack is empty.
public native any Pop(int block=0, bool asChar=false); public native any Pop(int block=0, bool asChar=false);
@ -92,7 +92,7 @@ methodmap ArrayStack < Handle
// //
// @param buffer Buffer to store string. // @param buffer Buffer to store string.
// @param maxlength Maximum size of the buffer. // @param maxlength Maximum size of the buffer.
// @param written Number of characters written to buffer, not including // @oaram written Number of characters written to buffer, not including
// the null terminator. // the null terminator.
// @error The stack is empty. // @error The stack is empty.
public native void PopString(char[] buffer, int maxlength, int &written = 0); public native void PopString(char[] buffer, int maxlength, int &written = 0);

View File

@ -45,8 +45,6 @@
#define CS_SLOT_KNIFE 2 /**< Knife slot. */ #define CS_SLOT_KNIFE 2 /**< Knife slot. */
#define CS_SLOT_GRENADE 3 /**< Grenade slot (will only return one grenade). */ #define CS_SLOT_GRENADE 3 /**< Grenade slot (will only return one grenade). */
#define CS_SLOT_C4 4 /**< C4 slot. */ #define CS_SLOT_C4 4 /**< C4 slot. */
#define CS_SLOT_BOOST 11 /**< Slot for healthshot and shield (will only return one weapon/item). */
#define CS_SLOT_UTILITY 12 /**< Slot for tablet. */
#define CS_DMG_HEADSHOT (1 << 30) /**< Headshot */ #define CS_DMG_HEADSHOT (1 << 30) /**< Headshot */
@ -158,7 +156,6 @@ enum CSWeaponID
CSWeapon_BUMPMINE = 85, CSWeapon_BUMPMINE = 85,
CSWeapon_MAX_WEAPONS_NO_KNIFES, // Max without the knife item defs, useful when treating all knives as a regular knife. CSWeapon_MAX_WEAPONS_NO_KNIFES, // Max without the knife item defs, useful when treating all knives as a regular knife.
CSWeapon_BAYONET = 500, CSWeapon_BAYONET = 500,
CSWeapon_KNIFE_CLASSIC = 503,
CSWeapon_KNIFE_FLIP = 505, CSWeapon_KNIFE_FLIP = 505,
CSWeapon_KNIFE_GUT = 506, CSWeapon_KNIFE_GUT = 506,
CSWeapon_KNIFE_KARAMBIT = 507, CSWeapon_KNIFE_KARAMBIT = 507,

View File

@ -547,7 +547,7 @@ native bool SQL_CheckConfig(const char[] name);
* string to return the default driver. * string to return the default driver.
* @return Driver Handle, or INVALID_HANDLE on failure. * @return Driver Handle, or INVALID_HANDLE on failure.
*/ */
native DBDriver SQL_GetDriver(const char[] name=""); native Handle SQL_GetDriver(const char[] name="");
/** /**
* Reads the driver of an opened database. * Reads the driver of an opened database.
@ -557,7 +557,7 @@ native DBDriver SQL_GetDriver(const char[] name="");
* @param ident_length Maximum length of the buffer. * @param ident_length Maximum length of the buffer.
* @return Driver Handle. * @return Driver Handle.
*/ */
native DBDriver SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0); native Handle SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0);
/** /**
* Retrieves a driver's identification string. * Retrieves a driver's identification string.

View File

@ -314,7 +314,7 @@ native bool ReadDirEntry(Handle dir, char[] buffer, int maxlength, FileType &typ
* Mac, this has no distinction from binary mode. On Windows, it causes the '\n' * Mac, this has no distinction from binary mode. On Windows, it causes the '\n'
* character (0xA) to be written as "\r\n" (0xD, 0xA). * character (0xA) to be written as "\r\n" (0xD, 0xA).
* *
* Example: "rb" opens a binary file for reading; "at" opens a text file for * Example: "rb" opens a binary file for writing; "at" opens a text file for
* appending. * appending.
* *
* @param file File to open. * @param file File to open.

View File

@ -682,7 +682,7 @@ enum ClientRangeType
* @param size Maximum size of clients array. * @param size Maximum size of clients array.
* @return Number of client indexes written to clients array. * @return Number of client indexes written to clients array.
*/ */
native int GetClientsInRange(const float origin[3], ClientRangeType rangeType, int[] clients, int size); native int GetClientsInRange(float origin[3], ClientRangeType rangeType, int[] clients, int size);
/** /**
* Retrieves the server's authentication string (SteamID). * Retrieves the server's authentication string (SteamID).

View File

@ -224,7 +224,7 @@ stock void TE_SendToClient(int client, float delay=0.0)
* @param rangeType Range type to use for filtering clients. * @param rangeType Range type to use for filtering clients.
* @param delay Delay in seconds to send the TE. * @param delay Delay in seconds to send the TE.
*/ */
stock void TE_SendToAllInRange(const float origin[3], ClientRangeType rangeType, float delay=0.0) stock void TE_SendToAllInRange(float origin[3], ClientRangeType rangeType, float delay=0.0)
{ {
int[] clients = new int[MaxClients]; int[] clients = new int[MaxClients];
int total = GetClientsInRange(origin, rangeType, clients, MaxClients); int total = GetClientsInRange(origin, rangeType, clients, MaxClients);

@ -1 +1 @@
Subproject commit eb7b6ba084e13c50f7c2c53b285e6e6af44accd9 Subproject commit e00a845c6bc415995ddc4b7ec538d1704fdd0122

@ -1 +1 @@
Subproject commit a496cf77528e976bfc5a665dc87cb59acab59133 Subproject commit 04eafd88631e7a3ba1de6bc7228af0e3d5443f0b

View File

@ -18,17 +18,7 @@ param(
'tf2', 'tf2',
'insurgency', 'insurgency',
'sdk2013', 'sdk2013',
'dota', 'dota'
'orangebox',
'blade',
'episode1',
'bms',
'darkm',
'swarm',
'bgt',
'eye',
'contagion',
'doi'
) )
) )