Compare commits

..

36 Commits

Author SHA1 Message Date
BotoX
0546426157 Add "Restart Current Map" to sm_map menu. 2019-12-05 18:56:28 +01:00
BotoX
2837dd77a5 Fix GetClientCount(false) 2019-12-05 18:56:28 +01:00
BotoX
30d8882833 Add damageCustom argument to SDKHooks_TakeDamage native. 2019-12-05 18:56:28 +01:00
BotoX
e2990c5e05 fix IsMapValid behavior change by a2246af121 2019-12-05 18:56:28 +01:00
BotoX
5fdb24c6c1 Add OnEntitySpawned to SDKHooks. 2019-12-05 18:56:28 +01:00
BotoX
2c8071995d Implement per-client randomized menus with MenuShufflePerClient native.
Add MenuSetClientMapping native.
2019-12-05 18:56:28 +01:00
BotoX
7ed4e88915 Changes on sm_*say 2019-12-05 18:56:28 +01:00
BotoX
453001ae9c Fix HookEntityOutput/HookSingleEntityOutput bugs in sdktools. 2019-12-05 18:56:28 +01:00
BotoX
b71a98f174 Add GetClientIClient native. 2019-12-05 18:56:28 +01:00
Obuss
6b3ca53a92 Logging changes to various base plugins. 2019-12-05 18:56:28 +01:00
BotoX
da2c643675 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-12-05 18:56:28 +01:00
BotoX
2e0beed7c9 Extend function calling API for natives and allow catching exceptions.
Change sourcepawn url.
2019-12-05 18:56:24 +01:00
BotoX
182da464cd Fix @spec not targeting clients in unassigned team. 2019-11-28 14:48:31 +01:00
BotoX
e42ff417b1 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-11-28 14:48:31 +01:00
BotoX
0c147446d5 Added client id to MultiTargetFilter forward. 2019-11-28 14:48:31 +01:00
BotoX
86fbf20a85 Add more macros to CDetour. 2019-11-28 14:48:31 +01:00
David Anderson
cd1a296e4f
Merge pull request #1131 from alliedmodders/update-sp
Update SourcePawn.
2019-11-24 20:57:06 -08:00
David Anderson
3ddf9f8a0d Update SourcePawn. 2019-11-24 20:41:59 -08:00
komashchenko
82df6087af Update CScore and MVP CSGO gamedata (#1127) 2019-11-19 21:31:54 -08:00
PerfectLaugh
bef8562de5 Fix CSGO Update crash (11/19/2019) (#1125)
* Fix CSGO Update crash (11/19/2019)

We know what happened when Valve do something big.
Not tested on Linux

* Fix RoundRespawn on Windows

* Fix TerminateRound on Linux x86

* Comment out Linux x64 part of TerminateRound

Better leave blank here.
2019-11-18 22:18:28 -05:00
Nicholas Hastings
1000d419fc Throw configuration error on unsupported compilers (#1029) 2019-11-15 16:40:39 -08:00
Einyux
2a9deb6a64 Add missing const to origin parameters (#1079) 2019-11-13 00:33:00 -08:00
42
351e406f85 Fix ArrayStack.Pop documentation (#1099) 2019-11-13 00:26:36 -08:00
David Anderson
d6e518838f
Merge pull request #1053 from nosoop/remote-ext-filename-check
Check short name for remote extensions
2019-11-12 11:45:02 +09:00
hydrogen-mvm
9e39f18230 Fix OpenFile files.inc example (#1120)
"rb" = binary file for *reading* (not writing, that would be "wb").
2019-11-11 16:24:12 -08:00
BotoX
3dd1e5a318 Validate GetEntityHandle in FindEntityByNetClass (#1089) 2019-11-05 22:25:18 -08:00
Bara
23e1c0b71e Add slot define for healthshot/shield and tablet (#1114) 2019-11-04 12:36:17 +00:00
JoinedSenses
a1436cd205 Add windows supported SDKs to powershell checkout-deps (#1116)
.sh version has this bit:

```
if [ $ismac -eq 0 ]; then
  # Add these SDKs for Windows or Linux
  sdks+=( orangebox blade episode1 bms )

  # Add more SDKs for Windows only
  if [ $iswin -eq 1 ]; then
    sdks+=( darkm swarm bgt eye contagion )
  fi
fi
```

Added these to the SDK list.
2019-11-04 12:34:56 +00:00
David Anderson
0d320b7922
Merge pull request #1115 from alliedmodders/update-sp
Update SourcePawn.
2019-11-02 12:32:35 -07:00
David Anderson
b2a0d0e4da Update SourcePawn.
Bug: alliedmodders/sourcepawn#400
Bug: alliedmodders/sourcepawn#401
Bug: alliedmodders/sourcepawn#402
2019-11-02 12:16:04 -07:00
Bara
273f058da9 Add classic knife to CSWeaponID (#1111) 2019-10-31 13:50:29 -07:00
Headline
c6f751bb67
Return DBDriver instead of Handle in DBI (#1109) 2019-10-31 01:53:50 -07:00
Headline
00b7ac5a39
Add bounds check for userid reset on disconnect (#1108) 2019-10-30 17:17:53 -07:00
David Anderson
c0686dc4f9
Merge pull request #1106 from alliedmodders/update-sp
Update SourcePawn to master.
2019-10-28 22:51:30 -07:00
David Anderson
7ab3a3cfd9 Update SourcePawn to master.
This turns on the new expression parser by default.
2019-10-28 21:19:22 -07:00
nosoop
5293815bf6 Check other filename sources on remote extensions 2019-07-29 04:00:18 -07:00
15 changed files with 76 additions and 42 deletions

View File

@ -214,6 +214,16 @@ class SMConfig(object):
if cxx.like('msvc') and len(self.archs) > 1:
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'):
self.configure_gcc(cxx)
elif cxx.family == 'msvc':
@ -379,6 +389,16 @@ class SMConfig(object):
def configure_windows(self, cxx):
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):
if builder.target.platform == 'windows':
binary.sources += ['version.rc']
@ -498,8 +518,7 @@ class SMConfig(object):
if compiler.like('msvc'):
compiler.defines += ['COMPILER_MSVC', 'COMPILER_MSVC32']
if compiler.version >= 1900:
compiler.linkflags += ['legacy_stdio_definitions.lib']
compiler.linkflags += ['legacy_stdio_definitions.lib']
else:
compiler.defines += ['COMPILER_GCC']
@ -613,6 +632,7 @@ SM = SMConfig()
SM.detectProductVersion()
SM.detectSDKs()
SM.configure()
SM.add_libamtl()
if SM.use_auto_versioning():
SM.generated_headers = builder.Build(

View File

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

View File

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

View File

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

View File

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

View File

@ -107,7 +107,7 @@
"RoundRespawn"
{
"library" "server"
"windows" "\x55\x8B\xEC\x83\xEC\x0C\x53\x56\x8B\xF1\x8B\x0D\x2A\x2A\x2A\x2A\x57\x8B\x01"
"windows" "\x55\x8B\xEC\x83\xEC\x0C\x53\x56\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x01"
"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"
"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"
"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\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"
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\xBC\x00\x00\x00\x8B\x7D\x08\x8B\x87\xB4\x0B\x00\x00"
//"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"
}
//In CS:GO this is actually CCSGameRules::CheckRestartRound(void) but to keep same gamedata as cs:s.
@ -204,10 +204,10 @@
{
"CScore"
{
"windows" "63"
"linux" "63"
"linux64" "63"
"mac64" "63"
"windows" "59"
"linux" "59"
"linux64" "59"
"mac64" "59"
}
}
}
@ -223,10 +223,10 @@
{
"MVPs"
{
"windows" "15"
"linux" "15"
"linux64" "15"
"mac64" "15"
"windows" "11"
"linux" "11"
"linux64" "11"
"mac64" "11"
}
}
}

View File

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

View File

@ -45,6 +45,8 @@
#define CS_SLOT_KNIFE 2 /**< Knife slot. */
#define CS_SLOT_GRENADE 3 /**< Grenade slot (will only return one grenade). */
#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 */
@ -156,6 +158,7 @@ enum CSWeaponID
CSWeapon_BUMPMINE = 85,
CSWeapon_MAX_WEAPONS_NO_KNIFES, // Max without the knife item defs, useful when treating all knives as a regular knife.
CSWeapon_BAYONET = 500,
CSWeapon_KNIFE_CLASSIC = 503,
CSWeapon_KNIFE_FLIP = 505,
CSWeapon_KNIFE_GUT = 506,
CSWeapon_KNIFE_KARAMBIT = 507,

View File

@ -547,7 +547,7 @@ native bool SQL_CheckConfig(const char[] name);
* string to return the default driver.
* @return Driver Handle, or INVALID_HANDLE on failure.
*/
native Handle SQL_GetDriver(const char[] name="");
native DBDriver SQL_GetDriver(const char[] name="");
/**
* Reads the driver of an opened database.
@ -557,7 +557,7 @@ native Handle SQL_GetDriver(const char[] name="");
* @param ident_length Maximum length of the buffer.
* @return Driver Handle.
*/
native Handle SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0);
native DBDriver SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0);
/**
* 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'
* character (0xA) to be written as "\r\n" (0xD, 0xA).
*
* Example: "rb" opens a binary file for writing; "at" opens a text file for
* Example: "rb" opens a binary file for reading; "at" opens a text file for
* appending.
*
* @param file File to open.

View File

@ -682,7 +682,7 @@ enum ClientRangeType
* @param size Maximum size of clients array.
* @return Number of client indexes written to clients array.
*/
native int GetClientsInRange(float origin[3], ClientRangeType rangeType, int[] clients, int size);
native int GetClientsInRange(const float origin[3], ClientRangeType rangeType, int[] clients, int size);
/**
* 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 delay Delay in seconds to send the TE.
*/
stock void TE_SendToAllInRange(float origin[3], ClientRangeType rangeType, float delay=0.0)
stock void TE_SendToAllInRange(const float origin[3], ClientRangeType rangeType, float delay=0.0)
{
int[] clients = new int[MaxClients];
int total = GetClientsInRange(origin, rangeType, clients, MaxClients);

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

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

View File

@ -18,7 +18,17 @@ param(
'tf2',
'insurgency',
'sdk2013',
'dota'
'dota',
'orangebox',
'blade',
'episode1',
'bms',
'darkm',
'swarm',
'bgt',
'eye',
'contagion',
'doi'
)
)
@ -78,4 +88,4 @@ Checkout-Repo -Name "ambuild" -Branch "master" -Repo "https://github.com/alliedm
Set-Location ambuild
& python setup.py install
Set-Location ..
Set-Location ..