Compare commits

...
Author SHA1 Message Date
David Anderson 5a2852755d Final build number for 1.0.4.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402537
2008-09-14 05:53:11 +00:00
David Anderson 946e4ab58a New version templates for buildbot.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402534
2008-09-14 05:13:21 +00:00
Matt Schubert 71e89f75ae Fixed amb1929 - Banning via console should now work properly
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402533
2008-09-12 20:36:53 +00:00
Matt Woodrow f0be909d31 Fixed amb1990 - Translator warnings not evaluating format params
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402531
2008-09-09 02:45:16 +00:00
David Anderson f31969dbc4 Fixed another sdktools team native crash, if m_szTeamName wasn't available (bug amb1779, r=pred).
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402529
2008-09-08 07:00:17 +00:00
David Anderson 94c4b4c691 Fixed the compiler eating too many characters in macro subsitutions (bug amb1938).
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402525
2008-09-08 02:13:10 +00:00
David Anderson 09a80ee8c1 Triggering another build.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402524
2008-09-07 22:27:34 +00:00
David Anderson 2cf9140ecf Fixed three bugs with team natives that appeared on INS: bounds checking had wrong binary shortcut order, bounds checking was off by one, error condition was not returned properly. Out-of-range team indexes no longer cause crashes now.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402522
2008-09-07 22:16:47 +00:00
David Anderson 3e8077d59c Fixed a nasty compiler bug where if the rhs of a ternary operator was larger than the lhs, the copy length emitted would only fit the lhs. The hier13() function now returns the larger of the lvalue sizes. (bug amb1853)
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402520
2008-09-07 09:50:50 +00:00
David Anderson 1c975da26f Fixed long strings with internal static copybacks causing buffer overflows (bug amb1986).
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402517
2008-09-07 03:24:41 +00:00
David Anderson fbc29dce23 Synced buildbot from trunk to branch.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402515
2008-09-06 23:57:23 +00:00
David Anderson cc0f68f94e Added master buildbot file for safekeeping.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402511
2008-09-06 15:26:30 +00:00
David Anderson 2d78224b91 Adding buildbot files back.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402510
2008-09-06 14:41:38 +00:00
David Anderson 0bd866d9b5 Removing files temporarily.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402509
2008-09-06 14:41:17 +00:00
David Anderson ed51e958e0 Dummy commit to try and get +x flag
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402508
2008-09-06 14:40:33 +00:00
David Anderson f74aed3db2 Merged buildbot changes from trunk.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402507
2008-09-06 14:36:18 +00:00
David Anderson 2e8282dab5 Reduced 1.0 branch query process delay to 50ms (amb 1916).
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402486
2008-09-02 06:08:38 +00:00
David Anderson 2ab49e966a Fixed amb1935 - When deleting a topmenu category, child objects were not removed from the name cache.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402484
2008-09-02 06:00:59 +00:00
David Anderson b364544776 Fixed amb1927 - client command case sensitivity did not match the server's logic.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402482
2008-09-02 03:58:23 +00:00
David Anderson c791f7f720 Fixed doc for HandleSys failure outparams.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402480
2008-08-28 17:20:17 +00:00
Scott Ehlert 18bec9f901 Improved bot detection slightly. This was meant to go along with the fix for amb1801.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402472
2008-08-24 04:32:06 +00:00
David Anderson 39c3ad0194 Fixed bug 1750 and bug 1801. Orange Box changes the command processing heuristics without telling anyone, it looks like executing commands during the command buffer processing causes insertion to the beginning of the stream rather than end. Moving our callbacks to occur in a new frame seems to alleviate this.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402471
2008-08-23 20:32:35 +00:00
Matt Woodrow d6cd6bd5a9 Fixed amb1899 - Duplicate maps in auto generated maplists
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402437
2008-08-07 23:31:53 +00:00
Matt Woodrow f2dd5f6914 Fixed amb1918 - Ban menu should compare userids, not client indexes
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402435
2008-08-07 23:16:06 +00:00
Matt Woodrow 3754c63e24 Fixed a few file handle leaks
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402433
2008-07-31 21:08:20 +00:00
Matt Woodrow 28c4f423b0 Fixed amb1891 : Basechat didn't check for blank message in private say's
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402430
2008-07-30 08:07:28 +00:00
David Anderson 82d949b34e Added more debug info to sm_dump_handles
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402424
2008-07-24 06:48:54 +00:00
Matt Woodrow 775d22a5ca Identities are now dropped before extensions unload.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402414
2008-07-13 05:36:39 +00:00
Scott Ehlert 8968f50577 Builds against latest OB SDK now
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402411
2008-07-12 09:05:36 +00:00
Matt Woodrow 7d42655e8f Fixed regression in ForwardSys with ET_LowEvent
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402389
2008-07-08 23:55:15 +00:00
Scott Ehlert e6a84801d2 Bumped IForwardSys
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402387
2008-07-08 21:16:31 +00:00
Scott Ehlert b58e7177ed Oops, forgot to commit this; fixed build
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402385
2008-07-08 09:15:15 +00:00
Scott Ehlert 6e0f4ee665 - Fixed amb1802: Crash when client was disconnected as a result of false being returned in OnClientConnect and a function that operated on this client was used. A client's connection state was not reset when this happened.
- Removed IForwardFilter due to overall horribleness (should be safe since no one seems to use it). Perhaps it might be back one day?
- Added ET_LowEvent forward exec type which is exactly the same as ET_Event, except that it returns the lowest value rather than the highest

--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402384
2008-07-08 08:55:50 +00:00
Matt Woodrow ab690bfdd9 Fixed amb1815 - Custom admin menu wasn't escaping input
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402379
2008-07-07 22:11:18 +00:00
David Anderson b21b24830e fixed amb1808 - KickClient() is delayed and does not crash -- KickClientEx() is the old functionality
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402362
2008-07-06 00:44:56 +00:00
David Anderson e6cec6528c fixed amb1763 - clear function call status on a new call
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402360
2008-07-06 00:01:40 +00:00
Borja Ferrer 1c08ddc939 fixed eyeangles helper not being freed
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402345
2008-07-05 00:15:18 +00:00
Borja Ferrer bc6b3495be fixed amb1801, IsFakeClient() wasn't working for TF2 causing false results and crashes
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402340
2008-07-04 19:04:17 +00:00
Matt Woodrow 83b59da392 Updated gamedata files now that dod:s is no longer in beta.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402333
2008-07-03 02:39:49 +00:00
David Anderson 53fc8657bf pulled changes back from branch-1.0.3
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402314
2008-07-01 02:40:46 +00:00
Matt Woodrow a4bf30ac1b Removed DEBUG from admin-sql-threaded.sp (amb1780)
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402311
2008-06-30 23:18:13 +00:00
Scott Ehlert 82cb558335 Updated DOD:S Beta offsets
Added FireOutput support for DOD:S (amb1749)

--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402308
2008-06-30 05:41:44 +00:00
Matt Woodrow 50327a252a Single most annoying and hard to find bug ive ever come across. I'd like to thank MSVC for not firing the one breakpoint I actually needed. Oh and a possible fix to sdktools.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402294
2008-06-29 05:04:32 +00:00
Matt Woodrow 954a130d07 Fixed an uninitialised string causing weird results.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402291
2008-06-29 03:26:52 +00:00
Matt Woodrow a17b0abfe4 Entity Outputs now fail silently if the mod is not supported.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402281
2008-06-26 08:07:33 +00:00
David Anderson 93d0362a70 pulled amb1776 fixes from 1.0.3
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402278
2008-06-25 04:05:57 +00:00
David Anderson 7eafc21a47 bumped version
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402270
2008-06-21 08:56:14 +00:00
David Anderson 8c36966d89 added changelog to branch
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402267
2008-06-21 08:20:31 +00:00
David Anderson 299a17cd26 fix for amb1776 - regression on orangebox, OnConfigsExecuted wouldn't execute
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402265
2008-06-21 07:35:58 +00:00
Matt Woodrow 3edc824bc2 Fixed ForcePlayerSuicide.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402264
2008-06-20 23:36:18 +00:00
David Anderson 22ec5c2e71 added a double-run barrier to the new config code
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402262
2008-06-20 05:23:35 +00:00
David Anderson c337bc512c fixed amb1750 - OnAutoConfigsBuffered() was executing before server.cfg
fixed OnConfigsExecuted() having a race condition with exec server.cfg

