Commit Graph

88 Commits

Author SHA1 Message Date
Vincent Herbet
6e9947b64f
Sanitize load_amxscript() and add load_amxscript_ex/MF_LoadAmxScriptEx() requiring error max length (#530)
* Add a saner version of load_amxscript and use SafeStrcpy/Sprintf

* Reflect the change in core

* Add LoadAmxScriptEx API function

* Reflect the change in CSX

* Reflect the change in DodX

* Reflect the change in TFCX

* Reflect the change in TSX

* Add few comments
2018-08-30 18:49:42 +02:00
Vincent Herbet
197db8c82b
Update AMTL from upstream (#521) 2018-08-25 11:29:54 +02:00
Vincent Herbet
f822cc610f
Update ReSDK API to latest version (#520) 2018-08-25 09:20:06 +02:00
Karol Szuster
d6e71c8f4f Little cleanup (#461)
* Remove FAKEMETA leftovers

* Move "require_module" native to where it belongs

* Remove broken AMX module support

* Remove useless natives

* Remove "alloc_amxmemory" and "free_amxmemory" functions

* Remove "strip_name" function

* Clean engine a bit

* Export "GiveFnptrsToDll" (Windows) (Core)

* memcpy -> ke::SafeStrcpy

* Export GiveFnptrsToDll in modules

* Update msvc project files
2017-12-07 18:45:16 +01:00
Karol Szuster
361a6cc9e0 Introduce a JSON module (#379)
* Add JSON module

* Merge upstream changes

Fix memory leaks

* Add json include to PackageScript

* Merge upstream changes

Fix memory leaks and increase max nesting

* Fix documentation

* Use AutoPtr in managing JSON handles

* Merge upstream changes

Order of items in an array is preserved after removing an item.

* Merge upstream

* Fix crash

* Add VS projects files and fix mixed tab/spaces

* Remove erroring on "json_free"

* Add comments to "json.inc" file

* Remove overloaded operators

* Use of "override" keyword where needed

* Fix parameter's name
2017-09-30 20:23:12 +02:00
Vincent Herbet
ab854ec035 Improve UTF-8 support in some natives (bug 6475) (#407)
* Compile as static library, update AMBuildScript and link to core

* Update VS project files to include the library

* Add UTF-8 Rewind library (v1.5.1) to third_party directory

* Update ACKNOWLEDGEMENTS.txt

* Move AMXX buffer in its own function

* Move constants from string.inc to string_const.inc and update project files

* Move stocks from string.inc to string_stocks.inc and update project files

* Improve UTF-8 support in containi() and update documentation

* Improve UTF-8 support in strcmp() and update documentation

* Improve UTF-8 support in strfind() and update documentation

Worth to be noted that this native with ignorecase set was not working properly. So broken that no one reported the issue.
This adds also a safety check for "pos" parameter to not go < 0.

* Improve UTF-8 support in strncmp() and update documentation

* Improve UTF-8 support in equali() and update documentation

* Add an option to some UTF-8 Rewind functions for avoiding invalid data to be replaced

By default it replaces any invalid byte or sequence of bytes by 0xFFFD (3 bytes). It can be problematic when the input buffer is not changed (from a plugin) and that some natives need to calculate a position from the converted string. With such replacement, the position is displaced due the final string length being larger.

This compiles the library as C++, because I added some silly param with a default default value which is not supported by C.

* Improve UTF-8 support in replace_string/ex() and update documentation

* Add is_string_category() and update documentation

* Update a little testsuite plugin (and fix linux compilation)

* Add mb_strotolower/upper() and update documentation

* Add mb_ucfirst() and update documentation

* Add mb_strtotile() and update documentation

* Improve UTF-8 support in get_players() and find_player() with name/case insenstive flags set

* Fix KliPPy's complain
2017-08-05 10:32:16 +02:00
Karol Szuster
123246cc84 Port code to AMTL (#427)
* Remove CQueue

* Remove duplicated files

* Move sh_tinyhash to public/

* Remove sm_queue

Make NVault use of ke::Deque

* Remove sh_string (unused)

* Remove CList dependency from CTask

* Remove CList dependency from CEvent

* Remove CList dependency from modules' functions

* Remove CList dependency ForceObject

* Remove CList dependency Player Auth

* Remove left CList dependencies

* Fix msvc project files

* Update AMTL

* Use InlineList for CScript

* Use InlineList for CModule

* Use Vector for Player Auth
2017-04-14 19:36:59 +02:00
Vincent Herbet
da80667fb0 Ignore ReHLDS initialization on listenserver (#425)
* Remove duplicated files

* Ignore ReHLDS initialization if not a dedicated server
2017-03-19 14:12:07 +01:00
Vincent Herbet
115916d753 Add basic ReHLDS and ReGameDLL support (#417)
* Add ReHLDS API files and its dependencies

Note: This has been stolen from ReAPI AMXX module and modified/adjusted to match AMXX existing includes and to provide as less dependencies as possible as well

* Add the necessary files to get ReHLDS interface

* Split SV_DropClient into pre/post code

* Init ReHLDS API and add SV_DropClient hook

* Add Cvar_DirectSet hook and adjust code with helpers

Note: we don't need to split code here. This is pretty much the naive and straight way, but fairly enough for our case. If it happens we got a lot more hooks, we may consider to use some class to manage better the things.

* Move platform and interface stuff in their own files in public directory

* Make sure to init cvar stuff after ReHLDS

* Add ReGameDLL API files and its dependencies in cstrike module

* Init ReHLDS in cstrike module and adjust code

Note: About cs_uset_set_model(). ReHLDS API doesn't offer a way to know directly the precached models, so instead of looping through all the ressources, the models list is saved one time at map change into a hashmap.

* Init ReGameDLL and adjust code

* Fix linux compilation

* Init ReGameDLL in fakemeta module and adjust code

* Rename /reapi directory to /resdk to avoid confusion

* Retrieve gamerules pointer through InstallGameRules in fakemeta module

* Retrieve gamerules pointer through InstallGameRules in cstrike module

Note: actually gamerules is not used if regamedll is enabled, but it could be used in future natives.

* Fix a typo when ReGameDLL is not enabled

* Fix missing interface check for ReHLDS.

I'm pretty sure I was checking at the very first since I worked first on vanilla version of engine, looks like change has been lost.
2017-03-09 19:59:38 +01:00
Vincent Herbet
3a73e12550 Update to the latest AMTL (#410) 2017-02-19 15:01:58 +01:00
Karol Szuster
79d9fc530d Update AMTL (#390) 2016-12-31 23:49:46 +01:00
Vincent Herbet
e24b9548d4 Update to the latest AMTL (#381)
* Update to latest AMTL.

* Update .gitignore for VS2015
2016-08-12 15:30:06 +02:00
Karol Szuster
53f9144fc3 Values by reference in forwards 2016-04-05 18:51:18 +02:00
Arkshine
ae4368a3ca Remove inline comment support in multilingual INI parser 2016-03-16 19:50:46 +01:00
IgnacioDM
e502e12e07 Normalize line endings and whitespace 2016-01-16 21:15:52 -03:00
WPMGPRoSToTeMa
48d7a04c73 SELinux compatibility: memalign -> mmap 2016-01-03 21:38:31 +03:00
Arkshine
02ac6fa2d7 Update to the latest AMTL - Rename Ref to RefPtr. 2015-11-23 14:45:07 +01:00
Vincent Herbet
664c85106f Merge pull request #278 from Arkshine/feature/cstrike-update-2
Update cstrike module - 2
2015-11-21 00:19:01 +01:00
Arkshine
a445e806ea Cstrike: Refactor - Simplify forwards logic, fix and improve few things
- The logic around CS_OnBuy forward has been simplified. Since there is no way to have a consistent way to hook/block for all items, the new logic is to have as less as possible code, especially in blocking mode where we want to avoid to do extra stuffs (e.g blocking sound, event, etc).

  * All guns + shield -> CanBuyThis()
  * Nvgs and Fefuser only -> CanPlayerBuy()
  * The others items -> GiveNamedItem() + AddAccount()
  * Ammos -> -> BuyGunAmmo() + GiveNamedItem() + AddAccount()

- Fixed missing buyzone check when alias from console are used (CS_OnBUy* were incorrectly fired).
- Fixed an infinite loop when buying of ammos are blocked. Sorted by hooking BuyGunAmmo().
- Fixed blocking mode for some items. Some game behaviors were not blocked (e.g. weapon drop).
- Fixed forwards being triggered even though errors were found. Detours are now a destroyed and associated variables resetted when necessary. Toggling forwards state is now based on detours state.
- Moved things in its own functions (game functions to execute, class members retrieval)
- Renamed CommandAliases -> ItemInfos (more generic)
2015-11-21 00:13:06 +01:00
IgnacioDM
72d3f21816 Allow wordspawn in edict/entvars->index type conversion and EHANDLE edict get/set 2015-11-06 07:44:14 -03:00
Arkshine
234b537ad9 Factorize gamerules data code 2015-11-02 20:10:35 +01:00
Arkshine
85f03c4a06 Fix linux compilation with gcc-4.8 and higher. 2015-10-13 20:25:09 +02:00
Arkshine
9bee1f7edf Consistency: Replace GETEDICT with HLTypeConversion in core 2015-10-08 19:36:42 +02:00
Arkshine
6f301b5cea Consistency: Replace GETEDICT, INDEXENT2 and others things with HLTypeConversion in hamsandwich module 2015-10-08 19:24:49 +02:00
Arkshine
429a4596c1 Consistency: Replace INDEXENT2 and others things with HLTypeConversion in fakemeta module 2015-10-07 23:27:56 +02:00
Arkshine
138b9e1510 Remove UTIL_Format() and UTIL_VarArgs() 2015-10-05 19:12:08 +02:00
Arkshine
2d910838a2 Fix AMTL internal paths 2015-10-02 23:22:21 +02:00
Arkshine
f811bab608 Update AMTL to latest revision 2015-10-02 23:22:20 +02:00
Arkshine
16f65663dc Add new natives to read/write on entity's private data based off class/member name available from gamedata files 2015-09-19 20:07:48 +02:00
Vincent Herbet
ac2bcb2d19 Merge pull request #282 from Arkshine/gamedata-type-desc
Modify game config parser to support more offset data and reflect changes
2015-09-07 09:10:28 +02:00
Arkshine
0005d1a6b5 Update AMTL submodule from upstream and reflect changes 2015-08-26 11:15:07 +02:00
Arkshine
ed4faf7c11 Fix player not being internally disconnected in some situation + add client_disconnected forward 2015-08-14 00:08:50 +02:00
Arkshine
7423ac6824 Modify game config parser to support more offset datas (type, size, etc.) 2015-08-10 18:05:59 +02:00
Vincent Herbet
83bc3f518b Fix wrong buffer length 2015-07-17 19:12:02 +02:00
Vincent Herbet
e3489be0c0 Merge pull request #260 from Arkshine/feature/more-amtl-conversion
More AMTL conversion - 🔥 CString and CVector
2015-07-16 12:24:06 +02:00
Arkshine
8be119aa6a Cstrike: cs_set/reset_user_model/team - Stagger user's info updates across multiple frames (bug 3134) 2015-07-14 19:44:08 +02:00
Arkshine
c775cfca73 More AMTL conversion - 🔥 CString and CVector 2015-07-13 23:37:20 +02:00
Arkshine
883c852897 Synchronize AMTL submodule 2015-07-11 14:57:06 +02:00
Vincent Herbet
139a2a082c Merge pull request #254 from Arkshine/feature/gameconfig
Implement a game config parser and expose functionnalities to the module/plugin API
2015-07-11 13:19:09 +02:00
Arkshine
f38c726faf Gameconfig: Add game configs natives 2015-07-11 13:16:45 +02:00
Vincent Herbet
846238fe99 Merge pull request #250 from Nextra/enginew
Engine Update
2015-07-02 18:43:35 +02:00
Arkshine
14513e6f70 Gameconfig: Export game config manager to AMXX API 2015-06-29 13:38:34 +02:00
Arkshine
4b2ba10300 Gameconfig: Add game configs parser 2015-06-29 13:38:34 +02:00
Valentin Grünbacher
7059f5b3b9 Engine: Detour LightStyle to catch all calls, restores set_lights() functionality 2015-06-11 20:49:00 +02:00
Arkshine
6620aa97a8 Correct NameHashSet::add() return type 2015-05-15 10:45:08 +02:00
Valentin Grünbacher
abf7f1a41b Expose get_amxstring_null and get_amxvector_null to modules 2015-05-06 12:01:15 +02:00
Arkshine
9fd0f1c231 Sync AMTL submodule 2015-04-22 00:55:23 +02:00
Arkshine
c03bb3693e Move Zlib and Hashing libs to third_party directory 2015-03-10 12:08:26 +01:00
Arkshine
9542fce9c5 Zlib: Update AMBuilder 2015-03-10 00:12:56 +01:00
Arkshine
e60a2e9fcc Zlib: Fix compilation (implicit-function-declaration error) 2015-03-10 00:06:30 +01:00