Commit Graph

316 Commits

Author SHA1 Message Date
David Anderson
9d805ea9fb Replace the AddRootConsoleCommand API to not expose internal structures. 2015-08-30 21:01:03 -07:00
David Anderson
204ca3aca5 Update to the latest AMTL revision. 2015-08-30 18:38:05 -07:00
David Anderson
c87b3c0859 Update to the latest AMTL version. 2015-08-27 01:01:18 -04:00
David Anderson
e30b57cb4a Update build scripts for new AMTL folder structure. 2015-08-26 15:54:55 -04:00
David Anderson
246c32a202 Update SourcePawn and AMTL. 2015-08-13 22:08:47 -07:00
David Anderson
152807b977 Update AMTL and SourcePawn submodules to master. 2015-07-25 17:25:59 -07:00
Ross Bemrose
b705de0143 Add missing CopyFiles function. 2015-07-25 13:16:17 -04:00
Nicholas Hastings
7564c09aff Merge pull request #341 from powerlord/ambuild-sampleext
Add AMBuild2 script to Sample Extension.
2015-06-27 20:10:00 -04:00
David Anderson
cb6024e334 Update AMTL and SourcePawn. 2015-05-27 10:22:40 -04:00
Ross Bemrose
43f4a2f7b7 Fix checking the wrong directory for smsdk_ext.cpp. Updated some comments. 2015-05-14 14:16:19 -04:00
Ross Bemrose
0022b750b5 Split AMBuildScript into AMBulde and AMBuildScript 2015-05-14 13:48:59 -04:00
Ross Bemrose
d49714bb10 Add AMBuildScript, configure.py, and PackageScript 2015-05-14 12:36:59 -04:00
Asher Baker
1b47b68cc7 Correct NameHashSet::add() return type. 2015-05-09 11:57:49 +01:00
Asher Baker
f7c6fc9d1f Restore check_thunks error message. 2015-05-07 21:53:38 +01:00
David Anderson
eaea3c927d Update upstream AMTL as a submodule. 2015-03-08 00:24:03 -08:00
David Anderson
1d313e3120 Move macro assembler out of public/assembler into sourcepawn/vm/x86. 2015-03-07 11:16:37 -08:00
David Anderson
561004c4bf Move SourcePawn headers out of public/ into sourcepawn/include. 2015-03-07 11:13:32 -08:00
Nicholas Hastings
2d53547e03 Merge pull request #289 from alliedmodders/more-ninvoke-killing
Remove references to INativeInvoker.h from extension boilerplate.
2015-03-06 07:37:46 -05:00
Nicholas Hastings
6f8ffd55a7 Merge pull request #263 from alliedmodders/admins-trans
Update admins.inc with methodmaps, newdecls (r=dvander, asherkin).
2015-03-05 14:32:15 -05:00
Nicholas Hastings
96703c247c Remove references to INativeInvoker.h from extension boilerplate. 2015-03-05 10:59:19 -08:00
David Anderson
a1afa23bc4 Implement a new stack and error handling model for the SourcePawn VM.
This has three major changes to SourcePawn. First, the API now supports the concept of "exceptions". The exception state is a global property of an instance of the SourcePawn VM. Exceptions can be caught or suppressed. Many places in SourceMod have been updated to check exceptions instead of errors.

The new API obsoletes major parts of the embedder API - all but one method of invoking functions is obsoleted, and the debug interface has been scrapped. Extensions using the native API will not be affected, however, ThrowNativeError has been deprecated in favor of ReportError.

Second, the SourcePawn concept of a "stack" has been unified at the API level. A stack frame iterator now iterates over all SourcePawn invocations, rather than the topmost plugin. This makes error handling more consistent and removes another dependency on context-per-plugin.

Finally, the implementation of stack frames has been changed dramatically. Rather than maintain a complicated and expensive return pointer stack, we now rely on the implicit one provided by the CPU. The stack frame iterator now walks the JIT stack directly. This removes many unnecessary bookkeeping instructions from the generated code, in particular making the CALL instruction 40% faster.

