Commit Graph

61 Commits

Author SHA1 Message Date
peace-maker
02f188899e
Add CommandIterator.ConVarFlags property (#1869)
* Add CommandIterator.ConVarFlags property

Allow to access the convar flags `FCVAR_*` value from the iterator.
The CommandIterator.Flags property should have been called `AdminFlags`,
but it's too late to change that now.

* Switch admin help menu to use CommandIterator.ConVarFlags

No need to lookup the convar again.

* Deprecate CommandIterator.Flags

Rename it to .AdminFlags now that we have two kinds of flags exposed
on the iterator.
2022-12-04 12:24:56 +01:00
Corey D
3b4a343274
Add natives to get chat triggers (#1816) 2022-12-02 13:55:32 +01:00
Asher Baker
6a2ac9800b
Track the creating plugin for convars (#1537)
Similar to the recent work for commands, track and expose the creating
plugin for convars. The first plugin to register a given cvar becomes
the owner until that plugin is unloaded. If a plugin attempts to
register a convar that was already registered and the originally
registering plugin has been unloaded, that plugin becomes the owner.
This isn't quite as nice as the way commands shift "ownership" as
plugins are unloaded, but we don't have a sane data structure currently
to implement that, and it seemed like a lot of unnecessary work as there
shouldn't really be multiple plugins with conflicting cvars.

Closes #1492
2021-07-18 17:19:27 +01:00
Vladimir
5a72644486
Add ConVar.GetDescription() method (#1449)
* Add ConVar.GetDescription() method

Issue #1432

* Update basecommands.sp

Add prints description of ConVar

* Revert "Update basecommands.sp"

This reverts commit ad485069a837f602bdeeeb50f9e02452b3860ecd.

* Remove GetConVarDescription() function
2021-03-21 15:10:17 +01:00
David Anderson
b725196a26 Replace AString with std::string. 2020-05-20 17:57:18 -07:00
wanted241
5177cfdf97
Fix unnecessary ConCommand cache misses (#1256) 2020-05-08 15:28:45 -07:00
Asher Baker
6465bd83a4 Update for latest Blade Symphony SDK 2020-03-11 22:36:25 +00:00
Michael Flaherty
28f1ea82b6 Add base CommandIterator implementation (#819)
* Add base CommandIterator implementation

* Add check for invalid pos & finalize pr
2018-07-10 17:39:31 -04:00
Michael Flaherty
aaac0b9eb2 Individualize NameHashSet Hashing & Revisit #709 (#740)
* Make mac/win lookups lowercase'd

* Revert #709 & 81042cc

* Adjust HashPolicy implementation across sourcemod

Basically, in order to implement our own (actual) hash policy in
`PluginSys.h`, we needed to remove the blanket implementation of `hash`
that was used before. Now, each policy must implement `hash` along with
`matches` in order to be used with `NameHashSet`. While this does force
us to change every implementation of policies across the entirety of
sourcemod, it allows core to use flexible implementations of `hash`.

* Remove logic duplication

* Improve lowercase checks
2018-07-10 17:38:40 -04:00
Nick Hastings
ddebc2a075 Fix oops with SetConVarBounds. 2018-06-03 12:36:58 -04:00
Nick Hastings
cfdedce362 Missed converting a GetFlags instance. 2018-05-06 13:18:04 -04:00
Nick Hastings
467d57059a Out with the old ConVar accessibility hacks, in with the new. 2018-05-06 12:59:33 -04:00
Nicholas Hastings
40f2512317 Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
David Anderson
c66d14605a Merge pull request #397 from alliedmodders/rm-old-mms
Remove code that handles long-dead Metamod:Source versions.
2015-09-18 14:38:52 -07:00
David Anderson
485975fd99 Fix temporary parameter list being static. 2015-09-16 00:27:36 -07:00
David Anderson
653dd36020 Merge pull request #378 from powerlord/fix-convar
Fix ConVar .IntValue, .BoolValue, and .FloatValue assignments (Bug 6405)
2015-09-15 12:33:51 -07:00
David Anderson
b548ba7b58 Remove bad-console-read protection logic for Metamod:Source 1.7 and earlier. 2015-09-09 18:59:31 -07:00
David Anderson
b048dc7b10 Move ConCommand hooks into GameHooks and switch callbacks to ICommandArgs. 2015-09-09 18:40:04 -07:00
David Anderson
fa93426f6a Remove blanket includes from sm_stringutil. 2015-09-09 15:18:24 -07:00
Ross Bemrose
569a53182c Allow sm_SetConVarString, sm_SetConVarFloat, and sm_SetConVarNum treat notify and replicate as non-existent.
Remove special functions for BoolValue, IntValue, and FloatValue.
2015-08-24 17:03:47 -04:00
David Anderson
4e275eea97 Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
Nicholas Hastings
c85cc5cbf7 Add support for listening to, blocking, changing, and faking ClientCommandKeyValues. 2015-07-12 13:14:46 -04: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
65dfd3cdd1 Add C++ definitions. 2014-11-09 15:39:13 -08:00
Nicholas Hastings
17d5af0e2f Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
Nicholas Hastings
35784c018d Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
Kyle Sanderson
af7b8cd9a3 Wrap ClientPrintf into IGamePlayer (bug 6021, r=asherkin). 2014-01-29 21:41:41 -07: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
David Anderson
ba927964c8 Clean up ConCmdManager (bug 5900, r=fyren). 2013-08-31 11:51:23 -07:00
David Anderson
3985dd639a Switch UserMessages off KTrie (bug 5884 part 11, r=ds). 2013-08-25 12:16:07 -07:00
David Anderson
3000445af9 Switch smn_console off KTrie (bug 5884 part 10, r=ds). 2013-08-25 12:15:27 -07:00
Kyle Sanderson
7e2afacf34 Fix broken translating in some plugins and natives (bug 5612, r=psychonic). 2013-08-25 10:15:35 -04:00
Nicholas Hastings
a36c266e7d Split TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5813, r=asherkin). 2013-07-21 11:53:56 -04:00
Nicholas Hastings
614967ccc1 Updated for latest hl2sdk-dota changes. 2013-05-13 15:18:12 -04:00
David Anderson
045ee262a8 Move scared guts of core into logic (bug 5680, r=fyren).
--HG--
rename : core/ExtensionSys.cpp => core/logic/ExtensionSys.cpp
rename : core/ExtensionSys.h => core/logic/ExtensionSys.h
rename : core/HandleSys.cpp => core/logic/HandleSys.cpp
rename : core/HandleSys.h => core/logic/HandleSys.h
rename : core/NativeInvoker.cpp => core/logic/NativeInvoker.cpp
rename : core/NativeInvoker.h => core/logic/NativeInvoker.h
rename : core/NativeOwner.cpp => core/logic/NativeOwner.cpp
rename : core/NativeOwner.h => core/logic/NativeOwner.h
rename : core/PluginSys.cpp => core/logic/PluginSys.cpp
rename : core/PluginSys.h => core/logic/PluginSys.h
rename : core/ShareSys.cpp => core/logic/ShareSys.cpp
rename : core/ShareSys.h => core/logic/ShareSys.h
rename : core/smn_fakenatives.cpp => core/logic/smn_fakenatives.cpp
rename : core/logic/AutoHandleRooter.h => public/AutoHandleRooter.h
2013-03-29 11:37:29 -07:00
Nicholas Hastings
e364937353 Updated protobuf and usermessage support for Dota 2 (bug 5656, r=asherkin). 2013-03-19 11:19:38 -04:00
Nicholas Hastings
877ef76540 Tweaked Dota 2 support to account for lack of IPluginHelpers (bug 5656, r=asherkin). 2013-03-19 11:19:19 -04:00
Nicholas Hastings
e487007960 Fixed errors with SendConVarValue on CS:GO (bug 5638, r=asherkin). 2013-03-18 11:47:55 -04:00
Nicholas Hastings
312e26a5cf Added initial support for protobuf usermessages on CS:GO (bug 5579, r=asherkin). 2013-01-22 21:43:12 -05:00
Asher Baker
247fabaaf0 Added the ability to override RegConsoleCommand-created commands (bug 5199, r=psychonic). 2012-11-15 17:53:11 +00:00
Asher Baker
ca94a61acf Fixed ServerCommandEx native appending to buffer instead of overwriting (bug 5047, r=fyren). 2011-10-17 11:02:42 -04:00
Nicholas Hastings
f136f2dcaf Added CheckAccess native to check cmd/override access of AdminId (bug 5083, r=fyren). 2011-09-10 12:08:38 -04:00
Nicholas Hastings
1492e12ca2 Added support for E.Y.E Divine Cybermancy (bug 5035, r=fyren). 2011-08-20 18:58:37 -04:00
Asher Baker
2271469d1b Added ServerCommandEx native to get the response when running a command (bug 3873, r=ds). 2011-07-18 03:23:03 +01:00
Scott Ehlert
dd44a0aaea Added support for Alien Swarm (bug 4530, r=dvander). 2010-07-27 17:32:32 -05:00
Scott Ehlert
fba0ec93bf Fixed replicate and notify params not working on old engine games (bug 4516, r=pred).
This also fixes an issue where clients could be notified of convar changes twice on newer engines (Orange Box and later).
2010-07-14 20:29:45 -05:00
Scott Ehlert
6f16fc77b8 Added GetConVarDefault() native (bug 4502, r=dvander). 2010-07-06 17:32:58 -05:00
Scott Ehlert
8fe7f8b8d8 Fixed SendConVarValue() on TF2, DOD:S, L4D, and L4D2 (bug 4273, r=dvander). 2010-05-04 22:53:26 -04:00
David Anderson
fc88cd3cb1 Check return value of GetPlayerNetInfo (bug 4315, r=fyren). 2010-04-27 23:40:04 -07:00
Fyren
9e69afbbd6 Inital SM fixes for l4d2 and linux makefile updates 2009-10-30 13:26:13 +13:00