--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402261
2008-06-20 05:22:10 +00:00
David Anderson 42f01878f4 fixed amb1765 - GiveNamedItem was supported even though it's bad
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402259
2008-06-20 03:55:10 +00:00
Matt Woodrow 995a0545a9 Fixed gamedata files for the pyro update
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402258
2008-06-19 23:44:57 +00:00
Scott Ehlert 59b64ff19f Fixed rare crash in event manager when a null IGameEvent pointer was passed to the IGameEventManager2::FireEvent() hooks
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402246
2008-06-06 04:56:26 +00:00
Scott Ehlert f1f4b3df44 Fixed version number in version.tpl/version.inc
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402244
2008-06-02 22:16:57 +00:00
David Anderson af813cc71c phase0, new versioning. we don't use build numbers anymore except (VS_VERSIONINFO stays until phase 3 is done)
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402243
2008-06-02 05:04:02 +00:00
Matt Woodrow 65a98212a7 Fixed amb1734 - Escape characters are now enabled for the custom admin menu config.
--HG--
branch : sourcemod-1.0.x
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.0.x%402239
2008-06-01 22:23:59 +00:00
111 changed files with 1780 additions and 680 deletions
+75
View File
@@ -0,0 +1,75 @@
SourceMod Changelog
----------------------------
SourceMod 1.0.3 [2008-06-21]
Changes:
- Fixed SDKTools compatibility for latest TF2 update.
- Fixed amb1750: OnAutoConfigsBuffered() inserted before "exec server.cfg".
- Fixed a logic bug where OnConfigsExecuted() could be executed before "exec server.cfg" finished.
- Fixed a rare crash in the event manager that manifested on Zombie Panic! Source.
----------------------------
SourceMod 1.0.2 [2008-05-31]
Changes:
- The admin menu is now user-modifiable (the "Dynamic Admin Menu").
- Added a TF2 extension with Team Fortress functions.
- Added a RegEx extension with regular expression functions.
- Added functions to SDKTools for hooking entity outputs.
- Added preliminary support for the DoD:S Orange Box beta.
- Added a forward for map config plugins for preventing race conditions.
- Added a %b format specifier for binary printing.
- Added sm_dump_datamaps command (SDKTools) for enumerating datamap properties.
- Added sm_dump_admcache command for debugging the admin cache.
- Added amb1715 - TraceHull functions to SDKTools (complementing TraceRay).
- Added amb1694 - FindCharInString() function.
- Added amb1685 - GetTickInterval() function.
- Added amb1620 - ActivateEntity() function to SDKTools (for Orange Box particle system).
- Added amb1610 - StripQuotes() function.
- Added amb1558 - Compiler now has __BINARY_PATH__ and __BINARY_FILE__ macros.
- Fixed amb1686 - ReplaceString* with an empty search string crashed; it now throws an error.
- Fixed amb1684 - Blank passwords required an empty but set password.
- Fixed amb1595 - Extension load failures did not show a platform error message.
- Fixed amb1583 - MySQL string fetch from prepared queries returned corrupted data.
- Fixed amb1358 - Timeleft did not reset on TF2 restarts.
- Fixed cases where the JIT was too cautious in space optimizations.
- Fixed TF2/Cstrike extensions being loadable on incompatible games.
- Fixed various documentation inconsistencies and typos.
- Fixed internal bugs with file extension handling.
Notes:
There is a possible compatibility regression from amb1684. SetAdminPassword()
has been modified to remove any set password when given an empty string. Previously,
a blank password ("") would force an admin to use "setinfo" to set an empty password,
but this functionality was deemed unuseful and unintended. Blank passwords now
remove any set password.
----------------------------
SourceMod 1.0.1 [2008-05-20]
Changes:
- Fixed SDKTools compatibility for latest TF2 update.
- Removed GivePlayerItem from TF2 (TF2 update broke functionality).
- Fixed amb1688: GivePlayerItem offset was wrong for DoD:S Linux.
- Fixed amb1657: Server console did not see admin version of sm_who.
- Fixed amb1648: Stack corruption from GetClientEyeAngles() on Windows.
- Fixed amb1646: NetFlow_Both did not work for client network statistics.
- Fixed amb1601: Vote FF menu reading from sv_alltalk cvar instead of mp_friendlyfire.
- Fixed amb1591: Fixed listen server crashes on mods like IOS:S which pre-add more than one bot.
- Fixed amb1586: GetTeamName() could crash the server if called on load.
- Fixed mapchooser's round counting for TF2.
- Fixed a bug where an RTE on plugin load would throw a message referring to the plugin as "-1".
- Symbols are no longer stripped on Linux.
- Minor SourceMod SDK fixes.
Notes:
The extension interface version has been bumped. Any extensions compiled against 1.0.1 will require 1.0.1 or higher to run. Extensions against 1.0.0 will continue to run normally.
-2
View File
@@ -162,8 +162,6 @@ private:
c -= (unsigned)'a';
assert(c >= 0 && c < 26);
if (!g_Admins.FindFlag(key, &g_FlagLetters[c]))
{
ParseError(states, "Unrecognized admin level \"%s\"", key);
+26 -1
View File
@@ -296,7 +296,32 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
ConCmdInfo *pInfo;
if (!sm_trie_retrieve(m_pCmds, cmd, (void **)&pInfo))
{
return;
/* Unfortunately, we now have to do a slow lookup because Valve made client commands
* case-insensitive. We can't even use our sortedness.
*/
if (client == 0 && !engine->IsDedicatedServer())
{
return;
}
List<ConCmdInfo *>::iterator iter;
pInfo = NULL;
iter = m_CmdList.begin();
while (iter != m_CmdList.end())
{
if (strcasecmp((*iter)->pCmd->GetName(), cmd) == 0)
{
pInfo = (*iter);
break;
}
iter++;
}
if (pInfo == NULL)
{
return;
}
}
/* This is a hack to prevent say triggers from firing on messages that were
+112 -5
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -40,6 +40,7 @@
#include "Logger.h"
#include "PluginSys.h"
#include "ForwardSys.h"
#include "frame_hooks.h"
#ifdef PLATFORM_WINDOWS
ConVar sm_corecfgfile("sm_corecfgfile", "addons\\sourcemod\\configs\\core.cfg", 0, "SourceMod core configuration file");
@@ -52,6 +53,63 @@ IForward *g_pOnConfigsExecuted = NULL;
IForward *g_pOnAutoConfigsBuffered = NULL;
CoreConfig g_CoreConfig;
bool g_bConfigsExecd = false;
bool g_bServerExecd = false;
bool g_bGotServerStart = false;
bool g_bGotTrigger = false;
ConCommand *g_pExecPtr = NULL;
ConVar *g_ServerCfgFile = NULL;
void CheckAndFinalizeConfigs();
#if defined ORANGEBOX_BUILD
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
void Hook_ExecDispatchPre(const CCommand &cmd)
#else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
void Hook_ExecDispatchPre()
#endif
{
#if !defined ORANGEBOX_BUILD
CCommand cmd;
#endif
const char *arg = cmd.Arg(1);
if (!g_bServerExecd
&& arg != NULL
&& strcmp(arg, g_ServerCfgFile->GetString()) == 0)
{
g_bGotTrigger = true;
}
}
#if defined ORANGEBOX_BUILD
void Hook_ExecDispatchPost(const CCommand &cmd)
#else
void Hook_ExecDispatchPost()
#endif
{
if (g_bGotTrigger)
{
g_bGotTrigger = false;
g_bServerExecd = true;
CheckAndFinalizeConfigs();
}
}
void CheckAndFinalizeConfigs()
{
if ((g_bServerExecd || g_ServerCfgFile == NULL)
&& g_bGotServerStart)
{
#if defined ORANGEBOX_BUILD
g_PendingInternalPush = true;
#else
SM_InternalCmdTrigger();
#endif
}
}
void CoreConfig::OnSourceModAllInitialized()
{
@@ -67,11 +125,52 @@ void CoreConfig::OnSourceModShutdown()
g_Forwards.ReleaseForward(g_pOnServerCfg);
g_Forwards.ReleaseForward(g_pOnConfigsExecuted);
g_Forwards.ReleaseForward(g_pOnAutoConfigsBuffered);
if (g_pExecPtr != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPre, false);
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPost, true);
g_pExecPtr = NULL;
}
}
void CoreConfig::OnSourceModLevelChange(const char *mapName)
{
static bool already_checked = false;
if (!already_checked)
{
g_ServerCfgFile = icvar->FindVar("servercfgfile");
if (g_ServerCfgFile != NULL)
{
ConCommandBase *pBase = icvar->GetCommands();
while (pBase != NULL)
{
if (pBase->IsCommand() && strcmp(pBase->GetName(), "exec") == 0)
{
break;
}
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
}
g_pExecPtr = (ConCommand *)pBase;
if (g_pExecPtr != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPre, false);
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPost, true);
}
else
{
g_ServerCfgFile = NULL;
}
}
already_checked = true;
}
g_bConfigsExecd = false;
g_bServerExecd = false;
g_bGotServerStart = false;
g_bGotTrigger = false;
}
void CoreConfig::OnRootConsoleCommand(const char *cmdname, const CCommand &command)
@@ -385,7 +484,7 @@ void SM_ExecuteForPlugin(IPluginContext *ctx)
void SM_ExecuteAllConfigs()
{
if (g_bConfigsExecd)
if (g_bGotServerStart)
{
return;
}
@@ -406,9 +505,8 @@ void SM_ExecuteAllConfigs()
}
iter->Release();
g_pOnAutoConfigsBuffered->Execute(NULL);
engine->ServerCommand("sm internal 1\n");
g_bGotServerStart = true;
CheckAndFinalizeConfigs();
}
void SM_ConfigsExecuted_Global()
@@ -423,3 +521,12 @@ void SM_ConfigsExecuted_Global()
g_pOnServerCfg->Execute(NULL);
g_pOnConfigsExecuted->Execute(NULL);
}
void SM_InternalCmdTrigger()
{
/* Order is important here. We need to buffer things before we send the command out. */
g_pOnAutoConfigsBuffered->Execute(NULL);
engine->ServerCommand("sm internal 1\n");
g_PendingInternalPush = false;
}
+2 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -68,6 +68,7 @@ extern void SM_ExecuteAllConfigs();
extern void SM_ExecuteForPlugin(IPluginContext *ctx);
extern void SM_ConfigsExecuted_Global();
extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
extern void SM_InternalCmdTrigger();
extern CoreConfig g_CoreConfig;
+12
View File
@@ -359,6 +359,12 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
IChangeableForward *pForward;
const char *name;
cell_t res = Pl_Continue;
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
if (!pEvent)
{
RETURN_META_VALUE(MRES_IGNORED, false);
}
/* Get the event name, we're going to need this for passing to post hooks */
name = pEvent->GetName();
@@ -407,6 +413,12 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
const char *name;
Handle_t hndl = 0;
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
if (!pEvent)
{
RETURN_META_VALUE(MRES_IGNORED, false);
}
name = m_EventNames.front();
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
+1
View File
@@ -220,6 +220,7 @@ SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *n
s_ServerBinCRC = UTIL_CRC32(buffer, size);
free(buffer);
s_ServerBinCRC_Ok = true;
fclose(fp);
}
}
if (error[0] != '\0')
+29 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -511,3 +511,31 @@ const char *CHalfLife2::CurrentCommandName()
return m_CommandStack.front().cmd;
#endif
}
void CHalfLife2::AddDelayedKick(int client, int userid, const char *msg)
{
DelayedKickInfo kick;
kick.client = client;
kick.userid = userid;
UTIL_Format(kick.buffer, sizeof(kick.buffer), "%s", msg);
m_DelayedKicks.push(kick);
}
void CHalfLife2::ProcessDelayedKicks()
{
while (!m_DelayedKicks.empty())
{
DelayedKickInfo info = m_DelayedKicks.first();
m_DelayedKicks.pop();
CPlayer *player = g_Players.GetPlayerByIndex(info.client);
if (player == NULL || player->GetUserId() != info.userid)
{
continue;
}
player->Kick(info.buffer);
}
}
+11 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -79,6 +79,13 @@ struct CachedCommandInfo
#endif
};
struct DelayedKickInfo
{
int userid;
int client;
char buffer[384];
};
class CHalfLife2 :
public SMGlobalClass,
public IGameHelpers
@@ -110,6 +117,8 @@ public:
void PopCommandStack();
const CCommand *PeekCommandStack();
const char *CurrentCommandName();
void AddDelayedKick(int client, int userid, const char *msg);
void ProcessDelayedKicks();
#if !defined METAMOD_PLAPI_VERSION
bool IsOriginalEngine();
#endif
@@ -125,6 +134,7 @@ private:
Queue<DelayedFakeCliCmd *> m_CmdQueue;
CStack<DelayedFakeCliCmd *> m_FreeCmds;
CStack<CachedCommandInfo> m_CommandStack;
Queue<DelayedKickInfo> m_DelayedKicks;
};
extern CHalfLife2 g_HL2;
+1 -1
View File
@@ -59,7 +59,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+77 -59
View File
@@ -121,7 +121,7 @@ void PlayerManager::OnSourceModAllInitialized()
ParamType p1[] = {Param_Cell, Param_String, Param_Cell};
ParamType p2[] = {Param_Cell};
m_clconnect = g_Forwards.CreateForward("OnClientConnect", ET_Event, 3, p1);
m_clconnect = g_Forwards.CreateForward("OnClientConnect", ET_LowEvent, 3, p1);
m_clputinserver = g_Forwards.CreateForward("OnClientPutInServer", ET_Ignore, 1, p2);
m_cldisconnect = g_Forwards.CreateForward("OnClientDisconnect", ET_Ignore, 1, p2);
m_cldisconnect_post = g_Forwards.CreateForward("OnClientDisconnect_Post", ET_Ignore, 1, p2);
@@ -288,7 +288,7 @@ void PlayerManager::RunAuthChecks()
unsigned int removed = 0;
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
pPlayer = GetPlayerByIndex(m_AuthQueue[i]);
pPlayer = &m_Players[m_AuthQueue[i]];
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
if (authstr && authstr[0] != '\0'
&& (strcmp(authstr, "STEAM_ID_PENDING") != 0))
@@ -362,6 +362,7 @@ void PlayerManager::RunAuthChecks()
bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = engine->IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
List<IClientListener *>::iterator iter;
IClientListener *pListener = NULL;
@@ -376,26 +377,29 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
cell_t res = 1;
m_Players[client].Initialize(pszName, pszAddress, pEntity);
pPlayer->Initialize(pszName, pszAddress, pEntity);
m_clconnect->PushCell(client);
m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8, SM_PARAM_COPYBACK);
m_clconnect->PushCell(maxrejectlen);
m_clconnect->Execute(&res, NULL);
m_clconnect->Execute(&res);
if (res)
{
if (!m_Players[client].IsAuthorized())
if (!pPlayer->IsAuthorized())
{
m_AuthQueue[++m_AuthQueue[0]] = client;
}
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
}
else
{
RETURN_META_VALUE(MRES_SUPERCEDE, false);
if (!pPlayer->IsFakeClient())
{
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
}
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
return true;
}
@@ -403,7 +407,7 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
{
int client = engine->IndexOfEdict(pEntity);
bool orig_value = META_RESULT_ORIG_RET(bool);
CPlayer *pPlayer = GetPlayerByIndex(client);
CPlayer *pPlayer = &m_Players[client];
if (orig_value)
{
@@ -418,13 +422,17 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
break;
}
}
}
if (!pPlayer->IsFakeClient()
&& m_bIsListenServer
&& strncmp(pszAddress, "127.0.0.1", 9) == 0)
if (!pPlayer->IsFakeClient()
&& m_bIsListenServer
&& strncmp(pszAddress, "127.0.0.1", 9) == 0)
{
m_ListenClient = client;
}
}
else
{
m_ListenClient = client;
InvalidatePlayer(pPlayer);
}
return true;
@@ -434,8 +442,8 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
CPlayer *pPlayer = GetPlayerByIndex(client);
/* If they're not connected, they're a bot */
if (!pPlayer->IsConnected())
{
@@ -443,6 +451,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
char error[255];
const char *authid = engine->GetPlayerNetworkIDString(pEntity);
pPlayer->Authorize(authid);
pPlayer->m_bFakeClient = true;
if (!OnClientConnect(pEntity, playername, "127.0.0.1", error, sizeof(error)))
{
/* :TODO: kick the bot if it's rejected */
@@ -494,7 +503,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
}
}
m_Players[client].Connect();
pPlayer->Connect();
m_PlayerCount++;
List<IClientListener *>::iterator iter;
@@ -508,9 +517,9 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
m_clputinserver->PushCell(client);
m_clputinserver->Execute(&res, NULL);
if (m_Players[client].IsAuthorized())
if (pPlayer->IsAuthorized())
{
m_Players[client].DoPostConnectAuthorization();
pPlayer->DoPostConnectAuthorization();
}
}
@@ -531,8 +540,9 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (m_Players[client].IsConnected())
if (pPlayer->IsConnected())
{
m_cldisconnect->PushCell(client);
m_cldisconnect->Execute(&res, NULL);
@@ -543,7 +553,7 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
return;
}
if (m_Players[client].WasCountedAsInGame())
if (pPlayer->WasCountedAsInGame())
{
m_PlayerCount--;
}
@@ -556,29 +566,7 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
pListener->OnClientDisconnecting(client);
}
/**
* Remove client from auth queue if necessary
*/
if (!m_Players[client].IsAuthorized())
{
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
if (m_AuthQueue[i] == (unsigned)client)
{
/* Move everything ahead of us back by one */
for (unsigned int j=i+1; j<=m_AuthQueue[0]; j++)
{
m_AuthQueue[j-1] = m_AuthQueue[j];
}
/* Remove us and break */
m_AuthQueue[0]--;
break;
}
}
}
m_Players[client].Disconnect();
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = 0;
InvalidatePlayer(pPlayer);
if (m_ListenClient == client)
{
@@ -613,9 +601,9 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
#endif
int client = engine->IndexOfEdict(pEntity);
cell_t res = Pl_Continue;
CPlayer *pPlayer = &m_Players[client];
CPlayer *pPlayer = GetPlayerByIndex(client);
if (!pPlayer || !pPlayer->IsConnected())
if (!pPlayer->IsConnected())
{
return;
}
@@ -667,8 +655,9 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (!m_Players[client].IsConnected())
if (!pPlayer->IsConnected())
{
return;
}
@@ -676,42 +665,42 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
m_clinfochanged->PushCell(engine->IndexOfEdict(pEntity));
m_clinfochanged->Execute(&res, NULL);
IPlayerInfo *info = m_Players[client].GetPlayerInfo();
IPlayerInfo *info = pPlayer->GetPlayerInfo();
const char *new_name = info ? info->GetName() : engine->GetClientConVarValue(client, "name");
const char *old_name = m_Players[client].m_Name.c_str();
const char *old_name = pPlayer->m_Name.c_str();
if (strcmp(old_name, new_name) != 0)
{
AdminId id = g_Admins.FindAdminByIdentity("name", new_name);
if (id != INVALID_ADMIN_ID && m_Players[client].GetAdminId() != id)
if (id != INVALID_ADMIN_ID && pPlayer->GetAdminId() != id)
{
if (!CheckSetAdminName(client, &m_Players[client], id))
if (!CheckSetAdminName(client, pPlayer, id))
{
m_Players[client].Kick("Your name is reserved by SourceMod; set your password to use it.");
pPlayer->Kick("Your name is reserved by SourceMod; set your password to use it.");
RETURN_META(MRES_IGNORED);
}
} else if ((id = g_Admins.FindAdminByIdentity("name", old_name)) != INVALID_ADMIN_ID) {
if (id == m_Players[client].GetAdminId())
if (id == pPlayer->GetAdminId())
{
/* This player is changing their name; force them to drop admin privileges! */
m_Players[client].SetAdminId(INVALID_ADMIN_ID, false);
pPlayer->SetAdminId(INVALID_ADMIN_ID, false);
}
}
m_Players[client].SetName(new_name);
pPlayer->SetName(new_name);
}
if (m_PassInfoVar.size() > 0)
{
/* Try for a password change */
const char *old_pass = m_Players[client].m_LastPassword.c_str();
const char *old_pass = pPlayer->m_LastPassword.c_str();
const char *new_pass = engine->GetClientConVarValue(client, m_PassInfoVar.c_str());
if (strcmp(old_pass, new_pass) != 0)
{
m_Players[client].m_LastPassword.assign(new_pass);
if (m_Players[client].IsInGame() && m_Players[client].IsAuthorized())
pPlayer->m_LastPassword.assign(new_pass);
if (pPlayer->IsInGame() && pPlayer->IsAuthorized())
{
/* If there is already an admin id assigned, this will just bail out. */
m_Players[client].DoBasicAdminChecks();
pPlayer->DoBasicAdminChecks();
}
}
}
@@ -862,6 +851,33 @@ void PlayerManager::UnregisterCommandTargetProcessor(ICommandTargetProcessor *pH
target_processors.remove(pHandler);
}
void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
{
/**
* Remove client from auth queue if necessary
*/
if (!pPlayer->IsAuthorized())
{
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
if (m_AuthQueue[i] == (unsigned)pPlayer->m_iIndex)
{
/* Move everything ahead of us back by one */
for (unsigned int j=i+1; j<=m_AuthQueue[0]; j++)
{
m_AuthQueue[j-1] = m_AuthQueue[j];
}
/* Remove us and break */
m_AuthQueue[0]--;
break;
}
}
}
m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0;
pPlayer->Disconnect();
}
int PlayerManager::InternalFilterCommandTarget(CPlayer *pAdmin, CPlayer *pTarget, int flags)
{
if ((flags & COMMAND_FILTER_CONNECTED) == COMMAND_FILTER_CONNECTED
@@ -1204,6 +1220,7 @@ CPlayer::CPlayer()
m_bIsInKickQueue = false;
m_LastPassword.clear();
m_LangId = LANGUAGE_ENGLISH;
m_bFakeClient = false;
}
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
@@ -1271,6 +1288,7 @@ void CPlayer::Disconnect()
m_bAdminCheckSignalled = false;
m_UserId = -1;
m_bIsInKickQueue = false;
m_bFakeClient = false;
}
void CPlayer::SetName(const char *name)
@@ -1335,7 +1353,7 @@ IPlayerInfo *CPlayer::GetPlayerInfo()
bool CPlayer::IsFakeClient()
{
return (strcmp(m_AuthID.c_str(), "BOT") == 0);
return m_bFakeClient;
}
void CPlayer::SetAdminId(AdminId id, bool temporary)
+2
View File
@@ -105,6 +105,7 @@ private:
int m_iIndex;
unsigned int m_LangId;
int m_UserId;
bool m_bFakeClient;
};
class PlayerManager :
@@ -173,6 +174,7 @@ public:
unsigned int SetReplyTo(unsigned int reply);
private:
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
void InvalidatePlayer(CPlayer *pPlayer);
private:
List<IClientListener *> m_hooks;
IForward *m_clconnect;
+1 -1
View File
@@ -101,7 +101,7 @@ void CPhraseFile::ParseWarning(const char *message, ...)
m_FileLogged = true;
}
g_Logger.LogError("[SM] %s", message);
g_Logger.LogError("[SM] %s", buffer);
}
void CPhraseFile::ReparseFile()
+10 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,15 +35,24 @@
#include "MenuStyle_Valve.h"
#include "MenuStyle_Radio.h"
#include "PlayerManager.h"
#include "CoreConfig.h"
float g_LastMenuTime = 0.0f;
float g_LastAuthCheck = 0.0f;
bool g_PendingInternalPush = false;
void RunFrameHooks(bool simulating)
{
/* Frame based hooks */
g_DBMan.RunFrame();
g_HL2.ProcessFakeCliCmdQueue();
g_HL2.ProcessDelayedKicks();
if (g_PendingInternalPush)
{
SM_InternalCmdTrigger();
}
g_SourceMod.ProcessGameFrameHooks(simulating);
float curtime = *g_pUniversalTime;
+3 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -32,6 +32,8 @@
#ifndef _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
#define _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
extern bool g_PendingInternalPush;
void RunFrameHooks(bool simulating);
#endif //_INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
+10 -4
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -268,17 +268,23 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand &
ConsolePrint(" SourceMod was developed by AlliedModders, LLC.");
ConsolePrint(" Development would not have been possible without the following people:");
ConsolePrint(" David \"BAILOPAN\" Anderson, lead developer");
ConsolePrint(" Borja \"faluco\" Ferrer, Core developer");
ConsolePrint(" Scott \"Damaged Soul\" Ehlert, Core developer");
ConsolePrint(" Borja \"faluco\" Ferrer, core developer");
ConsolePrint(" Scott \"Damaged Soul\" Ehlert, core developer");
ConsolePrint(" Matt \"pRED\" Woodrow, core developer");
ConsolePrint(" Michael \"ferret\" McKoy, plugin developer");
ConsolePrint(" Pavol \"PM OnoTo\" Marko, SourceHook developer");
ConsolePrint(" Special thanks to Viper of GameConnect");
ConsolePrint(" Special thanks to Mani of Mani-Admin-Plugin");
ConsolePrint(" http://www.sourcemod.net/");
} else if (strcmp(cmdname, "version") == 0) {
}
else if (strcmp(cmdname, "version") == 0)
{
ConsolePrint(" SourceMod Version Information:");
ConsolePrint(" SourceMod Version: %s", SVN_FULL_VERSION);
ConsolePrint(" JIT Version: %s, %s", g_pVM->GetVMName(), g_pVM->GetVersionString());
ConsolePrint(" JIT Settings: %s", g_pVM->GetCPUOptimizations());
ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__);
ConsolePrint(" Build ID: %s", SM_BUILD_UNIQUEID);
ConsolePrint(" http://www.sourcemod.net/");
}
}
+4 -2
View File
@@ -40,7 +40,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
+4 -2
View File
@@ -40,7 +40,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
+3 -9
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -304,10 +304,7 @@ static cell_t sm_CallStartFunction(IPluginContext *pContext, const cell_t *param
HandleError err;
IPlugin *pPlugin;
if (s_CallStarted)
{
return pContext->ThrowNativeError("Cannot start a call while one is already in progress");
}
ResetCall();
hndl = static_cast<Handle_t>(params[1]);
@@ -343,10 +340,7 @@ static cell_t sm_CallStartForward(IPluginContext *pContext, const cell_t *params
HandleError err;
IForward *pForward;
if (s_CallStarted)
{
return pContext->ThrowNativeError("Cannot start a call while one is already in progress");
}
ResetCall();
hndl = static_cast<Handle_t>(params[1]);
+1 -1
View File
@@ -387,7 +387,7 @@ public:
continue;
}
strncopy(buffer, pDir->GetEntryName(), sizeof(buffer));
if ((ptr = strstr(buffer, ".bsp")) == NULL)
if ((ptr = strstr(buffer, ".bsp")) == NULL || ptr[4] != '\0')
{
pDir->NextEntry();
continue;
+56 -1
View File
@@ -1258,10 +1258,64 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
if (!pPlayer)
{
return pContext->ThrowNativeError("Client index %d is invalid", client);
} else if (!pPlayer->IsConnected()) {
}
else if (!pPlayer->IsConnected())
{
return pContext->ThrowNativeError("Client %d is not connected", client);
}
/* Ignore duplicate kicks */
if (pPlayer->IsInKickQueue())
{
return 1;
}
pPlayer->MarkAsBeingKicked();
if (pPlayer->IsFakeClient())
{
char kickcmd[40];
UTIL_Format(kickcmd, sizeof(kickcmd), "kick %s\n", pPlayer->GetName());
engine->ServerCommand(kickcmd);
return 1;
}
g_SourceMod.SetGlobalTarget(client);
char buffer[256];
g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
if (pContext->GetContext()->n_err != SP_ERROR_NONE)
{
return 0;
}
g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer);
return 1;
}
static cell_t KickClientEx(IPluginContext *pContext, const cell_t *params)
{
int client = params[1];
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
if (!pPlayer)
{
return pContext->ThrowNativeError("Client index %d is invalid", client);
}
else if (!pPlayer->IsConnected())
{
return pContext->ThrowNativeError("Client %d is not connected", client);
}
/* Ignore duplicate kicks */
if (pPlayer->IsInKickQueue())
{
return 1;
}
pPlayer->MarkAsBeingKicked();
if (pPlayer->IsFakeClient())
@@ -1460,6 +1514,7 @@ REGISTER_NATIVES(playernatives)
{"ShowActivityEx", ShowActivityEx},
{"ShowActivity2", ShowActivity2},
{"KickClient", KickClient},
{"KickClientEx", KickClientEx},
{"RunAdminCacheChecks", RunAdminCacheChecks},
{"NotifyPostAdminCheck", NotifyPostAdminCheck},
{"IsClientInKickQueue", IsClientInKickQueue},
+40 -2
View File
@@ -192,7 +192,31 @@ static cell_t sm_formatex(IPluginContext *pCtx, const cell_t *params)
return static_cast<cell_t>(res);
}
class StaticCharBuf
{
char *buffer;
size_t max_size;
public:
StaticCharBuf() : buffer(NULL), max_size(0)
{
}
~StaticCharBuf()
{
delete [] buffer;
}
char* GetWithSize(size_t len)
{
if (len > max_size)
{
buffer = (char *)realloc(buffer, len);
max_size = len;
}
return buffer;
}
};
static char g_formatbuf[2048];
static StaticCharBuf g_extrabuf;
static cell_t sm_format(IPluginContext *pCtx, const cell_t *params)
{
char *buf, *fmt, *destbuf;
@@ -200,6 +224,7 @@ static cell_t sm_format(IPluginContext *pCtx, const cell_t *params)
size_t res, maxlen;
int arg = 4;
bool copy = false;
char *__copy_buf;
pCtx->LocalToString(params[1], &destbuf);
pCtx->LocalToString(params[3], &fmt);
@@ -217,12 +242,25 @@ static cell_t sm_format(IPluginContext *pCtx, const cell_t *params)
break;
}
}
buf = (copy) ? g_formatbuf : destbuf;
if (copy)
{
if (maxlen > sizeof(g_formatbuf))
{
__copy_buf = g_extrabuf.GetWithSize(maxlen);
}
else
{
__copy_buf = g_formatbuf;
}
}
buf = (copy) ? __copy_buf : destbuf;
res = atcprintf(buf, maxlen, fmt, pCtx, params, &arg);
if (copy)
{
memcpy(destbuf, g_formatbuf, res+1);
memcpy(destbuf, __copy_buf, res+1);
}
return static_cast<cell_t>(res);
+6 -3
View File
@@ -933,9 +933,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
}
/* Tell it to unload */
pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
IdentityToken_t *pIdentity;
@@ -949,6 +946,12 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
}
/* Tell it to unload */
if (pExt->IsLoaded())
{
IExtensionInterface *pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
pExt->Unload();
delete pExt;
+51 -37
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -283,15 +283,11 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
return err;
}
if (filter)
{
filter->OnExecuteBegin();
}
FuncIter iter = m_functions.begin();
IPluginFunction *func;
cell_t cur_result = 0;
cell_t high_result = 0;
cell_t low_result = 0;
int err;
unsigned int failed=0, success=0;
unsigned int num_params = m_curparam;
@@ -311,12 +307,16 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
{
int err = SP_ERROR_PARAM;
param = &temp_info[i];
if (i >= m_numparams || m_types[i] == Param_Any)
{
type = param->pushedas;
} else {
}
else
{
type = m_types[i];
}
if ((i >= m_numparams) || (type & SP_PARAMFLAG_BYREF))
{
/* If we're byref or we're vararg, we always push everything by ref.
@@ -325,26 +325,30 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
if (type == Param_String)
{
err = func->PushStringEx((char *)param->byref.orig_addr, param->byref.cells, param->byref.sz_flags, param->byref.flags);
} else if (type == Param_Float || type == Param_Cell) {
}
else if (type == Param_Float || type == Param_Cell)
{
err = func->PushCellByRef(&param->val);
} else {
}
else
{
err = func->PushArray(param->byref.orig_addr, param->byref.cells, param->byref.flags);
assert(type == Param_Array || type == Param_FloatByRef || type == Param_CellByRef);
}
} else {
}
else
{
/* If we're not byref or not vararg, our job is a bit easier. */
assert(type == Param_Cell || type == Param_Float);
err = func->PushCell(param->val);
}
if (err != SP_ERROR_NONE)
{
if (!filter || !filter->OnErrorReport(this, func, err))
{
g_DbgReporter.GenerateError(func->GetParentContext(),
func->GetFunctionID(),
err,
"Failed to push parameter while executing forward");
}
g_DbgReporter.GenerateError(func->GetParentContext(),
func->GetFunctionID(),
err,
"Failed to push parameter while executing forward");
continue;
}
}
@@ -352,12 +356,10 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
/* Call the function and deal with the return value. */
if ((err=func->Execute(&cur_result)) != SP_ERROR_NONE)
{
if (filter)
{
filter->OnErrorReport(this, func, err);
}
failed++;
} else {
}
else
{
success++;
switch (m_ExecType)
{
@@ -381,14 +383,12 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
}
break;
}
case ET_Custom:
case ET_LowEvent:
{
if (filter)
/* Check if the current result is the lowest so far (or if it's the first result) */
if (cur_result < low_result || success == 1)
{
if (filter->OnFunctionReturn(this, func, &cur_result) == Pl_Stop)
{
goto done;
}
low_result = cur_result;
}
break;
}
@@ -401,25 +401,39 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
}
done:
if (success)
{
if (m_ExecType == ET_Event || m_ExecType == ET_Hook)
switch (m_ExecType)
{
cur_result = high_result;
} else if (m_ExecType == ET_Ignore) {
cur_result = 0;
case ET_Ignore:
{
cur_result = 0;
break;
}
case ET_Event:
case ET_Hook:
{
cur_result = high_result;
break;
}
case ET_LowEvent:
{
cur_result = low_result;
break;
}
default:
{
break;
}
}
if (result)
{
*result = cur_result;
}
}
if (filter)
{
filter->OnExecuteEnd(&cur_result, success, failed);
}
return SP_ERROR_NONE;
}
+2 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -43,7 +43,7 @@ using namespace SourceHook;
typedef List<IPluginFunction *>::iterator FuncIter;
//:TODO: a global name max define for sourcepawn, should mirror compiler's sNAMEMAX
/* :TODO: a global name max define for sourcepawn, should mirror compiler's sNAMEMAX */
#define FORWARDS_NAME_MAX 64
struct ByrefInfo
+14 -3
View File
@@ -997,8 +997,9 @@ bool HandleSystem::TryAndFreeSomeHandles()
void HandleSystem::Dump(HANDLE_REPORTER rep)
{
char refcount[20], parent[20];
unsigned int total_size = 0;
rep("%-10.10s\t%-20.20s\t%-20.20s\t%-10.10s", "Handle", "Owner", "Type", "Memory");
rep("%-10.10s\t%-20.20s\t%-20.20s\t%-10.10s\t%-10.10s\t%-10.10s", "Handle", "Owner", "Type", "Memory", "Refcount", "Parent");
rep("--------------------------------------------------------------------------");
for (unsigned int i = 1; i <= m_HandleTail; i++)
{
@@ -1049,16 +1050,26 @@ void HandleSystem::Dump(HANDLE_REPORTER rep)
{
type = m_strtab->GetString(pType->nameIdx);
}
if (m_Handles[i].clone == 0)
{
UTIL_Format(refcount, sizeof(refcount), "%d", m_Handles[i].refcount);
UTIL_Format(parent, sizeof(parent), "NULL");
}
else
{
UTIL_Format(refcount, sizeof(refcount), "%d", m_Handles[m_Handles[i].clone].refcount);
UTIL_Format(parent, sizeof(parent), "%d", m_Handles[i].clone);
}
if (pType->dispatch->GetDispatchVersion() < HANDLESYS_MEMUSAGE_MIN_VERSION
|| !pType->dispatch->GetHandleApproxSize(m_Handles[i].type, m_Handles[i].object, &size))
{
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s", index, owner, type, "-1");
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s\t%-10.10s\t%-10.10s", index, owner, type, "-1", refcount, parent);
}
else
{
char buffer[32];
UTIL_Format(buffer, sizeof(buffer), "%d", size);
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s", index, owner, type, buffer);
rep("0x%08x\t%-20.20s\t%-20.20s\t%-10.10s\t%-10.10s\t%-10.10s", index, owner, type, buffer, refcount, parent);
total_size += size;
}
}
+20 -3
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -2387,8 +2387,21 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
}
else
{
g_RootMenu.ConsolePrint(" Debugging: %s", pl->IsDebugging() ? "Yes" : "No");
g_RootMenu.ConsolePrint(" Running: %s", pl->GetStatus() == Plugin_Running ? "Yes" : "No");
if (pl->GetStatus() == Plugin_Running)
{
if (pl->IsDebugging())
{
g_RootMenu.ConsolePrint(" Status: running, debugging");
}
else
{
g_RootMenu.ConsolePrint(" Status: running");
}
}
else
{
g_RootMenu.ConsolePrint(" Status: not running");
}
const char *typestr = "";
switch (pl->GetType())
@@ -2407,6 +2420,10 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
g_RootMenu.ConsolePrint(" Reloads: %s", typestr);
}
if (pl->m_FileVersion >= 3)
{
g_RootMenu.ConsolePrint(" Timestamp: %s", pl->m_DateTime);
}
}
else
{
+2
View File
@@ -312,6 +312,8 @@ private:
bool m_LibraryMissing;
CVector<AutoConfig *> m_configs;
bool m_bGotAllLoaded;
int m_FileVersion;
char m_DateTime[256];
};
class CPluginManager :
+1 -1
View File
@@ -34,7 +34,7 @@
#include "BaseWorker.h"
#define DEFAULT_THINK_TIME_MS 500
#define DEFAULT_THINK_TIME_MS 50
class ThreadWorker : public BaseWorker, public IThread
{
+1 -1
View File
@@ -42,7 +42,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -46,7 +46,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "SAMPLE"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
#define _INCLUDE_BINTOOLS_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_BINTOOLS_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_BINTOOLS_VERSION_H_
#define _INCLUDE_BINTOOLS_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_BINTOOLS_VERSION_H_
+1 -1
View File
@@ -42,7 +42,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "CSTRIKE"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+1 -1
View File
@@ -42,7 +42,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -46,7 +46,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "GEOIP"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_GEOIP_VERSION_H_
#define _INCLUDE_GEOIP_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_GEOIP_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_GEOIP_VERSION_H_
#define _INCLUDE_GEOIP_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_GEOIP_VERSION_H_
+1 -1
View File
@@ -46,7 +46,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "MYSQL"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
#define _INCLUDE_MYSQLEXT_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_MYSQLEXT_VERSION_H_
#define _INCLUDE_MYSQLEXT_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_MYSQLEXT_VERSION_H_
+1 -1
View File
@@ -42,7 +42,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "REGEX"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_REGEXEXT_VERSION_H_
#define _INCLUDE_REGEXEXT_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_REGEXEXT_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_REGEXEXT_VERSION_H_
#define _INCLUDE_REGEXEXT_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_REGEXEXT_VERSION_H_
+1 -1
View File
@@ -45,7 +45,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server -I$(HL2SDK)/common
+4 -4
View File
@@ -82,6 +82,10 @@ extern sp_nativeinfo_t g_TeamNatives[];
bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
{
if (!gameconfs->LoadGameConfigFile(SDKTOOLS_GAME_FILE, &g_pGameConf, error, maxlength))
{
return false;
}
sharesys->AddDependency(myself, "bintools.ext", true, true);
sharesys->AddNatives(myself, g_CallNatives);
sharesys->AddNatives(myself, g_Natives);
@@ -96,10 +100,6 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
SM_GET_IFACE(GAMEHELPERS, g_pGameHelpers);
if (!gameconfs->LoadGameConfigFile(SDKTOOLS_GAME_FILE, &g_pGameConf, error, maxlength))
{
return false;
}
playerhelpers->AddClientListener(&g_SdkTools);
g_CallHandle = handlesys->CreateType("ValveCall", this, 0, NULL, NULL, myself->GetIdentity(), NULL);
+6 -2
View File
@@ -76,7 +76,12 @@ bool EntityOutputManager::IsEnabled()
bool EntityOutputManager::CreateFireEventDetour()
{
if (!g_pGameConf->GetMemSig("FireOutput", &info_address) || !info_address)
if (!g_pGameConf->GetMemSig("FireOutput", &info_address))
{
return false;
}
if (!info_address)
{
g_pSM->LogError(myself, "Could not locate FireOutput - Disabling Entity Outputs");
return false;
@@ -84,7 +89,6 @@ bool EntityOutputManager::CreateFireEventDetour()
if (!g_pGameConf->GetOffset("FireOutputBackup", (int *)&(info_restore.bytes)))
{
g_pSM->LogError(myself, "Could not locate FireOutputBackup - Disabling Entity Outputs");
return false;
}
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "SDKTOOLS"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+28 -10
View File
@@ -109,16 +109,34 @@ static cell_t GetTeamCount(IPluginContext *pContext, const cell_t *params)
return g_Teams.size();
}
static int g_teamname_offset = -1;
static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
{
int teamindex = params[1];
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
{
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
}
static int offset = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_szTeamname")->GetOffset();
char *name = (char *)((unsigned char *)g_Teams[teamindex].pEnt + offset);
if (g_teamname_offset == 0)
{
return pContext->ThrowNativeError("Team names are not available on this game.");
}
if (g_teamname_offset == -1)
{
SendProp *prop = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_szTeamname");
if (prop == NULL)
{
g_teamname_offset = 0;
return pContext->ThrowNativeError("Team names are not available on this game.");
}
g_teamname_offset = prop->GetOffset();
}
char *name = (char *)((unsigned char *)g_Teams[teamindex].pEnt + g_teamname_offset);
pContext->StringToLocalUTF8(params[2], params[3], name, NULL);
@@ -128,9 +146,9 @@ static cell_t GetTeamName(IPluginContext *pContext, const cell_t *params)
static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
{
int teamindex = params[1];
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
{
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
}
static int offset = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_iScore")->GetOffset();
@@ -141,9 +159,9 @@ static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
{
int teamindex = params[1];
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
{
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
}
static int offset = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "m_iScore")->GetOffset();
@@ -155,9 +173,9 @@ static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
{
int teamindex = params[1];
if (!g_Teams[teamindex].ClassName || (teamindex > (int)g_Teams.size()))
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
{
pContext->ThrowNativeError("Team index %d is invalid", teamindex);
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
}
SendProp *pProp = g_pGameHelpers->FindInSendTable(g_Teams[teamindex].ClassName, "\"player_array\"");
+1
View File
@@ -280,6 +280,7 @@ void ShutdownHelpers()
{
s_Teleport.Shutdown();
s_GetVelocity.Shutdown();
s_EyeAngles.Shutdown();
}
const char *GetDTTypeName(int type)
+1 -1
View File
@@ -62,7 +62,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "SQLITE"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
#define _INCLUDE_SQLITEEXT_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
#define _INCLUDE_SQLITEEXT_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
+1 -1
View File
@@ -43,7 +43,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+3
View File
@@ -55,7 +55,10 @@ public:
~CriticalHitManager()
{
if (forward != NULL)
{
forwards->ReleaseForward(forward);
}
DeleteCriticalDetour();
}
+5 -5
View File
@@ -65,14 +65,14 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
{
if (strcmp(g_pSM->GetGameFolderName(), "tf") != 0)
{
snprintf(error, maxlength, "Cannot Load TF2 Extension on mods other than TF2");
UTIL_Format(error, maxlength, "Cannot Load TF2 Extension on mods other than TF2");
return false;
}
ServerClass *sc = UTIL_FindServerClass("CTFPlayer");
if (sc == NULL)
{
snprintf(error, maxlength, "Could not find CTFPlayer server class");
UTIL_Format(error, maxlength, "Could not find CTFPlayer server class");
return false;
}
@@ -80,18 +80,18 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
if (!UTIL_FindDataTable(sc->m_pTable, "DT_TFPlayerShared", playerSharedOffset, 0))
{
snprintf(error, maxlength, "Could not find DT_TFPlayerShared data table");
UTIL_Format(error, maxlength, "Could not find DT_TFPlayerShared data table");
return false;
}
sharesys->AddDependency(myself, "bintools.ext", true, true);
char conf_error[255];
char conf_error[255] = "";
if (!gameconfs->LoadGameConfigFile("sm-tf2.games", &g_pGameConf, conf_error, sizeof(conf_error)))
{
if (conf_error)
{
snprintf(error, maxlength, "Could not read sm-tf2.games.txt: %s", conf_error);
UTIL_Format(error, maxlength, "Could not read sm-tf2.games.txt: %s", conf_error);
}
return false;
}
+1 -1
View File
@@ -47,7 +47,7 @@
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "TF2"
#define SMEXT_CONF_LICENSE "GPL"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SDKTOOLS_VERSION_H_
#define _INCLUDE_SDKTOOLS_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SDKTOOLS_VERSION_H_
+1 -1
View File
@@ -43,7 +43,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1
View File
@@ -330,6 +330,7 @@ void TopMenu::RemoveFromMenu(unsigned int object_id)
topmenu_category_t *cat = m_Categories[i];
for (size_t j = 0; j < m_Categories[i]->obj_list.size(); j++)
{
m_ObjLookup.remove(cat->obj_list[j]->name);
cat->obj_list[j]->callbacks->OnTopMenuObjectRemoved(this, cat->obj_list[j]->object_id);
cat->obj_list[j]->is_free = true;
}
+2 -2
View File
@@ -45,9 +45,9 @@
#define SMEXT_CONF_VERSION SVN_FULL_VERSION
#define SMEXT_CONF_AUTHOR "AlliedModders"
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "MAINMENU"
#define SMEXT_CONF_LOGTAG "TOPMENUS"
#define SMEXT_CONF_LICENSE "GPLv3"
#define SMEXT_CONF_DATESTRING __DATE__
#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__
/**
* @brief Exposes plugin's main interface.
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
#define _INCLUDE_SQLITEEXT_VERSION_H_
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
+4 -2
View File
@@ -36,7 +36,9 @@
#ifndef _INCLUDE_SQLITEEXT_VERSION_H_
#define _INCLUDE_SQLITEEXT_VERSION_H_
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SQLITEEXT_VERSION_H_
+1 -2
View File
@@ -18,7 +18,7 @@
}
}
"dodsbeta"
"dod"
{
"Keys"
{
@@ -67,7 +67,6 @@
{
"game" "cstrike"
"game" "dod"
"game" "dodsbeta"
"game" "sourceforts"
"game" "insurgency"
"game" "Insurgency"
+39 -39
View File
@@ -31,7 +31,7 @@
{
"#supported"
{
"game" "dodsbeta"
"game" "dod"
"game" "tf"
}
@@ -79,7 +79,7 @@
{
"#supported"
{
"game" "dodsbeta"
"game" "dod"
"game" "tf"
}
@@ -105,7 +105,7 @@
{
"#supported"
{
"game" "dodsbeta"
"game" "dod"
"game" "tf"
}
@@ -146,7 +146,7 @@
{
"#supported"
{
"game" "dodsbeta"
"game" "dod"
"game" "tf"
}
@@ -224,7 +224,7 @@
{
"#supported"
{
"game" "dodsbeta"
"game" "dod"
"game" "tf"
}
"Signatures"
@@ -253,23 +253,23 @@
{
"RemovePlayerItem"
{
"windows" "237"
"linux" "238"
"windows" "238"
"linux" "239"
}
"Weapon_GetSlot"
{
"windows" "235"
"linux" "236"
"windows" "236"
"linux" "237"
}
"Ignite"
{
"windows" "192"
"linux" "193"
"windows" "193"
"linux" "194"
}
"Extinguish"
{
"windows" "196"
"linux" "197"
"windows" "197"
"linux" "198"
}
"Teleport"
{
@@ -278,18 +278,18 @@
}
"CommitSuicide"
{
"windows" "386"
"linux" "386"
"windows" "388"
"linux" "388"
}
"GetVelocity"
{
"windows" "129"
"linux" "130"
"windows" "130"
"linux" "131"
}
"EyeAngles"
{
"windows" "121"
"linux" "122"
"windows" "122"
"linux" "123"
}
"DispatchKeyValue"
{
@@ -324,35 +324,35 @@
}
}
/* Day of Defeat: Source (Orange Box Beta) */
"dodsbeta"
/* Day of Defeat: Source */
"dod"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "349"
"linux" "350"
"windows" "350"
"linux" "351"
}
"RemovePlayerItem"
{
"windows" "237"
"linux" "238"
"windows" "238"
"linux" "239"
}
"Weapon_GetSlot"
{
"windows" "235"
"linux" "236"
"windows" "236"
"linux" "237"
}
"Ignite"
{
"windows" "192"
"linux" "193"
"windows" "193"
"linux" "194"
}
"Extinguish"
{
"windows" "196"
"linux" "197"
"windows" "197"
"linux" "198"
}
"Teleport"
{
@@ -361,18 +361,18 @@
}
"CommitSuicide"
{
"windows" "386"
"linux" "386"
"windows" "388"
"linux" "388"
}
"GetVelocity"
{
"windows" "129"
"linux" "130"
"windows" "130"
"linux" "131"
}
"EyeAngles"
{
"windows" "121"
"linux" "122"
"windows" "122"
"linux" "123"
}
"AcceptInput"
{
@@ -401,8 +401,8 @@
}
"WeaponEquip"
{
"windows" "228"
"linux" "229"
"windows" "229"
"linux" "230"
}
"Activate"
{
+40 -132
View File
@@ -32,7 +32,6 @@
"#supported"
{
"game" "cstrike"
"game" "dod"
"game" "hl2mp"
"game" "ship"
"game" "!Dystopia"
@@ -92,7 +91,6 @@
"#supported"
{
"game" "cstrike"
"game" "dod"
"game" "garrysmod"
"game" "hl2mp"
"game" "ship"
@@ -145,7 +143,6 @@
"#supported"
{
"game" "cstrike"
"game" "dod"
"game" "garrysmod"
"game" "hl2mp"
"game" "ship"
@@ -198,7 +195,6 @@
"#supported"
{
"game" "cstrike"
"game" "dod"
"game" "hl2mp"
"game" "!Insurgency"
"game" "pvkii"
@@ -248,6 +244,46 @@
}
}
}
/* EntityFactoryDictionary function */
"#default"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
"linux" "@_Z23EntityFactoryDictionaryv"
}
}
}
/* CBaseEntityOutput::FireOutput */
"#default"
{
"#supported"
{
"game" "cstrike"
"game" "hl2mp"
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x1C\x03\x00\x00\x53\x55\x56\x8B\x71\x14"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
"Offsets"
{
"FireOutputBackup"
{
"windows" "6"
"linux" "6"
}
}
}
/* Counter-Strike: Source */
"cstrike"
@@ -345,94 +381,6 @@
}
}
/* Day of Defeat */
"dod"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "328"
"linux" "329"
}
"RemovePlayerItem"
{
"windows" "226"
"linux" "227"
}
"Weapon_GetSlot"
{
"windows" "224"
"linux" "225"
}
"Ignite"
{
"windows" "188"
"linux" "189"
}
"Extinguish"
{
"windows" "189"
"linux" "190"
}
"Teleport"
{
"windows" "98"
"linux" "99"
}
"CommitSuicide"
{
"windows" "356"
"linux" "357"
}
"GetVelocity"
{
"windows" "126"
"linux" "127"
}
"EyeAngles"
{
"windows" "118"
"linux" "119"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
}
"DispatchKeyValue"
{
"windows" "31"
"linux" "30"
}
"DispatchKeyValueFloat"
{
"windows" "30"
"linux" "31"
}
"DispatchKeyValueVector"
{
"windows" "29"
"linux" "32"
}
"SetEntityModel"
{
"windows" "25"
"linux" "26"
}
"WeaponEquip"
{
"windows" "217"
"linux" "218"
}
"Activate"
{
"windows" "32"
"linux" "33"
}
}
}
/* Half-Life 2: Deathmatch */
"hl2mp"
{
@@ -1818,45 +1766,5 @@
}
}
}
/* EntityFactoryDictionary function */
"#default"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"windows" "\xB8\x01\x00\x00\x00\x84\x2A\x2A\x2A\x2A\x2A\x75\x1D\x09\x2A\x2A\x2A\x2A\x2A\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8\x2A\x2A\x2A\x2A\xC3"
"linux" "@_Z23EntityFactoryDictionaryv"
}
}
}
/* CBaseEntityOutput::FireOutput */
"#default"
{
"#supported"
{
"game" "cstrike"
"game" "hl2mp"
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x1C\x03\x00\x00\x53\x55\x56\x8B\x71\x14"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
"Offsets"
{
"FireOutputBackup"
{
"windows" "6"
"linux" "6"
}
}
}
}
+2 -2
View File
@@ -21,8 +21,8 @@
{
"ForceRespawn"
{
"windows" "280"
"linux" "281"
"windows" "281"
"linux" "282"
}
}
}
+4 -2
View File
@@ -40,7 +40,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "1.0.2.2236"
#define SVN_FILE_VERSION 1,0,2,2236
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
+4 -2
View File
@@ -40,7 +40,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$GLOBAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
+1 -1
View File
@@ -1,7 +1,7 @@
[PRODUCT]
major = 1
minor = 0
revision = 3
revision = 4
[core]
folder = core
+1 -1
View File
@@ -74,7 +74,7 @@ new RebuildCachePart[3] = {0}; /** Cache part sequence numbers */
new PlayerSeq[MAXPLAYERS+1]; /** Player-specific sequence numbers */
new bool:PlayerAuth[MAXPLAYERS+1]; /** Whether a player has been "pre-authed" */
#define _DEBUG
//#define _DEBUG
public OnMapEnd()
{
+82 -8
View File
@@ -81,6 +81,7 @@ BuildDynamicMenu()
new Handle:kvMenu;
kvMenu = CreateKeyValues("Commands");
KvSetEscapeSequences(kvMenu, true);
new String:file[256];
@@ -100,8 +101,6 @@ BuildDynamicMenu()
new String:name[NAME_LENGTH];
new String:buffer[NAME_LENGTH];
KvSetEscapeSequences(kvMenu, true);
if (!KvGotoFirstSubKey(kvMenu))
{
@@ -285,8 +284,7 @@ BuildDynamicMenu()
else
{
submenuInput[Submenu_method] = Name;
}
}
}
KvGetString(kvMenu, "title", inputBuffer, sizeof(inputBuffer));
@@ -587,13 +585,16 @@ public ParamCheck(client)
DisplayTopMenu(hAdminMenu, client, TopMenuPosition_LastCategory);
decl String:unquotedCommand[CMD_LENGTH];
UnQuoteString(g_command[client], unquotedCommand, sizeof(unquotedCommand), "#@");
if (outputItem[Item_execute] == Execute_Player) // assume 'player' type execute option
{
FakeClientCommand(client, g_command[client]);
FakeClientCommand(client, unquotedCommand);
}
else // assume 'server' type execute option
{
InsertServerCommand(g_command[client]);
InsertServerCommand(unquotedCommand);
ServerExecute();
}
@@ -611,16 +612,20 @@ public Menu_Selection(Handle:menu, MenuAction:action, param1, param2)
if (action == MenuAction_Select)
{
new String:info[NAME_LENGTH];
new String:unquotedinfo[NAME_LENGTH];
/* Get item info */
new bool:found = GetMenuItem(menu, param2, info, sizeof(info));
new bool:found = GetMenuItem(menu, param2, unquotedinfo, sizeof(unquotedinfo));
if (!found)
{
return;
}
new String:info[NAME_LENGTH*2+1];
QuoteString(unquotedinfo, info, sizeof(info), "#@");
new String:buffer[6];
new String:infobuffer[NAME_LENGTH+2];
Format(infobuffer, sizeof(infobuffer), "\"%s\"", info);
@@ -645,3 +650,72 @@ public Menu_Selection(Handle:menu, MenuAction:action, param1, param2)
DisplayTopMenu(hAdminMenu, param1, TopMenuPosition_LastCategory);
}
}
stock bool:QuoteString(String:input[], String:output[], maxlen, String:quotechars[])
{
new count = 0;
new len = strlen(input);
for (new i=0; i<len; i++)
{
output[count] = input[i];
count++;
if (count >= maxlen)
{
/* Null terminate for safety */
output[maxlen-1] = 0;
return false;
}
if (FindCharInString(quotechars, input[i]) != -1 || input[i] == '\\')
{
/* This char needs escaping */
output[count] = '\\';
count++;
if (count >= maxlen)
{
/* Null terminate for safety */
output[maxlen-1] = 0;
return false;
}
}
}
output[count] = 0;
return true;
}
stock bool:UnQuoteString(String:input[], String:output[], maxlen, String:quotechars[])
{
new count = 1;
new len = strlen(input);
output[0] = input[0];
for (new i=1; i<len; i++)
{
output[count] = input[i];
count++;
if (input[i+1] == '\\' && (input[i] == '\\' || FindCharInString(quotechars, input[i]) != -1))
{
/* valid quotechar followed by a backslash - Skip */
i++;
}
if (count >= maxlen)
{
/* Null terminate for safety */
output[maxlen-1] = 0;
return false;
}
}
output[count] = 0;
return true;
}
+1
View File
@@ -49,6 +49,7 @@ public Plugin:myinfo =
new Handle:hTopMenu = INVALID_HANDLE;
new g_BanTarget[MAXPLAYERS+1];
new g_BanTargetUserId[MAXPLAYERS+1];
new g_BanTime[MAXPLAYERS+1];
#include "basebans/ban.sp"
+39 -20
View File
@@ -10,7 +10,7 @@
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
@@ -30,9 +30,25 @@
*
* Version: $Id$
*/
PrepareBan(client, target, time, const String:reason[])
{
new originalTarget = GetClientOfUserId(g_BanTargetUserId[client]);
if (originalTarget != target)
{
if (!client)
{
PrintToServer("[SM] %t", "Player no longer available");
}
else
{
PrintToChat(client, "[SM] %t", "Player no longer available");
}
return;
}
decl String:authid[64], String:name[32];
GetClientAuthString(target, authid, sizeof(authid));
GetClientName(target, name, sizeof(name));
@@ -69,26 +85,26 @@ PrepareBan(client, target, time, const String:reason[])
DisplayBanTargetMenu(client)
{
new Handle:menu = CreateMenu(MenuHandler_BanPlayerList);
decl String:title[100];
Format(title, sizeof(title), "%T:", "Ban player", client);
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu2(menu, client, COMMAND_FILTER_NO_BOTS|COMMAND_FILTER_CONNECTED);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
DisplayBanTimeMenu(client)
{
new Handle:menu = CreateMenu(MenuHandler_BanTimeList);
decl String:title[100];
Format(title, sizeof(title), "%T:", "Ban player", client);
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddMenuItem(menu, "0", "Permanent");
AddMenuItem(menu, "10", "10 Minutes");
AddMenuItem(menu, "30", "30 Minutes");
@@ -96,21 +112,21 @@ DisplayBanTimeMenu(client)
AddMenuItem(menu, "240", "4 Hours");
AddMenuItem(menu, "1440", "1 Day");
AddMenuItem(menu, "10080", "1 Week");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
DisplayBanReasonMenu(client)
{
new Handle:menu = CreateMenu(MenuHandler_BanReasonList);
decl String:title[100];
Format(title, sizeof(title), "%T:", "Ban reason", client);
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
/* :TODO: we should either remove this or make it configurable */
AddMenuItem(menu, "Abusive", "Abusive");
AddMenuItem(menu, "Racism", "Racism");
AddMenuItem(menu, "General cheating/exploits", "General cheating/exploits");
@@ -124,11 +140,11 @@ DisplayBanReasonMenu(client)
AddMenuItem(menu, "Unacceptable Spray", "Unacceptable Spray");
AddMenuItem(menu, "Breaking Server Rules", "Breaking Server Rules");
AddMenuItem(menu, "Other", "Other");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public AdminMenu_Ban(Handle:topmenu,
public AdminMenu_Ban(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
@@ -161,9 +177,9 @@ public MenuHandler_BanReasonList(Handle:menu, MenuAction:action, param1, param2)
else if (action == MenuAction_Select)
{
decl String:info[64];
GetMenuItem(menu, param2, info, sizeof(info));
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info);
}
}
@@ -185,7 +201,7 @@ public MenuHandler_BanPlayerList(Handle:menu, MenuAction:action, param1, param2)
{
decl String:info[32], String:name[32];
new userid, target;
GetMenuItem(menu, param2, info, sizeof(info), _, name, sizeof(name));
userid = StringToInt(info);
@@ -200,6 +216,7 @@ public MenuHandler_BanPlayerList(Handle:menu, MenuAction:action, param1, param2)
else
{
g_BanTarget[param1] = target;
g_BanTargetUserId[param1] = userid;
DisplayBanTimeMenu(param1);
}
}
@@ -221,10 +238,10 @@ public MenuHandler_BanTimeList(Handle:menu, MenuAction:action, param1, param2)
else if (action == MenuAction_Select)
{
decl String:info[32];
GetMenuItem(menu, param2, info, sizeof(info));
g_BanTime[param1] = StringToInt(info);
DisplayBanReasonMenu(param1);
}
}
@@ -237,12 +254,12 @@ public Action:Command_Ban(client, args)
ReplyToCommand(client, "[SM] Usage: sm_ban <#userid|name> <minutes|0> [reason]");
return Plugin_Handled;
}
decl len, next_len;
decl String:Arguments[256];
GetCmdArgString(Arguments, sizeof(Arguments));
decl String:arg[65];
decl String:arg[65];
len = BreakString(Arguments, arg, sizeof(arg));
new target = FindTarget(client, arg, true);
@@ -264,6 +281,8 @@ public Action:Command_Ban(client, args)
new time = StringToInt(s_time);
g_BanTargetUserId[client] = GetClientUserId(target);
PrepareBan(client, target, time, Arguments[len]);
return Plugin_Handled;
+1 -1
View File
@@ -129,7 +129,7 @@ public Action:Command_SayChat(client, args)
new len = BreakString(message, arg, sizeof(arg));
new target = FindTarget(client, arg, true, false);
if (target == -1)
if (target == -1 || len == -1)
return Plugin_Handled;
decl String:name2[64];
+23 -2
View File
@@ -634,7 +634,28 @@ native Float:GetClientAvgPackets(client, NetFlow:flow);
native GetClientOfUserId(userid);
/**
* Disconnects a client from the server.
* Disconnects a client from the server as soon as the next frame starts.
*
* Note: Originally, KickClient() was immediate. The delay was introduced
* because despite warnings, plugins were using it in ways that would crash.
* The new safe version can break cases that rely on immediate disconnects,
* but ensures that plugins do not accidentally cause crashes.
*
* If you need immediate disconnects, use KickClientEx().
*
* Note: IsClientInKickQueue() will return true before the kick occurs.
*
* @param client Client index.
* @param format Optional formatting rules for disconnect reason.
* Note that a period is automatically appended to the string by the engine.
* @param ... Variable number of format parameters.
* @noreturn
* @error Invalid client index, or client not connected.
*/
native KickClient(client, const String:format[]="", any:...);
/**
* Immediately disconnects a client from the server.
*
* Kicking clients from certain events or callbacks may cause crashes. If in
* doubt, create a short (0.1 second) timer to kick the client in the next
@@ -647,7 +668,7 @@ native GetClientOfUserId(userid);
* @noreturn
* @error Invalid client index, or client not connected.
*/
native KickClient(client, const String:format[]="", any:...);
native KickClientEx(client, const String:format[]="", any:...);
/**
* Changes a client's team through the mod's generic team changing function.
+9 -1
View File
@@ -1,7 +1,7 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
@@ -298,6 +298,8 @@ functag SrvCmd Action:public(args);
/**
* Creates a server-only console command, or hooks an already existing one.
*
* Server commands are case sensitive.
*
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
@@ -320,6 +322,10 @@ functag ConCmd Action:public(client, args);
/**
* Creates a console command, or hooks an already existing one.
*
* Console commands are case sensitive. However, if the command already exists in the game,
* the a client may enter the command in any case. SourceMod corrects for this automatically,
* and you should only hook the "real" version of the command.
*
* @param cmd Name of the command to hook or create.
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
@@ -334,6 +340,8 @@ native RegConsoleCmd(const String:cmd[], ConCmd:callback, const String:descripti
* it is created. When this command is invoked, the access rights of the player are
* automatically checked before allowing it to continue.
*
* Admin commands are case sensitive from both the client and server.
*
* @param cmd String containing command to register.
* @param callback A function to use as a callback for when the command is invoked.
* @param adminflags Administrative flags (bitstring) to use for permissions.
+6 -2
View File
@@ -37,11 +37,13 @@
#include <version>
#define SOURCEMOD_PLUGINAPI_VERSION 2
#define SOURCEMOD_PLUGINAPI_VERSION 3
struct PlVers
{
version,
String:filevers[],
String:date[],
String:time[]
};
/**
@@ -76,7 +78,9 @@ enum Identity
public PlVers:__version =
{
version = SOURCEMOD_PLUGINAPI_VERSION,
filevers = SOURCEMOD_VERSION
filevers = SOURCEMOD_VERSION,
date = __DATE__,
time = __TIME__
};
/**
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
+2 -2
View File
@@ -37,6 +37,6 @@
#define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */
#define SOURCEMOD_V_MINOR 0 /**< SourceMod Minor version */
#define SOURCEMOD_V_RELEASE 2 /**< SourceMod Release version */
#define SOURCEMOD_V_RELEASE 4 /**< SourceMod Release version */
#define SOURCEMOD_VERSION "1.0.2.2236" /**< SourceMod version string (major.minor.release.build) */
#define SOURCEMOD_VERSION "1.0.4" /**< SourceMod version string (major.minor.release.build) */
+1 -1
View File
@@ -39,4 +39,4 @@
#define SOURCEMOD_V_MINOR $PMINOR$ /**< SourceMod Minor version */
#define SOURCEMOD_V_RELEASE $PREVISION$ /**< SourceMod Release version */
#define SOURCEMOD_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$GLOBAL_BUILD$" /**< SourceMod version string (major.minor.release.build) */
#define SOURCEMOD_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" /**< SourceMod version string (major.minor.release.build) */
+1
View File
@@ -0,0 +1 @@
1.0.4
+5 -60
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -50,7 +50,7 @@
using namespace SourcePawn;
#define SMINTERFACE_FORWARDMANAGER_NAME "IForwardManager"
#define SMINTERFACE_FORWARDMANAGER_VERSION 2
#define SMINTERFACE_FORWARDMANAGER_VERSION 3
/*
* There is some very important documentation at the bottom of this file.
@@ -79,66 +79,11 @@ namespace SourceMod
ET_Single = 1, /**< Only return the last exec, ignore all others */
ET_Event = 2, /**< Acts as an event with the ResultTypes above, no mid-Stops allowed, returns highest */
ET_Hook = 3, /**< Acts as a hook with the ResultTypes above, mid-Stops allowed, returns highest */
ET_Custom = 4, /**< Ignored or handled by an IForwardFilter */
ET_LowEvent = 4, /**< Same as ET_Event except that it returns the lowest value */
};
class IForward;
/**
* @brief Allows interception of how the Forward System executes functions.
*/
class IForwardFilter
{
public:
/**
* @brief Called when an error occurs executing a plugin.
*
* @param fwd IForward pointer.
* @param func IPluginFunction pointer to the failed function.
* @param err Error code.
* @return True to handle, false to pass to global error reporter.
*/
virtual bool OnErrorReport(IForward *fwd,
IPluginFunction *func,
int err)
{
return false;
}
/**
* @brief Called after each function return during execution.
* NOTE: Only used for ET_Custom.
*
* @param fwd IForward pointer.
* @param func IPluginFunction pointer to the executed function.
* @param retval Pointer to current return value (can be modified).
* @return ResultType denoting the next action to take.
*/
virtual ResultType OnFunctionReturn(IForward *fwd,
IPluginFunction *func,
cell_t *retval)
{
return Pl_Continue;
}
/**
* @brief Called when execution begins.
*/
virtual void OnExecuteBegin()
{
};
/**
* @brief Called when execution ends.
*
* @param final_ret Final return value (modifiable).
* @param success Number of successful execs.
* @param failed Number of failed execs.
*/
virtual void OnExecuteEnd(cell_t *final_ret, unsigned int success, unsigned int failed)
{
}
};
class IForwardFilter;
/**
* @brief Unmanaged Forward, abstracts calling multiple functions as "forwards," or collections of functions.
@@ -180,7 +125,7 @@ namespace SourceMod
* @brief Executes the forward.
*
* @param result Optional pointer to store result in.
* @param filter Optional pointer to an IForwardFilter.
* @param filter Do not use.
* @return Error code, if any.
*/
virtual int Execute(cell_t *result, IForwardFilter *filter=NULL) =0;
+3 -3
View File
@@ -246,7 +246,7 @@ namespace SourceMod
* permissions.
* @param ident Security token for any permissions. If typeAccess is NULL, this
* becomes the owning identity.
* @param err Optional pointer to store an error code.
* @param err Optional pointer to store an error code on failure (undefined on success).
* @return A new HandleType_t unique ID, or 0 on failure.
*/
virtual HandleType_t CreateType(const char *name,
@@ -283,7 +283,7 @@ namespace SourceMod
* @param object Object to bind to the handle.
* @param owner Owner of the new Handle (may be NULL).
* @param ident Identity for type access if needed (may be NULL).
* @param err Optional pointer to store an error code.
* @param err Optional pointer to store an error code on failure (undefined on success).
* @return A new Handle_t, or 0 on failure.
*/
virtual Handle_t CreateHandle(HandleType_t type,
@@ -349,7 +349,7 @@ namespace SourceMod
* @param pSec Security pointer; pOwner is written as the owner,
* pIdent is used as the parent identity for authorization.
* @param pAccess Access right descriptor for the Handle; NULL for type defaults.
* @param err Optional pointer to store an error code.
* @param err Optional pointer to store an error code on failure (undefined on success).
* @return A new Handle_t, or 0 on failure.
*/
virtual Handle_t CreateHandleEx(HandleType_t type,
+1 -1
View File
@@ -39,7 +39,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1 -1
View File
@@ -42,7 +42,7 @@ endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK_OB)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2SDK)/public/game/server
+1
View File
@@ -0,0 +1 @@
2
-1
View File
@@ -1641,7 +1641,6 @@ static int substpattern(unsigned char *line,size_t buffersize,char *pattern,char
if (args[arg]!=NULL) {
strins((char*)s,(char*)args[arg],strlen((char*)args[arg]));
s+=strlen((char*)args[arg]);
e++;
} else {
error(236); /* parameter does not exist, incorrect #define pattern */
strins((char*)s,(char*)e,2);
+9
View File
@@ -1346,6 +1346,15 @@ static int hier13(value *lval)
if ((array1 && array2) && (total1 && total2)) {
markheap(MEMUSE_DYNAMIC, 0);
}
/* If both sides are arrays, we should return the maximal as the lvalue.
* Otherwise we could buffer overflow and the compiler is too stupid.
* Literal strings have a constval == -(num_cells) so the cmp is flipped.
*/
if (lval->ident==iARRAY && lval2.ident==iARRAY
&& lval->constval < 0
&& lval->constval > lval2.constval) {
*lval = lval2;
}
if (lval->ident==iARRAY)
lval->ident=iREFARRAY; /* iARRAY becomes iREFARRAY */
else if (lval->ident!=iREFARRAY)
+4 -2
View File
@@ -19,7 +19,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "1.0.2.2138"
#define SVN_FILE_VERSION 1,0,2,2138
#define SM_BUILD_STRING ""
#define SM_BUILD_UNIQUEID "2537" SM_BUILD_STRING
#define SVN_FULL_VERSION "1.0.4" SM_BUILD_STRING
#define SVN_FILE_VERSION 1,0,4,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_
+4 -2
View File
@@ -19,7 +19,9 @@
* @file Contains SourceMod version information.
*/
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$.$LOCAL_BUILD$"
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,$LOCAL_BUILD$
#define SM_BUILD_STRING "$BUILD_STRING$"
#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING
#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING
#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0
#endif //_INCLUDE_SOURCEMOD_VERSION_H_

Some files were not shown because too many files have changed in this diff Show More