Commit Graph

6723 Commits

Author SHA1 Message Date
Asher Baker
39aa75436e
Fix reading/writing string_t array netprops (#1538)
When a netprop is an array the name resolves to the outer DataTable
array, which we then need to recurse into to find the actual prop.

For string_t props we need their sendprop info to call the proxy
function to get their real storage address, but when accessing an array
we were trying to read the prop off the outer DataTable prop, rather
than the real string_t prop. Fix this by using the pProp variable that
FIND_PROP_SEND helpfully provides for us.

Tested by writing/reading the `m_szCrosshairCodes` array, which got
changed to a string_t prop sometime since #1372.

Fixes #1484
2021-07-18 02:01:46 +01:00
Vladimir
f708842e09
Fix conflict with extensions using SteamWorks (#1531)
We were accidentally changing a process-wide global variable when trying to fetch a working ISteamGameServer interface.

Co-Authored-By: komashchenko <komashchenko@users.noreply.github.com>
2021-07-18 00:01:24 +01:00
Asher Baker
86af9601bd
Fix reading/writing float variant-based props (#1536)
When variant support was added for props, the validation checks in the
float related functions weren't updated to allow them.

Tested with the plugin from the forum thread with a spawned
`math_counter`.

Fixes #1501
2021-07-17 20:53:43 +01:00
Asher Baker
5b7c9c5845
Handle detour patches across page boundaries (#1535)
On Linux if a detour crossed a page boundary we would only change the
memory protection of the first page (as we were aligning the address as
required, but not taking into account the length).

I don't have an easy way to test this but it looks correct. `addr + len`
doesn't appear to need to be aligned though, so another option could be
to use `(addr - startPage) + length` as len.

Also fixed a non-zero offset being passed into CDetour's ApplyPatch
function - this is never done internally anywhere, but it doesn't hurt
to fix it.

Fixes #984
2021-07-17 20:53:25 +01:00
Asher Baker
7f2fdf3fe1 Add OnMapInit forward and deprecate OnLevelInit
The change in behaviour to the OnLevelInit forward params isn't obvious
when compiling a plugin, deprecate it to make it a lot more obvious that
something has changed.

Some plugins rely just on the timing of OnLevelInit rather than doing
anything with the entity lump, for these plugins offer a new OnMapInit
forward that is implemented in core rather than sdkhooks. If / when we
offer a new entity lump manipulation API in the future this'll be the
forward where it can be used to make changes.
2021-07-17 20:52:51 +01:00
Asher Baker
70c9a6528a Remove entity lump manipulation from OnLevelInit
Newer Source engine versions now use a dynamically allocated buffer for
the map entity lump, and some maps have over 16MB of entity data - far
larger than our 2MB limit.

There is no sane way we can currently handle this, so just remove the
functionality from the forward until a more comprehensive API can be
designed.

Fixes #1470
2021-07-17 20:52:51 +01:00
Vladimir
54364d213d
Fix output hooks when caller/activator are flipped (#1411)
Co-authored-by: Asher Baker <asherkin@limetech.io>
2021-07-17 15:30:09 +01:00
XeroX
4d6b9895d3
Use display name for currentmap chat trigger (#1512)
This increases the buffer for the map to be consistent with the other calls to GetCurrentMap. Also `currentmap` now uses the map's display name similar how `nextmap` uses it.
2021-07-17 11:46:22 +01:00
komashchenko
f927455778
Removing old GeoIP.dat (#1533) 2021-07-17 11:32:02 +01:00
David Anderson
6928d21bcf Fix crash in FrameIterator. 2021-07-16 18:33:10 -07:00
David Anderson
38eecd5ece Switch to python3 for ambuild. 2021-07-11 22:35:01 -07:00
Adam Short
5aedb73aae
sdktools: Rename SetCollisionGroup to SetEntityCollisionGroup (#1513)
Better aligns the with other natives - makes more sense.
2021-07-10 13:10:26 -07:00
nosoop
387b85406e
logic: Add ability to skip mprotect with StoreToAddress (#1523)
* Implement StoreToAddress param to optionally set memory page permissions

* Update comment
2021-07-10 12:45:00 -07:00
Einyux
823b55c22a
sdkhooks: Allow overriding SDKHook_Think (#1397)
* Allow to block Think()

* Update SDKHookCB comment
2021-07-10 12:42:17 -07:00
Asher Baker
fdfb8837d1 Update SourcePawn 2021-07-06 10:12:23 +01:00
Asher Baker
d7c359c412 Update SourcePawn and AMTL 2021-07-01 22:40:03 +01:00
Asher Baker
82c51dbe75
Fix sm_dump_admcache with command group overrides (#1519) 2021-07-01 22:19:50 +01:00
Asher Baker
77259acf9e
Add SourcePawn debug metadata options to core.cfg (#1412) 2021-06-30 23:20:28 +01:00
Asher Baker
7816379aae
Update SourcePawn (#1518)
This fixes a number of parsing issues and compiler crashes, deprecates enum multipliers, fixes relative include paths on Windows, adds a `static_assert` statement for compile-time checks, and introduces new Linux profiling support.

The relative include paths change will probably break some non-portable projects that relied on the old broken behaviour, but the fix is straightforward. The `#include` directive is now always relative to the file where it is used, whereas on Windows it was previously relative to the initial input file passed to the compiler if `/` was used instead of `\` in include paths.
2021-06-30 18:29:29 +01:00
peace-maker
d192527707
Fix unpacking of GeoLite2 database (#1516)
Apparently you can't unpack and uncompress in one go in Windows and tar -C doesn't affect the input file.
2021-06-30 12:32:40 +01:00
Accelerator
b0563a493c
Update GeoIP2 extension to new GeoLite2 .mmdb database format (#1245)
* Add support for Maxmind GeoIP2 database files (#913).

* Copy/paste error.

* Mark GeoipCode3 as deprecated.

* Fix build when compiling with AMBuild.

* Replace loose libmaxminddb files with submodule.

* Fix Linux build.

* One more hack for submodule.

* Actually fix Linux build.

* GeoIP2 extension to sourcemod

* Update basevotes

When a player leaves during a voteban, he will be banned anyway. Also added a cvar with a ban time setting.

* Update basevotes.sp

* Update AMBuilder

* ke::AString to std::string

* Update extension.cpp

* Update AMBuilder

* Added coordination natives

Added GeoipLatitude, GeoipLongitude, GeoipDistance natives.

* Create osdefs.h

* Update maxminddb_config.h

* Update extension.cpp

* Update extension.cpp

* Added automatic search for database file

* Fix automatic search for database file

* Update extension.cpp

* Update geoip.inc

* .gitmodules revert

* Update geoip.inc

* Update libmaxminddb to version 1.5.2

* Update extension.cpp

* Check language in the DB

* Removed langCount variable

* Determination of the client's language

* Update geoip.inc

* Update geoip.inc

* Update extension.cpp

* Update geoip.inc

* Update extension.cpp

* space instead of tab in .inc

* Update extension.cpp

* Update geoip.inc

* Optimizing length measurement region code

* Update package script to fetch the new GeoLite2 database

This package is the last CC-BY-SA licensed GeoLite2-City database extracted from https://src.fedoraproject.org/rpms/geolite2 from december 2019.

This doubles the download size for SM packages, but it's what we have to deal with atm :(

* Fix potentially returning uninitialized memory in GeoipRegionCode

If the lookup failed, we'd copy back whatever is on the stack in the ccode buffer.

Co-authored-by: Nick Hastings <nshastings@gmail.com>
Co-authored-by: Headline <michaelwflaherty@me.com>
Co-authored-by: Accelerator74 <dmitry@447751-accele74.tmweb.ru>
Co-authored-by: Peace-Maker <peace-maker@wcfan.de>
2021-06-30 13:01:12 +02:00
Stanislav Polshyn
c38d45b9e7
gamedata: SetCollisionGroup signatures for L4D (#1514) 2021-06-29 01:13:56 -07:00
Vladimir
f603b7aec3
Add StringToInt64() and Int64ToString() natives (#1511) 2021-06-28 21:51:49 +01:00
Adam Short
a9d3cf4574
sdktools: Add SetCollisionGroup native (#1461) (#1507)
* Add SetCollisionGroup native

* Add newline to end of file

* Fix gamedata locations

* Remove extra spaces

* Fix gamedata formatting

* Add Windows signature for CS:GO

* Fix native doc comment

* Revert formatting change

* Change references of client -> entity

* Moved CallWrapper into method

* typofix

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2021-06-24 15:04:10 -07:00
rtldg
3b2fa89926
sdktools: Clean non-ingame clients from NormalSHook (#1450) 2021-06-24 14:32:47 -07:00
FlaminSarge
0d956b229f
Update basetriggers ShowFriendlyFire to use the same chat text visibility system as ShowTimeLeft (#1494)
This system is a bit sketchy but I didn't want to rework the entire thing. (If this were to be reworked, it should probably use ReplyToCommand for a lot of this).

This also allows the server to call ff and get a result.
2021-06-24 15:45:56 +01:00
Natanel Shitrit
d73f4e7eca
Documentation corrections and additions (#1498)
* Added `@error` documentation for every function that's missing it.
* Changed tabs to spaces (text alignment)
2021-06-24 15:45:01 +01:00
Accelerator
2778b132f0
Fix matchmaking_ds for gamedata (#1504)
* Fix matchmaking_ds for gamedata

* Update logic_bridge.cpp

* More corrected search for matchmaking_ds

* Fix compile error

* Better method for find matchmaking_ds

Code by psychonic https://github.com/alliedmodders/sourcemod/pull/1504#issuecomment-867310412
2021-06-24 14:00:59 +00:00
Mikusch
1eae765dc3
Update Team Fortress 2 gamedata (#1509) 2021-06-22 19:19:06 +01:00
Vladimir
267eb90da5
Fix not working MENU_DEBUG (#1506)
Replace g_Logger to logger for MENU_DEBUG
2021-06-21 12:11:35 +01:00
Sebastian K
8075ce8371
Add FlagBitsToString - Converts a bit string to a string of flag characters (#377)
* Add new method - Converts a bit string to a string of flag characters

* New syntax

* Set tags

* Fix tags

* Change method name

* Remove for - set null only once
2021-06-17 13:44:50 +02:00
nosoop
d01c72f79b
Update CGameConfig members to use std::string instead of fixed-size char arrays (#1495) 2021-06-03 11:27:16 -05:00
Vladimir
8f73e5e5a1 Update PluginSys.cpp 2021-05-24 14:30:16 -07:00
Vladimir
62142197c1 Add OnNotifyPluginUnloaded forward 2021-05-24 14:30:16 -07:00
Vladimir
ff43e60831 Revert "Add HookPluginUnload() and UnhookPluginUnload() functions"
This reverts commit 2c2d219f3f07d31ba84aa88acfae353c82e75dec.
2021-05-24 14:30:16 -07:00
Vladimir
6b9037790a Revert "Update smn_core.cpp"
This reverts commit ec8b9e1d51b91ca7dd56a4b63bdb732fe944dcee.
2021-05-24 14:30:16 -07:00
Vladimir
babc6abc64 Revert "Update PluginSys.cpp"
This reverts commit dd10098844562112c4b57e97da6b20e4cf4ff30b.
2021-05-24 14:30:16 -07:00
Vladimir
66d932c79f Revert "Update sourcemod.inc"
This reverts commit dbaa470e074fb3716ff4b467f6148c90b50d4220.
2021-05-24 14:30:16 -07:00
Vladimir
7be2f50a98 Update sourcemod.inc
Typo
2021-05-24 14:30:16 -07:00
Vladimir
499f7160a4 Update PluginSys.cpp
Fix not passing Plugin Handle
2021-05-24 14:30:16 -07:00
Vladimir
7aca0cc77f Update smn_core.cpp
Fix parameter number
2021-05-24 14:30:16 -07:00
Vladimir
c874703136 Add HookPluginUnload() and UnhookPluginUnload() functions 2021-05-24 14:30:16 -07:00
Impact
e6129ab2d9
Update FindEntityByClassname docs (#1491)
Makes it a little bit clearer that `startEnt` isn't just an index to start searching from and that passing an invalid one can throw an error
2021-05-21 09:45:42 +01:00
Impact
4a43ac1bdd
entities.inc: Clarify EntIndexToEntRef / EntRefToEntIndex errors (#1370) 2021-05-20 16:07:11 -07:00
Natanel Shitrit
6b7fd8c3dc
clientprefs: Add defines for Cookie name and description max length (#1463) 2021-05-20 15:52:52 -07:00
peace-maker
845c20ad93
Start using Github Actions (#1488)
* Start using Github Actions

Build on windows and linux. Cannot build for macos,
since the builders only support xcode 10+ which dropped
x86 support.

* Build sourcepawn tooling as separate package

Upload build artifacts containing only spcomp and the includes.
This adds a new `--scripting-only` flag to configure.py which skips
everything and goes straight to building spcomp and packaging the
include folder with it.

* Only run the workflows for the master branch

* Split common operations into PackageHelpers file

Don't duplicate the code for packaging releases for the tooling-only packages. Instead use a common `PackageHelpers` class which provides the functionality common to both packages.

This replaces the explicit list of files to package with a directory scan, so we don't have to list them all.

The pgsql sql-init-scripts were missing from the release package before, so they were added here as well. Three scripts from the testsuite were missing from the explicit list (mapdisplayname, floats, findmap), so they're now included.

* Fix Python 2 compatibility

os.scandir is Python 3 only.
2021-05-09 01:46:08 +02:00
Vauff
47c050d5b6
Update TerminateRound signature for CS:GO windows (#1486) 2021-04-29 01:24:26 -07:00
peace-maker
1fbe5e1daa
A2S_Rules fix: Only change host_rules_show if patching was successful (#1459)
If lookup of the patch location failed, don't turn on responding to A2S_Rules queries. Otherwise we'll see the log getting spammed with too large packet sizes again. #1447
2021-04-19 09:33:36 +02:00
yourmnbbn
2b1cc43355
Correct documentation in adt_trie.inc (#1465) 2021-04-04 15:11:30 -07:00
Arthurdead
62cb6a0458
Add sdk'less sample_ext and update -std to 14 (#1456) 2021-03-29 22:12:45 +01:00