Commit Graph
15 Commits
Author SHA1 Message Date
David Anderson 890c7119fe Use internal sp::Environment directly in core/logic.
Also remove ISourcePawnEngine and ISourcePawnEngine2 pointers since
they're now redundant.
2026-05-17 15:22:58 -07:00
David Anderson fba9d713b7 Statically link SourcePawn. (#2459)
This removes the SourcePawn shared library from the distrubtion, and
statically links the VM to sourcemod.logic instead. This means we can
stop designing public APIs that only SourceMod will ever use, since now
SourceMod can just peek directly inside the VM.

We still need a public API for extensions (and the "core" binary). But
that API surface is a lot smaller than what the logic binary needs.

Remove unused DebugReporter::GenerateCodeError function while we're
here, since this will allow removing IPluginDebugInfo.
2026-05-13 21:09:15 -07:00
Nicholas Hastings 30da01763d Fix ClientPrefs pointer string formatting (#2307)
* Fix pointer to string marshaling in ClientPrefs for x64

* Fix other cases where pointers were formatted with %x

* Fix warnings in ClientPrefs IsAuthIdConnected
2025-03-31 21:21:54 +00:00
David Anderson 96c74651db Fix vote menu handler to work with direct arrays. 2021-12-09 18:10:35 -08:00
David Anderson 5d94f0bea8 Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
David Anderson b725196a26 Replace AString with std::string. 2020-05-20 17:57:18 -07:00
Michael Flaherty 9ceb1af4fe Add LogStackTrace native (#685) 2018-06-19 23:18:37 -07:00
Peace-Maker 4a8068d1c4 Suppress logging of "Plugin not runnable" errors
SourceMod itself and thirdparty extensions call functions in plugins
without making sure it is runnable. The plugin pausing feature isn't
supported anymore and is set to get nuked #438 which will reduce the
amount of not-runnable error reports.

We can't fix every third party extension, so suppressing the error from
the logs will stop the spam until pausing is removed.

#489 can be reverted after this.
2016-10-26 23:48:56 -06:00
Kyle Sanderson 2deaa666f3 Fix erroneous () in DebugReport:: printouts. (#517) 2016-10-03 16:29:51 +01:00
Fyren fec2fa3bf0 Update SP and use BlamePluginError in sdkhooks. 2015-11-18 01:24:31 +00:00
David Anderson 9ba1363d86 Remove Format/FormatArgs from the core/logic bridge. 2015-08-30 18:03:31 -07: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
Nicholas Hastings e4645332aa Convert missed files in logic to use logger from logic. 2014-08-17 11:06:43 -04:00
David Anderson f5e1ff3f1f Fix more build bustage. 2013-02-16 17:28:17 -08:00
David Anderson 1e8a6e878d Move DebugReporter from core to logic (bug 5607, r=psychonic).
--HG--
rename : core/DebugReporter.cpp => core/logic/DebugReporter.cpp
rename : core/DebugReporter.h => core/logic/DebugReporter.h
2013-02-16 15:57:00 -08:00