Commit Graph

1350 Commits

Author SHA1 Message Date
Arkshine
be3f2f540b Adjust TextMsg/SayText maximum buffer length from 190 to 187 due to "%s" parameter added in #763 2019-10-23 16:25:50 +02:00
Juice
4a2aecfe85 Fix issues with amxclient_cmd and read_args/read_argv* natives (#761)
* Fixes to read_args and read_argv* natives

* Fixed crash with read_argv* natives and commands sent with amxclient_cmd native
* Fixed read_args returning argv[0] instead of empty string when both amxclient_cmd's arguments were not specified

* Fix spaces
2019-10-22 10:30:13 +02:00
Vincent Herbet
4410d219f7 Send pre-formatted string in SayText and TextMSg as a parameter instead of as the format string (#763) 2019-10-17 15:54:04 +02:00
Dmitry Novikov
5e48c9b6db CSPForward::execute: Fix uninitialized retVal (#747) 2019-10-17 15:53:29 +02:00
Vincent Herbet
4ef0a78abd Fix MPROP_SHOWPAGE option not working as expected
Typo from #473.
2019-06-19 22:30:43 +02:00
voed
6dba7c4f17 Add player validation for menu_display (#671)
Invalid player triggered crash because get/set_pdata is unsafe
2019-01-30 16:08:08 +01:00
voed
7515038e07 Removed garbage generated by VS (#658) 2019-01-30 16:07:48 +01:00
Vincent Herbet
9eb1f427df Fix again a menu regression (behavior change) due to typos in #471 (#636) 2018-11-03 22:54:15 +01:00
Vincent Herbet
be526418bf Make UTF-8 safe others strings natives (#610) 2018-10-14 17:46:28 +02:00
Vincent Herbet
e059c1f5ab Fix invalid handle passed in the SMC/INI parser callbacks (#592) 2018-09-21 00:04:51 +02:00
Vincent Herbet
c6c4e79b96
Don't reset m_iMenu if player is not fully joined (#537) 2018-09-03 18:39:08 +02:00
Vincent Herbet
80cf45d234
Adjust version for manual build and update VS projects (#543) 2018-09-02 20:34:40 +02:00
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
David Anderson
46d1ef68bd Build assembly files with AMBuild. (#481)
* Remove prebuilt nasm-generated object files from the tree, and use AMBuild to compile them.

* Add commands in VS project to build the object files

* Rename elf to elf32 for consistency
2018-08-26 20:28:25 +02:00
Vincent Herbet
9bcabfeb1f
Add or adjust a bunch of safety checks (#433) 2018-08-26 17:18:39 +02:00
Vincent Herbet
197db8c82b
Update AMTL from upstream (#521) 2018-08-25 11:29:54 +02:00
Vincent Herbet
605d1a5b1e
Fix callback from amx_clientcmd not working properly (#518) 2018-08-25 09:18:39 +02:00
Vincent Herbet
eff74fe862
Execute amxx.cfg before plugin_init to keep compatibility (#512) 2018-08-20 19:46:26 +02:00
Vincent Herbet
9700caefae
Fix client_print_color where the color is ignored if string starts with an unicode character (#504) 2018-07-24 15:45:50 +02:00
Vincent Herbet
a9ce39dee0
Fix a buffer issue in server_changelevel forward caused by engine_changelevel native (#503) 2018-07-24 10:37:05 +02:00
KliPPy
98ab26671c Add MPROP_SHOWPAGE (#473) 2018-07-18 17:10:37 +02:00
Vincent Herbet
975d877800
Fix typos in few localinfo identifiers for the AMXX config directory retrieval (#496) 2018-07-13 12:18:16 +02:00
Vincent Herbet
387dc6a188
Fix a menu recursion issue (#471)
* Factorize menu close logic in show_menu()

* Use CS-specific player's m_iMenu offset instead of menuselect command
2018-07-10 12:09:20 +02:00
voed
42b351127d Fix for precache_event (#490) 2018-07-10 11:50:31 +02:00
IgnacioFDM
65df386d66 Fix OnPluginsUnloaded not being called for reloadable modules. (#485)
Modules are loaded before plugins, and can hook OnPluginsLoaded. Therefore, they should be unloaded AFTER plugins, and be able to hook OnPluginsUnloaded. This was not the case for reloadable modules.
This affects nvault module, whose OnPluginsUnloaded function wasn't being called.
2018-03-09 19:32:30 +01:00
KliPPy
5632420827 Add wrappers for natives with string flags (#389)
* Add wrappers for natives with string flags

* Add default/none constants, update docs
2017-12-08 00:06:37 +01: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
Vincent Herbet
a69a015189
Fix open_dir not working properly when called recursively (#467) 2017-11-27 12:08:51 +01:00
Dmitry Novikov
7fe7cd746f Fix unreachable code (#465) 2017-10-28 16:27:39 +02:00
Vincent Herbet
97df408d51 Fix a crash on the same newmenu overlapping (#462) 2017-10-03 20:43:30 +02: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
Karol Szuster
f96cb9a3b6 Use smart pointers in NativeHandle class (#457)
* Use AutoPtr in natives handles

* Use size_t type instead of int in natives handles

* Use pre decrement operator in destroy method
2017-09-25 16:52:12 +02:00
Vincent Herbet
feba821306 Fix a typo in equali, strcmp and strncmp natives (#459) 2017-09-12 21:00:26 +02:00
Vincent Herbet
ba58cb045f Adjust 'amxx cvars' command output (#453) 2017-08-07 23:42:41 +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
PartialCloning
24e56d0476 Add elog_message native (#451)
* elog_message

Like "log_message". Logs a message to the current server log file, however the messages sent are also sent to all plugins and can be hooked using "register_logevent".

* Update amxmodx.cpp

* Update Editor.sci

* Update UnitfrmMain.dfm
2017-08-01 15:14:53 +02:00
Vincent Herbet
1dc1f1b9c4 Introduce Trie Iterators (#413)
* TrieIter: Add possibility to obtain a new'd HashTable iterator

* TrieIter: Add CellTrieIter and storage

* TrieIter: Implement TrieIterCreate

* TrieIter: Implement TrieIterEnded

* TrieIter: Implement TrieIterMore

* TrieIter: Implement TrieIterGetKey

* TrieIter: Implement TrieIterGetSize

* TrieIter: Implement TrieIterGetCell

* TrieIter: Implement TrieIterGetString

* TrieIter: Implement TrieIterGetArray

* TrieIter: Implement TrieIterDestroy

* TrieIter: Invalidate any mutating change that is key addition or key removal

* TrieIter: Clean up the handles at map change

* TrieITer; Add iter tests to trietest.sma

* TrieIter: Fix linux compilation

* TrieIter: Rename TrieIterMore to TrieIterNext

* TrieIter: Adjust documentation

* TrieITer; Adjust trietest.sma

* TrieIter: Create a custom StringHashMap class instead

+ used a copy of |iterator| instead of dynamic allocation
+ initialized vars directly in constructor
+ added a nested iteration test
2017-08-01 15:05:27 +02:00
Vincent Herbet
6bd2f1feec Fix a engclient_cmd and amxclient_cmd buffer issue (#438) 2017-07-21 23:44:05 +02:00
Artem Golubikhin
aa9ec3f872 Fix client_disconnected isn't called on mapchange when ReHLDS API enabled (#446) 2017-07-03 21:52:38 +02:00
In-line
f7f86fb040 Rename suki to key_index (#445) 2017-06-28 18:31:59 +02:00
IgnacioFDM
66cc8dcdaf Minor flagman cleanups (#442)
* Document disableflagman

* Add disabled check, random cleanups
2017-05-28 22:39:44 +02:00
In-line
df4e4949c8 Fix #427, AMTL Code porting (#436)
* Fix crash in CTaskMngr::startFrame()

* Fix crash in EventsMngr::executeEvents()

* Fix loops

* Fix loop iterators signess
2017-05-11 09:35:38 +02:00
In-line
e9f501c250 Allow value be empty in lang files (#431)
* Allow value be empty in lang files

* Refactor solution.
2017-04-29 20:55:34 +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
IgnacioFDM
2d049b7ff3 Fix signed/unsigned mismatch warning (#428)
* Fix signed/unsigned mismatch warning

* Fix GCC type warnings
2017-04-04 10:32:04 +02:00
KliPPy
2863455185 Add menu pagination callback (#420)
* Add menu pagination callback

* Update test plugin
2017-04-04 10:29:18 +02:00
Karol Szuster
9551c70c59 Rework build pathname functions (#422)
* Rework build_pathname* functions

* Replace old platform defines with the new ones

* Correct usage of build_pathname_r()

* Fix inconsistencies (white spaces)

* Remove useless defines
2017-03-11 19:26:25 +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
7a7d0442aa Fix VS project file (#416) 2017-02-26 21:15:53 +01:00
Vincent Herbet
3568fb8747 Add client_remove() forward and fix a bug with client not internally disconnected (#414)
* Rename client_disconnected to client_disconnecting

* Add client_disconnected as post forward

* Fix client not properly disconnected internally

Introduced in #264.
Edict is reset once SV_DropClient is called, so that second check would be always false.

* Reflect changes on the concerned plugins

* Revert renaming, let's add only client_remove as post forward
2017-02-25 11:50:52 +01:00