These changes required some fair surgery to the JIT. Its error paths are now slightly more complicated, as they have to throw an exception rather than return an error code. In addition, any path that can throw an exception is now responsible for creating an "exit frame", which exists to tell the stack frame iterator about transitions from the JIT to the VM.
2015-03-04 23:45:30 -08:00
David Anderson
04827466b0 Rewrite the .smx parser.
This removes one the last remnants of the SourceMod 1.0 VM implementation.

The new parser introduces a number of design changes in the VM. First, the VM now takes greater responsibility for validating and sanity checking the structure of the SMX container format. Previously, malformed SMX files could easily crash SourcePawn. The loader now rejects files that have out-of-bounds offsets or incomplete sections. Complex sections, like debug info or the code stream, are verified lazily.

Internally, the sp_plugin_t structure has been removed. It has been replaced by a new LegacyImage class, designed to be independent from the SPVM API. This potentially lets us load code streams from non-.smx containers. More importantly, it removes a lot of bookkeeping and pre-computed state from PluginRuntime. The LegacyImage class is now responsible for handling debug info as well.

PluginRuntime is now intended to hold only cached or immutable data, and PluginContext holds all VM state. As such PluginContext is now responsible for allocating a plugin's runtime memory, not PluginRuntime.

Finally, some aspects of the loading process have been cleaned up. The
decompression and image handoff logic should now be easier to
understand.
2015-02-25 22:28:10 -08:00
David Anderson
fcaa5361c8 Don't expose mutable sp_native_t. 2015-02-24 23:10:18 -08:00
David Anderson
21f5400d9c Remove ICompilationData. 2015-02-24 02:03:57 -08:00
David Anderson
499f7b3929 Refactor the public API entrypoint for SourcePawn. 2015-02-24 01:52:13 -08:00
Developer
94c439e533 Updated Visual Studio sample_ext files 2015-02-18 10:34:38 +01:00
Nicholas Hastings
67e74581cc Make result ptr in IForward::Execute default to NULL (which is allowed). 2015-02-17 06:43:07 -08:00
Ruben Gonzalez
213e7ced8c Initial CSGO GetWeaponPrice fixes 2015-01-31 12:44:18 -05:00
Kyle Sanderson
37d9867c06 Merge pull request #129 from KyleSanderson/SDKDep
Enable SDK independence with MM:S enabled extensions.
2015-01-20 17:22:04 -08:00
Asher Baker
c28426a09f Fix threads leaking if they're not joined. (bug 3460, r=dvander) 2015-01-06 20:29:47 +00:00
Ryan Stecker
679b2863fa Update manual builds to use version 1.8.0 2014-12-18 18:18:55 -06:00
Asher Baker
686cf9c5ba Use GCC builtins for bsr/bsf where available. 2014-11-09 04:15:49 +00:00
Nicholas Hastings
96fbb7ecda Unify Player::GetSteamXId returns, clarify doc, and fix checks 2014-09-09 17:57:54 -07:00
Nicholas Hastings
775a35c5ab Update OnClientAuthorized function doc 2014-09-09 17:56:29 -07:00
Nicholas Hastings
a597277a64 Merge pull request #153 from alliedmodders/auth-fixups
More auth fixups for Steam auth (bug 6243, r=asherkin).
2014-09-09 16:24:57 -04:00
Nicholas Hastings
ad7d920ce0 Move menu natives from core to logic 2014-09-05 08:24:40 -07:00
Nicholas Hastings
1bf4eb80bd Cache Steam ID and rendered forms when caching networkID 2014-09-04 16:14:34 -07:00
Nicholas Hastings
f1dc24c089 Move Steam2/3 id rendering logic to CPlayer 2014-09-04 15:27:44 -07:00
David Anderson
a00adaf9fb Sync with AMTL one last time. 2014-09-03 22:05:10 -07:00
David Anderson
8686957dee Final sync of AMTL. 2014-09-03 21:48:48 -07:00
David Anderson
e6e90fb8b8 Sync am-string. 2014-09-03 21:45:44 -07:00
David Anderson
6068d341c8 Sync am-hashmap. 2014-09-03 21:44:51 -07:00
David Anderson
105cd27d19 Sync am-utility.h from upstream. 2014-09-03 21:40:03 -07:00
David Anderson
e608057304 Sync a change from AMTL. 2014-09-03 21:31:06 -07:00
Nicholas Hastings
7f3656215b Consistency Fixes (ID->Id, AuthString->AuthId) 2014-09-03 15:13:30 -07:00
Nicholas Hastings
8c89b72fbc Expose explicit client auth string formats 2014-09-02 14:40:39 -07:00
David Anderson
9267d0c803 Eliminate Newborn/NoAddRef (bug 5907, r=ds). 2014-08-22 22:50:25 -07:00
David Anderson
225954a27c Modernize the smx headers. 2014-08-21 22:16:07 -07:00
Kyle Sanderson
766b6e1770 Merge pull request #127 from alliedmodders/coremapend
Add OnCoreMapEnd to extension's interface.
2014-08-15 20:48:59 -07:00
David Anderson
4b8e26463a Merge pull request #122 from peace-maker/datapack_funcpointer
Add WritePackFunction and ReadPackFunction natives
2014-08-12 10:33:27 -07:00
Kyle Sanderson
901890e36d Eliminate SDK dependence for MM:S enabled extensions. 2014-08-09 14:42:38 -07:00
Ryan Stecker
0bde28cc17 Add a command to dump profiling output. 2014-08-09 13:32:05 -05:00
Ruben Gonzalez
2ba0b794ea Added note to know what version OnCoreMapEnd was added to. 2014-08-08 10:57:38 -04:00
Ruben Gonzalez
7a88386568 Add OnCoreMapEnd to extension's interface. 2014-08-08 01:01:47 -04:00
Peace-Maker
bfcfbbe107 Add WritePackFunction and ReadPackFunction natives
Adds type safety to CDataPack. Cells can't be read as Float anymore. Now
you're able to store a function pointer in a datapack and be sure the
pointer can't be read as a cell and a cell can't be read as a function
pointer.
2014-08-04 02:05:25 +02:00
Ryan Stecker
226c0a456d Update version for manual builds of the 1.7 branch. 2014-07-09 11:03:02 -05:00
David Anderson
f9defa7b37 Remove JIT registration API; this needs more time. 2014-06-24 20:44:30 -07:00
David Anderson
fac52a2897 Fill out API more. 2014-06-24 01:18:16 -07:00
David Anderson
ec61d4d188 Add a general profiling abstraction layer. 2014-06-24 01:04:13 -07:00
Nicholas Hastings
4a75be1c92 Fix KE_OVERRIDE typo in amtl (already fixed upstream). 2014-06-19 20:58:26 -04:00
Nicholas Hastings
35784c018d Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
Nicholas Hastings
dbc881143b Move many player natives from core to logic. 2014-05-28 23:20:41 -04:00
Kyle Sanderson
556d5e0949 Merge pull request #9 from KyleSanderson/amtlutilloudness
Quell isNaN MSVC performance warning.
2014-05-28 18:12:32 -07:00
Kyle Sanderson
05d8622ea9 Quell isNaN MSVC performance warning. 2014-05-28 18:05:55 -07:00
Nicholas Hastings
d83d72fd88 Give define value (of 1) to PLATFORM defs to match the same-name defs in some SDKs. 2014-05-28 20:36:52 -04:00
David Anderson
3c7a08afc2 Change version display. 2014-05-25 03:18:05 -07:00
Kyle Sanderson
9c62e94239 Optimize native call if statically bound (bug 5842, r=ds,fyren f=dvander).
Original patch written by David Anderson (original r from Fyren).
- Updated to function with the current JIT compiler.
- Took in clean-ups from later-dated patches.
2014-05-11 14:36:32 -07:00
Kyle Sanderson
b1901da79f Unify Maximum supported clients, raised SDKTools limit (bug 5964, r=psychonic). 2014-05-06 18:40:35 -07:00
Scott Ehlert
b0b28b7a6e Fix Linux and Windows builds. 2014-04-23 21:53:58 -05:00
Scott Ehlert
ecec7dbef3 Deduplicate a number of files used by extensions by moving them to the public directory (bug 5341, r=psychonic).
These files include smsdk_ext.cpp, smsdk_ext.h, sm_memtable.h, CDetour/*, and asm/*.
The smsdk_config.h file for each extension has also been moved out of the 'sdk' directory into its parent.

--HG--
rename : extensions/bintools/sdk/smsdk_config.h => extensions/bintools/smsdk_config.h
rename : extensions/clientprefs/sdk/smsdk_config.h => extensions/clientprefs/smsdk_config.h
rename : extensions/cstrike/sdk/smsdk_config.h => extensions/cstrike/smsdk_config.h
rename : extensions/curl/sdk/smsdk_config.h => extensions/curl/smsdk_config.h
rename : extensions/geoip/sdk/smsdk_config.h => extensions/geoip/smsdk_config.h
rename : extensions/mysql/sdk/smsdk_config.h => extensions/mysql/smsdk_config.h
rename : extensions/regex/sdk/smsdk_config.h => extensions/regex/smsdk_config.h
rename : extensions/sdkhooks/sdk/smsdk_config.h => extensions/sdkhooks/smsdk_config.h
rename : extensions/sdktools/sdk/smsdk_config.h => extensions/sdktools/smsdk_config.h
rename : extensions/sqlite/sdk/smsdk_config.h => extensions/sqlite/smsdk_config.h
rename : extensions/structs/sdk/smsdk_config.h => extensions/structs/smsdk_config.h
rename : extensions/tf2/sdk/smsdk_config.h => extensions/tf2/smsdk_config.h
rename : extensions/topmenus/sdk/smsdk_config.h => extensions/topmenus/smsdk_config.h
rename : extensions/updater/sdk/smsdk_config.h => extensions/updater/smsdk_config.h
rename : extensions/sdktools/CDetour/detourhelpers.h => public/CDetour/detourhelpers.h
rename : extensions/sdktools/CDetour/detours.cpp => public/CDetour/detours.cpp
rename : extensions/sdktools/CDetour/detours.h => public/CDetour/detours.h
rename : extensions/sdktools/asm/asm.c => public/asm/asm.c
rename : extensions/sdktools/asm/asm.h => public/asm/asm.h
rename : public/sample_ext/sdk/smsdk_config.h => public/sample_ext/smsdk_config.h
rename : core/logic/sm_memtable.h => public/sm_memtable.h
rename : public/sample_ext/sdk/smsdk_ext.cpp => public/smsdk_ext.cpp
rename : public/sample_ext/sdk/smsdk_ext.h => public/smsdk_ext.h
2014-04-23 21:19:28 -05:00
David Anderson
c64edf31fc Fix Windows build, again. 2014-04-22 20:04:12 -07:00
David Anderson
e69e9eddc7 Change float comparison operators to return false for NaN (bug 6107, r=ds).
--HG--
extra : rebase_source : a11c56fb23d6617545def3591ec6100dd143eb3e
2014-04-22 19:40:45 -07:00
David Anderson
b6792a2c8c Sync am-vector.h with AMTL (fix bug 6090).
--HG--
extra : rebase_source : f27515a516db9bc14779da3721f6378d573584b5
2014-04-19 19:21:40 -07:00
Nicholas Hastings
563dd617af Add sm_reload_translations command (bug 5750, r=asherkin). 2014-03-30 12:08:11 -04:00
Nicholas Hastings
2f6b64e92e Make IGameConfig::GetMemSig return value clearer (bug 6081, r=asherkin). 2014-03-29 14:22:53 -04:00
Kyle Sanderson
9abac06e85 Change SDKHooks to VTable Hooks (bug 6070, r=psychonic). 2014-03-23 22:11:06 -06:00
Kyle Sanderson
38bbb8580f Move PlayerRunCmd to a global VTable Hook (bug 6051, r=psychonic). 2014-03-01 14:25:35 -07:00
Nicholas Hastings
8987a34078 Fix ep1 and darkm builds (bug 5986).
--HG--
extra : amend_source : 719c0f37249744104d670c56addc112d704a1fad
2014-02-27 23:46:51 -05:00
Kyle Sanderson
af7b8cd9a3 Wrap ClientPrintf into IGamePlayer (bug 6021, r=asherkin). 2014-01-29 21:41:41 -07:00
Kyle Sanderson
3bbb48ce9e Fix GetPlayerUserId uninitialized return in Dota 2 (irc, r=psychonic). 2014-01-25 16:58:12 -07:00
David Anderson
6d320163a1 Various Windows build fixes (bug 5997 part 13, r=ds).
--HG--
rename : sourcepawn/compiler/libpawnc.rc => sourcepawn/compiler/version.rc
2013-12-30 17:51:00 -05:00
David Anderson
f82224eba0 Move versioning to a static library to improve trivial build speed (bug 5997 part 9, r=ds). 2013-12-30 17:51:00 -05:00
Kyle Sanderson
398b05afed Fix uninit'd memory issues in AMTL AString and Vector (bug 5921, r=psychonic).
--HG--
extra : rebase_source : 17a57dcf815cb3798eaa13af5f4af44fb1930f86
2013-11-30 10:59:05 -05:00
David Anderson
f0e4fe66ba AMTL updates and changes to adapt for them to fix menu crashes (bug 5921, r=psychonic).
AMTL:
Removes isVoid from AString.
Fixes support inserting to Vector at length.

--HG--
extra : rebase_source : 02805fad60c2b759a0e2e91c081144854a8e0b54
2013-11-30 10:51:28 -05:00
David Anderson
96d6cf8def Fix some memory errors (bug 5904, r=ds). 2013-10-29 18:58:34 -04:00
Nicholas Hastings
1ba6b2653a Move ForwardSys from core to logic (bug 5953, r=fyren).
--HG--
rename : core/ForwardSys.cpp => core/logic/ForwardSys.cpp
rename : core/ForwardSys.h => core/logic/ForwardSys.h
2013-10-09 08:43:08 -04:00
Nicholas Hastings
1d1b5d1c6d Move DBManager and DB natives from core to logic (bug 5953, r=fyren).
--HG--
rename : core/Database.cpp => core/logic/Database.cpp
rename : core/Database.h => core/logic/Database.h
rename : core/sm_simple_prioqueue.h => core/logic/sm_simple_prioqueue.h
rename : core/smn_database.cpp => core/logic/smn_database.cpp
rename : core/sm_queue.h => public/sm_queue.h
2013-10-09 08:43:08 -04:00
Nicholas Hastings
5bde264c43 Rename some register defines to avoid conflict with sys headers (bug 5917, r=hamdinger). 2013-10-08 21:01:21 -04:00
David Anderson
f9f4c7dcd6 Add an interpreter because. (bug 5902, r=ds). 2013-09-01 00:23:44 -07:00
David Anderson
67ce8aff61 Remove memtables from ConCmdManager (bug 5899 part 3, r=fyren). 2013-08-31 19:50:15 -07:00
David Anderson
ba927964c8 Clean up ConCmdManager (bug 5900, r=fyren). 2013-08-31 11:51:23 -07:00
David Anderson
435f2b8e39 Remove MenuManager use of memtables (bug 5899 part 2, r=fyren). 2013-08-31 11:50:28 -07:00
David Anderson
a25f9010cc Remove CoreConfig use of memtables (bug 5899 part 1, r=fyren). 2013-08-31 11:50:11 -07:00
David Anderson
4500964394 Use Refcounted to manage to NativeEntry (bug 5852 part 4, r=ds).
--HG--
extra : rebase_source : 2e08816db6819c9d9957a0e0ade9cd1aa420fd54
2013-08-30 10:16:28 -07:00
David Anderson
0e677fb3a2 Remove native override API (bug 5852 part 1, r=ds).
--HG--
extra : rebase_source : 9df0399c88721b63667a9b0b5dca0eb20168117a
2013-08-30 10:10:57 -07:00
David Anderson
da9debda67 Sync AMTL. 2013-08-29 11:45:28 -07:00
David Anderson
f1b0c29815 Sync AMTL. 2013-08-29 10:11:59 -07:00
David Anderson
b261dde858 Refactor Trie natives to use HashMap instead of KTrie; add iteration API (bug 5892, r=ds).
--HG--
extra : rebase_source : a5bcf64a45d6734a97d78b4f4ea9aea48d17bb8b
2013-08-29 10:09:02 -07:00
David Anderson
2c1a398292 Fix build. 2013-08-25 14:04:01 -07:00
David Anderson
0f52f6931b Switch ADTFactory/IBasicTrie off KTrie (bug 5884 part 17, r=ds). 2013-08-25 12:21:15 -07:00