This is for the few cases where we have function parameters to objects that
don't fit our other predefined types (CBaseEntity, CBasePlayer, string).
Most calls currently pass those as POD (which is incorrect, but works on
x86), or one of the other pointer types (which is also incorrect, and can
lead to confusion, but works on x86 and x86-64).
This type only works when manually buffering the parameter for calls, and
is not supported for return types.
* Fix 'GiveNamedItem' in the game left4dead2.
The method 'CCSPlayer::GiveNamedItem(char const*, int, CBaseEntity*)' does not work in game left4dead2, any given weapon and object immediately falls to the ground, besides, the code is missing a parameter to call this method (even with the added parameter does not give a weapon to hands). Another method 'CTerrorPlayer::GiveNamedItem(char const*, int, bool, CBaseEntity*)' works great, besides it makes it possible to give out all the items that exist in the game.
* Add x64 support
Add x64 support
* Changed argument type to bool.
Changed argument type to bool.
`OnEntitySpawned` is 1.11 only, so this is fine given our API stability guarantees.
Unfortunately the forward name clashes with quite a few plugins using the same name for their SDKHook callback. Normally we'd just put up with this but there are difficult to solve binary compatibility issues where those plugins will get the callback double-called, and there is a separate issue where the forward isn't called for all entity spawns (unlike the SDKHook), so most plugins can't switch to the forward anyway.
Resolves#1558.
This reverts commit 7bab9cc344.
This rounds out the work started in #1548 to complete support for
reading the older SendPropArray type array netprops, along with bringing
SDKTools' GameRule netprop code in sync with core to add string array
support.
There aren't many SendPropArray type props around but this opens up a
few interesting opportunities for plugin developers, particularly in
L4D2 with manipulation of the EMS HUD.
Tested reading the `m_vCPPositions` array in TF2, and reading/writing
the `m_szScriptedHUDStringSet` EMS HUD netprop in L4D2. Closes#1386.
When a custom TraceRay filter / EnumerateEntities enumerator callback
throws an exception we currently continue execution and then return
execution to the calling code as if there were no problems. This
currently causes a heap tracking issue in SourcePawn, but even ignoring
that it is likely the wrong behaviour and differs from our other
synchronous callbacks.
This change causes the exception to be caught, immediately terminates
the trace / enumeration, and propagates the exception state back to the
calling plugin correctly. The implementation here is based on how
SortCustom1D handles exceptions.
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>
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
* 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>
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
* Add PostgreSQL DBI extension
Bug #3849
This adds a postgresql database driver called "pgsql".
The ambuild script changes could be very wrong ;)
* Add pgsql support to clientprefs
This was originally made by Lyfe in bug 3849! Thanks for that.
PostgreSQL supports the 'IF NOT EXISTS' clause when creating tables
since version 9.1, so i've switched to use that.
* Added pgsql support to sql-admin-manager
* Add --pgsql-path to ambuild configure
* More ambuild fixes
* Compile libpq with ambuild
* Try to generate postgres configs
* Add dummy config file
* More ambuild fixes
* Get errorcode and readable error in preparequery
No need to stop getting the errorCode, if the error string should be
retrieved. Just return both!
* Fix indentation in AMBuilderPGSQL
* Try to patch and configure postgres through ambuild
* Revert "Try to patch and configure postgres through ambuild"
This reverts commit 68dfc82b8eb0ce11f621af67ec247b5f47e4a189.
* Update to use PostgreSQL 9.4
* Move postgres preparation into seperate script
Fetching, preparing and configuring of the postgresql sourcecode
is done in a seperate prepare_postgresql.sh script now.
People can use this script for their manual builds,
if they don't want to use checkout-deps.sh.
* Add patch to configure.in again
Remove the version check for autoconf in postgres 9.4 too.
* Nit: Support older objdirs for hasPgSql ambuild option
* Update to use PostgreSQL 9.4.6
* Use newer AMTL and PGSQL 9.6
* Fix threaded queries
When running the thread part of a query, it already gets the atomic
lock. Don't try to get it twice in that case.
Use a seperate lock to protect access to the lastInsertID and
lastAffectedRows variables.
* Fix SetCharacterSet racing with threaded queries
Same fix like in the mysql driver.
* Use ke::AutoLock for lastInsertID mutex
* Fix fetching one more row than available
Don't try to access a row that doesn't exist when iterating rows.
* Improve sanity checks on column access
Don't call libpq functions with out of bounds column indices.
* Let QuoteString return false if quoting failed
* Fix build for x64 support changes and update to PGSQL 9.6.9
* Fix linux build
* Fix building of connection options string
snprintf doesn't support overlapping buffers.
* Update to PostgreSQL 9.6.15
* Fix crash after freeing first IQuery object
* Fix code crunch
* Fix memory leak, cleanup
* Nuke MSVC project and Makefile
* Remove unsupported numeric error codes
* Use STL threads
* Add prebuilt libpq for Linux and Windows
* Restore and fix version.rc file
* Add PostgreSQL build instructions
* Add prebuilt libpq for Mac
* Add win64 libpq build
This is version 9.6.15 since that's what I still had laying around.
* Fix buildscript
* Fix x64 build on linux and mac
Co-authored-by: Erik Minekus <tsunami@tsunami-productions.nl>
* Add A2S_Rules fix for CS:GO to CStrike extension.
* Dont force set the cvar. Add checks before patching.
* Remove incorrect and useless check.
* Remove checking value as it is in the signature.
* Update build script changes to AMBuild 2.1 API to fix build.
* Fix bad check and ConVarRef being resolved too early.
* Whoops. This line is kinda important. Got nuked when refactoring.
* Remove unused variable.
* Updatet gamedata.
* Switch to "Addresses" gamedata lookup
* Add linux64 gamedata
* Fix mac build
Co-authored-by: Ruben Gonzalez <drifter01620@gmail.com>
Co-authored-by: Peace-Maker <peace-maker@wcfan.de>
This is a pretty big diff because SourceMod had lots of multi-arch
workarounds that can now go away. I've also changed 'x64' to 'x86_64' in
many places since this is how AMBuild normalizes it, and it's far too
late to pick the shorter string, so we might as well suck it up.
The --target-archs parameter has been replaced with --targets. It works
the same way.
The default behavior for SDK inclusion is now "present" instead of
"all" since this lowers the burden of storing many SDKs. Official builds
will still be made with --sdks=all.
* 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
* Added VoiceHook functions
* Update extension.h
* Update extension.h
* Code optimization
* Added support for more engines
* Invalidate timers
* Fixes
* Update extension.cpp
* Update voice.cpp
* correct Forward event type to ET_Ignore.
* sdktools_voice: de-implement IsClientSpeaking
* sdktools_voice: Add notice/unbind IsClientSpeaking
Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
* Attempt to correct SDKHooks_TakeDamage
* Define function on both csgo and non-csgo
* Remove unneeded macros
* Fix velocity copy on CTakeDamageInfoHack init