Compare commits

...
Author SHA1 Message Date
David Anderson 3f250ba42d Bumped version files. 2008-12-28 20:35:51 -05:00
David Anderson 1b8bb4e049 Removed -dev tag for release build. 2008-12-28 20:33:21 -05:00
David Anderson 34b8d00548 Updated changelog. 2008-12-28 19:55:52 -05:00
David Anderson 0a6cbadcd8 Merge. 2008-12-28 18:54:51 -05:00
David Anderson 701fef1ba4 Log file name consistency for gamedata logs (no bug). 2008-12-28 18:54:36 -05:00
Matt Woodrow ba04132142 SDKTools didn't NULL check after GetMemSig (bug 3504, r=dvander). 2008-12-28 17:52:33 -05:00
David Anderson ea84302e28 Clean slate for languages.cfg (no bug). 2008-12-28 16:09:47 -05:00
David Anderson 08e2fc8deb Support for 3-letter language codes (bug 3526, r=ds). 2008-12-28 02:38:53 -05:00
David Anderson ebed45a0f6 Fixed Linux build. 2008-12-28 01:10:20 -05:00
David Anderson d3c279fd05 Fixed threading issues in gamedata fetcher, new restart mechanism (bug 3351, r=pred). 2008-12-28 01:02:05 -05:00
David Anderson e69ed4b0da Removed unsafe calls from gamedata threader (bug 3351, r=pred). 2008-12-27 19:50:13 -05:00
David Anderson 4daca3c5ba Another gamedata cleanup sponsored by an r=pred (bug 3351). 2008-12-26 23:26:21 -05:00
David Anderson cb41fa6de4 Fixed JIT build on Linux for real. 2008-12-22 20:12:33 -06:00
David Anderson dc758ead10 Build fix for Linux. 2008-12-23 01:55:20 -05:00
David Anderson 1fe38c7473 SourceMod can now be somewhat compiled on OS X for patch sanity testing (bug 3516, r=ds).
This adds the ability for us to change the GCC version we use more flexibly.
2008-12-23 01:33:37 -05:00
Matt Woodrow 58ec9a4f38 Merge 2008-12-15 18:47:11 +13:00
Matt Woodrow b7477fc321 Cleaned up vtable_scanner code a bit to diagnose l4d crashes 2008-12-15 18:45:33 +13:00
Matt Woodrow 2bb3e5fd6b Gamedata cleanup and security fix (bug 3351 r=dvander) 2008-12-12 23:20:35 -05:00
Scott Ehlert eedfd2d70d Shell script code in Makefiles is _really_ POSIX compliant now.
Missed an equal sign :\
2008-12-07 21:05:51 -06:00
Scott Ehlert 4bbd74b702 Shell script code in Makefiles is now POSIX compliant and is able to be run on dash. 2008-12-07 20:40:31 -06:00
Scott Ehlert 1d07d24054 Triggering a build? 2008-12-07 00:49:29 -06:00
Matt Schubert 7d3e32b65f Attempted fix for GiveNamedItem crashing on Windows (bug 3472, r=dvander) 2008-12-03 13:04:48 -05:00
David Anderson 04354a809c Fixed FindTeamByName using wrong case sensitivity (bug 3446, r=pred). 2008-11-29 23:28:28 -06:00
David Anderson 3cf30f5e62 Added filetest.sp to testsuite. 2008-11-29 22:44:11 -06:00
David Anderson 7ff0129f36 Fixed ReadFileString ignoring fourth parameter (bug 3459, r=ds). 2008-11-29 22:43:30 -06:00
David Anderson b684d3aad7 Various nits on smupdate tool (bug 3351, r=pred). 2008-11-29 20:07:43 -06:00
Matt Schubert f164419baa Fixed hsay/tsay not checking for in-game players 2008-11-29 18:49:10 -05:00
David Anderson dcccfbd26a Fixed sm_sql_addadmin reading the immunity field as a password (bug 3395, r=pred). 2008-11-29 16:27:52 -06:00
David Anderson 2fc0520895 Fixed ReadFile sign-extending instead of zero-extending (bug 3449, r=ds). 2008-11-28 20:01:23 -06:00
Scott Ehlert 7b1adfe00b Added msvc9 project file for sample_ext
Also updated msvc8 project file for compilation against MM:S 1.7
2008-11-27 02:37:31 -06:00
Scott Ehlert 28e1568eb7 Missed a reference to SOURCEMM16 in JIT project files (bug 3445). 2008-11-27 02:20:08 -06:00
Scott Ehlert 0a6eac7c27 Added .hgignore so that 'hg status' can ignore untracked files of certain types. 2008-11-27 00:49:37 -06:00
Scott Ehlert ecaced40f2 Now compiles against Metamod:Source 1.7 (bug 3445). 2008-11-27 01:13:51 -06:00
Matt Woodrow 321443450a SourceMod now handles steamid's internally without the STEAM_*: part (bug 3428) 2008-11-25 19:10:52 +13:00
Scott Ehlert 25a0a192a2 Added /MP back to core and sdktools MSVC project files. 2008-11-24 09:41:46 -06:00
Scott Ehlert 4563c00deb Merge. 2008-11-24 08:39:46 -06:00
Scott Ehlert e26ce2b457 OriginalFilename field in core/version.rc now has correct filename based on engine. 2008-11-24 08:25:36 -06:00
David Anderson d1405f2ab3 Updated core Makefile. 2008-11-16 18:41:14 -06:00
David Anderson 2ff9b0aada Removed pointless "systems" folder from core.
--HG--
rename : core/systems/ExtensionSys.cpp => core/ExtensionSys.cpp
rename : core/systems/ExtensionSys.h => core/ExtensionSys.h
rename : core/systems/ForwardSys.cpp => core/ForwardSys.cpp
rename : core/systems/ForwardSys.h => core/ForwardSys.h
rename : core/systems/HandleSys.cpp => core/HandleSys.cpp
rename : core/systems/HandleSys.h => core/HandleSys.h
rename : core/systems/LibrarySys.cpp => core/LibrarySys.cpp
rename : core/systems/LibrarySys.h => core/LibrarySys.h
rename : core/systems/PluginInfoDatabase.cpp => core/PluginInfoDatabase.cpp
rename : core/systems/PluginInfoDatabase.h => core/PluginInfoDatabase.h
rename : core/systems/PluginSys.cpp => core/PluginSys.cpp
rename : core/systems/PluginSys.h => core/PluginSys.h
rename : core/systems/ShareSys.cpp => core/ShareSys.cpp
rename : core/systems/ShareSys.h => core/ShareSys.h
2008-11-16 16:06:18 -08:00
Scott Ehlert acea705df8 Moved IDA scripts from editor/ida to tools/ida_scripts
--HG--
rename : editor/ida/gcc_fpic.idc => tools/ida_scripts/gcc_fpic.idc
rename : editor/ida/linux_vtable_dump.idc => tools/ida_scripts/linux_vtable_dump.idc
2008-11-14 03:51:57 -06:00
David Anderson 30174c07de Forcing build. 2008-11-12 22:41:17 -08:00
David Anderson 8e5c7713fc Forcing build. 2008-11-12 22:34:52 -08:00
David Anderson 7b45342955 Forcing build. 2008-11-12 22:32:04 -08:00
Scott Ehlert 2f0965c14b Fixed Linux build 2008-11-12 23:22:33 -06:00
Scott Ehlert c1c5d2656c The replicate and notify parameters for SetConVarX and ResetConVar are now ignored on Orange Box.
- OB engine automatically replicates and fires server_cvar event notification for changes cvars.
- Added a note about this in comments for affected natives.
2008-11-12 23:14:49 -06:00
David Anderson af2af91300 Take-two at fixing bug 3410. 2008-11-11 02:21:25 -08:00
David Anderson c880919466 Merge. 2008-11-11 01:37:24 -08:00
David Anderson b1646accb9 Attempted to lcase dll dirs in the symstore. 2008-11-11 01:36:15 -08:00
Scott Ehlert 00bb796db2 Version 1.2 of fPIC script
- Now works with GCC 4.3 compiled binaries (like Left 4 Dead)
- Fixed: Redefining alignment blocks as data caused IDA to pop up an annoying warning
2008-11-06 17:07:53 -06:00
Scott Ehlert 6c1259f6e6 Import of IDA script to demangle fPIC on x86 (checkin=dvander). 2008-11-06 00:08:24 -08:00
David Anderson a04521b55a Fixed "nextmap" command being spammable (bug 3391, r=pred). 2008-11-05 21:02:07 -08:00
David Anderson c8b3c82a12 Moved structs.inc out of plugins\include.
--HG--
rename : plugins/include/structs.inc => extensions/structs/structs.inc
2008-11-01 00:02:53 -07:00
David Anderson c1c8a4c988 Backed out structs extension from being in builds - it's not ready to land. 2008-10-31 23:20:40 -07:00
David Anderson 335febca34 Fixed windows offset in structs extension. 2008-10-31 23:15:34 -07:00
David Anderson e191d446a7 Fixed structs extension using the wrong filename. 2008-10-31 22:54:19 -07:00
David Anderson 412ad74aad Fixed gamedata file refcounting bug in the structs extension. 2008-10-31 22:47:13 -07:00
David Anderson e70fc299ac Fixed accidental NULLing of natives in the native name cache but not filled. 2008-10-31 22:35:27 -07:00
David Anderson b3b972caf7 Fixed missing semi-colon in sdktools_stocks.inc (bug 3376). 2008-10-31 08:38:44 -05:00
David Anderson c25017e1a4 Fixed basechat not checking client in-game status for display center text (bug 3372). 2008-10-31 08:35:27 -05:00
David Anderson be1d12f94f Merge. 2008-10-31 08:28:24 -05:00
David Anderson 3c18289465 Fixed race condition where client cookie callbacks could be fired against wrong clients (bug 3375). 2008-10-31 08:28:08 -05:00
David Anderson ed29c837fa Fixed failed timers leaking dangling plugin references (bug 3381). 2008-10-29 01:27:56 -07:00
David Anderson 8d78c74554 Fixed horrendous crash in the JIT from packing change in the debug table (bug 3334, r=me).
I accidentally changed the debug table packing in a commit a while ago.  This explains the nonsense debug output and crashes people have been getting on the 1.1 branch.  Fortunately this is (mostly) detectable via the "debug.natives" table and the JIT will unpack symbols based on that information.
2008-10-27 02:02:14 -05:00
David Anderson e48bba5b4d Fixed leaking relocation table memory in JIT. 2008-10-26 23:50:54 -05:00
David Anderson 547f7aecc1 Fixed crash when using ISourcePawnEngine2::LoadPlugin with a non-existant file. 2008-10-26 23:40:24 -05:00
David Anderson 67ba04bcee Fixed IsClientTimingOut spelling in native export table. 2008-10-24 20:59:26 -05:00
David Anderson a1d84347ed Fixed bounds checking in ReadHandle routine (bug 3359). 2008-10-21 23:52:50 -07:00
David Anderson 253109d1c9 Rewrote querying in client prefs to not use prepared queries (bug 2698, r=pred).
Prepared queries had annoying race conditions and became unusable on connection timeouts.
2008-10-20 03:40:46 -05:00
David Anderson c0c9fc3267 Fixed buffer reallocation in dbi.mysql leaving stale pointers behind and crashing (bug 3352). 2008-10-19 22:57:28 -07:00
Matt Woodrow 918bec36d9 Fixed regression in send/revc calls in the gamedata fetcher 2008-10-20 18:42:22 +13:00
Matt Woodrow 7b8cd751e1 I should get more sleep. 2008-10-19 17:44:19 +13:00
Matt Woodrow 849c4a70ae And again with the build breaking.. 2008-10-19 17:37:21 +13:00
Matt Woodrow c231375e19 Mergesaurus Rex 2008-10-19 17:28:45 +13:00
Matt Woodrow d8babe2a71 Gamedata fetching cleanup - Part 1 (bug 3351 r=dvander) 2008-10-19 17:27:54 +13:00
Matt Woodrow 4e88a5a431 Updated rockthevote to use new OnClientConnected forward (bug 3311) 2008-10-19 16:18:22 +13:00
David Anderson a6579c7bcb Added new OnClientConnected callback with correct pairing intent (bug 3311, r=pred). 2008-10-18 22:14:13 -05:00
David Anderson 5a2f8afd33 Fixed calling the wrong GetError(), causing misleading spew (part of bug 2698). 2008-10-17 02:04:09 -05:00
Matt Woodrow 3c12db8637 Merging like a zip! 2008-10-16 10:55:42 +13:00
Matt Woodrow 07cbe39552 Updated basetriggers to use more translation friendly phrases (bug 3330, r=dvander).
Basetriggers now counts rounds remaining for mp_maxrounds output.
2008-10-16 10:54:23 +13:00
David Anderson 974f31c149 Various clientprefs logging to try and catch bug 2698 in the act. 2008-10-15 01:01:36 -07:00
Matt Woodrow 4a1c565b62 Updated rockthevote to use new MaxClients variable 2008-10-15 20:42:47 +13:00
Matt Woodrow 32f9c46424 Struct Test should compile now 2008-10-15 20:42:26 +13:00
Matt Woodrow 34d2d7760b Fixed bug 3312 - Added Radio Menu Timeout for synergy 2008-10-14 12:31:22 +13:00
David Anderson 2f36e3b231 Deprecated SQL_ConnectEx for SQL_ConnectCustom, which expresses the API intent better (bug 3307, r=pred). 2008-10-13 01:13:39 -05:00
Matt Woodrow b0d6e39035 Merge 2008-10-09 20:19:22 +13:00
Matt Woodrow b7a2f221f2 Fixed a couple of plugin errors with third party mods (bug 3305) 2008-10-09 20:18:16 +13:00
David Anderson 6d2bb90f51 Added radio menu support for Fortress Forever (bug 3260). 2008-10-08 23:53:31 -07:00
David Anderson fa1336623f Added GiveNamedItem/EquipPlayerWeapon back to TF2 (bug 3276, r=bl4nk). 2008-10-08 22:53:49 -07:00
David Anderson 2b65e2496d Added radio menu support for Synergy (bug 3301). 2008-10-08 22:43:57 -07:00
David Anderson 4953b1d889 Added radio menu support for D.I.P.R.I.P. (bug 3304). 2008-10-08 22:41:44 -07:00
Matt Woodrow ed75da0f85 Reworked unavailable nominations showing in the menu (bug 3269)
Fixed a non-const String in mapchooser.inc
2008-10-09 14:24:30 +13:00
Matt Woodrow ff7cb43f6a Build fix attempt one (1) 2008-10-09 13:58:53 +13:00
Matt Woodrow dc3b4a57cc Structs now builds for the old engine (bug 3286) - again. 2008-10-09 13:35:14 +13:00
Matt Woodrow 7009e755fe Backed out changeset: 44b02986c01b
Damn you tortoisehg
2008-10-09 13:33:47 +13:00
Matt Woodrow bba2cfc6f7 Structs now builds for the old engine (bug 3286) 2008-10-09 13:24:44 +13:00
Matt Woodrow 759c76e188 Maps nominated by owner=0 should not be replaced. Fixes sm_nominate_addmap only allowing a single map to be added (bug 3272) 2008-10-08 21:02:01 +13:00
Matt Woodrow db5a0be4ca Backed out changeset: 19331eae67ad 2008-10-08 20:59:56 +13:00
Matt Woodrow 29e57e77f7 Maps nominated by owner=0 should not be replaced. Fixes sm_nominate_addmap only allowing a single map to be added (bug 3272) 2008-10-08 20:58:25 +13:00
David Anderson f50c7469ca Added MaxClients public var to replace GetMaxClients (bug 3283, r=pred).
This is a hard bump of the plugin version number.  1.1 plugins compiled against this include set
will not run against earlier versions of SourceMod.
2008-10-05 15:20:17 -07:00
David Anderson d9af295a29 Corrected case in a nominations phrase. 2008-10-05 04:19:39 -07:00
David Anderson 4147bf7444 Language files are now additive, and are sniffed from translations/[iso code].
This is so translations can be maintained easier without any merging pains on behalf of users or developers.
2008-10-05 04:08:48 -07:00
David Anderson 99e304d6b5 Fixed a bug where SourceMod failed trying to default back to English when missing translations. 2008-10-05 04:06:18 -07:00
David Anderson 4e7000368f Fixed clientprefs race condition on first run (bug 3294, r=pred). 2008-10-05 01:09:58 -05:00
David Anderson 04b7b7b9ff Removed pointless performance warning. 2008-10-04 12:59:21 -07:00
David Anderson 2534fd1ce2 Fixed reverse order of evaluation in mapchooser causing an invalid handle read (bug 3290, r=bl4nk). 2008-09-30 22:45:26 -07:00
David Anderson e10dd226ff Fixed OnConfigsExecuted() not working on listen servers (bug 3287, r=me). 2008-09-29 20:02:19 -07:00
David Anderson b016623fb5 Removed debug spew left in adminmenu.sp. 2008-09-28 15:38:32 -07:00
Matt Woodrow 49d14111e2 Fixed mapchooser not starting a vote if RTV result is "Don't change" (bug 2734, r=bl4nk). 2008-09-27 21:46:07 -07:00
David Anderson f0a11d3cb7 Fixed project file name mismatch in the build tool. 2008-09-27 18:04:10 -07:00
David Anderson 168f42323b Missing regex vc9 project files (this is getting really tiresome). 2008-09-27 17:54:02 -07:00
David Anderson 64e7d0b737 Forgot to commit game.cstrike.ext msvc9 project files. 2008-09-27 17:43:30 -07:00
David Anderson 2e8c0c8f7d Added environment variable for MySQL5 since vcbuild.exe is being a pain. 2008-09-27 17:25:53 -07:00
David Anderson 8f555543cc Switch to vcbuilder.exe since devenv.com is not available in express editions. 2008-09-27 16:19:56 -07:00
David Anderson 88a71ddad4 Migrated to Visual Studio 2008 for default builds (bug 3257). 2008-09-27 14:59:09 -07:00
David Anderson 02e31bb576 Compiler now emits debug info about natives (bug 3282, r=sawce). 2008-09-27 13:46:42 -07:00
David Anderson 32f7bec6c8 Fixed building on GCC and some valgrind warnings. Read .dbg.natives table now. 2008-09-27 15:34:59 -05:00
Matt Woodrow a935e6f90d Merge! 2008-09-26 19:10:40 +12:00
Matt Woodrow f4dba84ae5 Core now detects and handles a changed maxplayers value (bug 2537 and bug 2758) 2008-09-26 19:08:49 +12:00
David Anderson 5cb4acf590 Added some notion of def-use to unfold copy propagation across registers and the eval stack.
At some point we will need to walk the expr tree to fold this back where appropriate, i.e. single use for calls.
2008-09-23 22:00:47 -07:00
David Anderson e83526aa63 Merge. 2008-09-23 21:21:03 -07:00
David Anderson 04021ed8b1 Initial import/sketch of opcode analyzer (bug 3279).
Uses single static assignment to recover expression trees from straight-line byte code.
2008-09-23 21:20:40 -07:00
David Anderson 31a4f40c9a Merge. 2008-09-23 01:17:40 -05:00
David Anderson 4001b0f804 Various chat commands now follow sm_show_activity (bug 2080, r=pred).
Added FormatActivitySource() native to assist in emulating ShowActivity().
2008-09-23 01:17:15 -05:00
David Anderson a838276ec2 Changed functag syntax so public keyword is in the normal place. The old style is still allowed. 2008-09-21 14:56:38 -07:00
David Anderson 6192efc078 Fixed realloc/delete[] mismatch (thank sawce), corrected some whitespace. 2008-09-21 14:05:13 -07:00
Matt Woodrow 4517031861 Updated randomcycle to use the Nextmap API 2008-09-21 14:20:01 +12:00
Matt Woodrow 187ff255bd GCC will not beat me! 2008-09-18 18:42:13 +12:00
Matt Woodrow dec172f0e1 Mergey Mergey 2008-09-18 18:28:17 +12:00
Matt Woodrow a0107299f3 Predcrab - Destroyer of builds strikes again 2008-09-18 18:27:41 +12:00
David Anderson bbbc2ce22c Merge (A la Worms 2, The First of Many!) 2008-09-18 00:15:34 -05:00
David Anderson def0a8a0d6 Attempt at solving this stdout redirection mess for buildbot. 2008-09-18 00:11:24 -05:00
Matt Woodrow 46095d797c Merge 2008-09-18 15:33:50 +12:00
Matt Woodrow 5687a7ba90 Added Struct Abstraction extension (bug 2666 and bug 2663)
--HG--
rename : extensions/structs/structs.txt => gamedata/structs.gamedata.txt
rename : extensions/structs/structs.inc => plugins/include/structs.inc
rename : extensions/structs/structtest.sp => plugins/testsuite/structtest.sp
2008-09-18 15:32:22 +12:00
David Anderson 556c03babf Added CreateDirectory() native and a few permissions macros (bug 3253, r=ds). 2008-09-17 02:07:19 -05:00
David Anderson 09ea2e13aa Fixed SDKTools not cleaning up its handle types on shutdown (but 2753). 2008-09-15 04:28:26 -05:00
David Anderson ef62e3d665 Fixed IHandleSys::RemoveType() not removing the type name from the name cache (bug 2753). 2008-09-15 04:26:58 -05:00
David Anderson fb2f0795c5 Fixed JIT 1.2 not compiling code for the SYSREQ.C opcode (bug 2764). This caused LDuke's TF2Nades to crash because spcomp doesn't seem to peephole optimize some sysreq.c's away for float operators (oddity discovered by sawce). 2008-09-14 23:42:20 -07:00
David Anderson fb44b51d26 Updated version files so I can build again. 2008-09-14 22:16:35 -07:00
David Anderson 8680d07e0a Triggering build. 2008-09-14 19:42:04 -05:00
David Anderson 9d8445b693 Triggering build. 2008-09-14 19:34:33 -05:00
David Anderson 5de80c03db Triggering build. 2008-09-14 19:28:48 -05:00
David Anderson c5df0bf58f Triggering build. 2008-09-14 19:28:03 -05:00
David Anderson 8c1502278b Triggering build. 2008-09-14 18:59:21 -05:00
David Anderson 08e3e3b53d Triggering build. 2008-09-14 18:57:01 -05:00
David Anderson 86591356b0 Triggering build. 2008-09-14 18:52:59 -05:00
David Anderson f62cf04f91 Triggering build. 2008-09-14 18:29:11 -05:00
David Anderson cf621eaf10 Triggering build. 2008-09-14 18:25:44 -05:00
David Anderson b8214a80c2 Cleared out NOTICE.txt. 2008-09-14 18:16:28 -05:00
David Anderson f79c9eec82 Changes to buildbot scripts for Mercurial. 2008-09-14 16:40:49 -05:00
David Anderson 8fcecf3dec Updated versionchanger.pl for Mercurial, FINALLY fixed its whitespace. 2008-09-14 16:26:38 -05:00
Scott Ehlert 326e8ee205 Fixed tags for sourcemod-central
sourcemod-1.0.0 - Orginally tagged by David Anderson <[email protected]> on Mon Mar 17 01:28:54 2008 UTC
2008-09-14 03:43:26 -05:00
Scott Ehlert bda56bf33f Eliminated head: da55a80522cf, a remnant of sourcemod-1.1.0 branch 2008-09-14 03:01:05 -05:00
Scott Ehlert 7439f15d7e Eliminated head for dead branch: refac-jit 2008-09-14 02:59:26 -05:00
Scott Ehlert 7a4967abc9 Eliminated head for dead branch: sourcemod-1.1.0 2008-09-14 02:58:58 -05:00
Scott Ehlert 6749545991 Eliminated head for dead branch: dvander 2008-09-14 02:58:07 -05:00
Scott Ehlert 124c3f4575 Eliminated head for dead branch: faluco 2008-09-14 02:57:14 -05:00
Scott Ehlert 56b77a536f Removed files for dead branch: refac-jit
--HG--
branch : refac-jit
2008-09-14 02:55:49 -05:00
Scott Ehlert e175cce776 Removed files for dead branch: sourcemod-1.1.0
--HG--
branch : sourcemod-1.1.0
2008-09-14 02:55:25 -05:00
Scott Ehlert 097f42a01c Removed files for dead branch: faluco
--HG--
branch : faluco
2008-09-14 02:54:50 -05:00
David Anderson bcf1b092ae Mirrored buildbot/version template changes from branch.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402539
2008-09-14 06:13:25 +00:00
Matt Schubert d707ea0de5 Fixed amb1929 - Banning via console should now work properly
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402533
2008-09-12 20:36:53 +00:00
Matt Woodrow 2c107e3601 Fixed amb1990 - Translator warnings not evaluating format params
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402532
2008-09-09 02:45:29 +00:00
David Anderson 29d1246b8d Fixed another sdktools team native crash, if m_szTeamName wasn't available (bug amb1779, r=pred).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402530
2008-09-08 07:00:34 +00:00
David Anderson 514fc7dfe8 Fixed missing translation for funvotes (bug amb1968).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402528
2008-09-08 06:38:10 +00:00
David Anderson 0691bca512 Added "antiflood.txt" to Core's IPhraseCollection to prevent error spew (bug amb1922).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402527
2008-09-08 06:20:54 +00:00
David Anderson e1f8a0fd68 Fixed the compiler eating too many characters in macro subsitutions (bug amb1938).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402526
2008-09-08 02:13:17 +00:00
David Anderson e141cf74d5 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--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402523
2008-09-07 22:17:12 +00:00
David Anderson 9ca1ca62ea 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--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402521
2008-09-07 09:51:38 +00:00
David Anderson 99d27b979d Triggering rebuild for win32-trunk.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402519
2008-09-07 03:56:45 +00:00
David Anderson 681747d02c Fixed long strings with internal static copybacks causing buffer overflows (bug amb1986).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402518
2008-09-07 03:24:51 +00:00
David Anderson 1ec936daf6 Testing pushing of build.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402516
2008-09-07 00:18:18 +00:00
David Anderson 8eb6d9ccf5 Added master.cfg from buildbot for safe keeping.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402514
2008-09-06 23:36:04 +00:00
David Anderson d3394453ff Fixed, hopefully, one of the last bugs in the symstore script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402513
2008-09-06 23:26:52 +00:00
David Anderson 5caeebf807 Bugfixes to buildbot scripts, added symstore script.
Removed soon-to-be-outdated fetchdlls program.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402512
2008-09-06 23:24:56 +00:00
David Anderson d6a9cb427f Added product version file, first step to removing modules.versions someday.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402506
2008-09-06 14:33:48 +00:00
David Anderson cb4b1dce71 Another PathFormat.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402505
2008-09-06 14:10:21 +00:00
David Anderson e6c5adfa24 PathFormat in bootstrap.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402504
2008-09-06 14:03:50 +00:00
David Anderson 444896104f Enclose bootstrapper command in quotes.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402503
2008-09-06 14:02:48 +00:00
David Anderson e2791a3702 Packager now gets a config file on the command line (more secure for buildbot).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402502
2008-09-06 13:04:54 +00:00
David Anderson 16ed584e39 Added packaging script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402501
2008-09-06 12:19:33 +00:00
David Anderson d6a0cb8992 Removed some debug code, and hopefully fixed misleading failures.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402500
2008-09-06 10:18:26 +00:00
David Anderson f99b82b53a Added default return code of 0.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402499
2008-09-06 09:40:44 +00:00
David Anderson 32b7e2df98 startbuild is now a direct pipe.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402498
2008-09-06 09:32:12 +00:00
David Anderson 0137219fb8 Added startbuild script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402497
2008-09-06 09:24:39 +00:00
David Anderson 51f914fb30 Bootstrap performs all steps up to executing builer now.
Builder sends error code on failure now.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402496
2008-09-06 09:12:21 +00:00
David Anderson f85eeb2adb Finally, paths sorted out I think.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402495
2008-09-06 08:35:27 +00:00
David Anderson 6b213a9caf Ugh.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402494
2008-09-06 08:19:05 +00:00
David Anderson 35f31b0f1a More buildbot path nonsense.
--HG--
rename : tools/buildbot/build_builder.pl => tools/buildbot/bootstrap.pl
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402493
2008-09-06 08:09:19 +00:00
David Anderson 56a68f4dfd Paths should be relative to working folder.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402492
2008-09-06 07:47:29 +00:00
David Anderson 6e930f6048 Added buildbot script for building builder tool.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402491
2008-09-06 07:39:10 +00:00
David Anderson 4fc7fce4fd No spaces!
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402490
2008-09-06 07:23:04 +00:00
David Anderson f27202202b Fixed profiler being initialized at the wrong time, causing a paired callback mismatch (bug amb1977).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402489
2008-09-05 06:15:54 +00:00
Matt Woodrow deb7a123a6 Added a nominations section to maplists.cfg
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402488
2008-09-02 07:10:11 +00:00
Matt Woodrow 9ef7dca666 Added amb1978 - Core.cfg now has parameters to set the gamedata auto-updater server and port.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402487
2008-09-02 06:29:50 +00:00
David Anderson fe4e39a2dd Fixed amb1935 - When deleting a topmenu category, child objects were not removed from the name cache.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402485
2008-09-02 06:01:12 +00:00
David Anderson 4951dccded Fixed amb1927 - client command case sensitivity did not match the server's logic.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402483
2008-09-02 03:58:34 +00:00
Matt Woodrow 58870a30fb Fixed structs sig.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402481
2008-08-29 02:26:22 +00:00
David Anderson 05e18833ac Fixed IHandleSys doc for failure outparams.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402479
2008-08-28 17:18:26 +00:00
David Anderson 08c2a087d8 Fixed plugins not being unloadable from files not being closed (amb 1875).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402478
2008-08-28 16:59:41 +00:00
Matt Woodrow 05c8681336 Couple of small mapchooser tweaks
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402477
2008-08-27 01:45:10 +00:00
Matt Woodrow bf5ee181fa Removed a few debug messages from mapchooser
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402476
2008-08-27 01:00:01 +00:00
Matt Woodrow 094acb1039 Fixed amb1957 - Mapchooser now counts arena rounds correctly.
Fixed amb1925 - Mapchooser countly rounds incorrectly during an RTV
Fixed amb1920 - Cleared retry timer
Fixed amb1921 - Cancelling a vote now marks the vote as complete

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402475
2008-08-27 00:49:56 +00:00
Scott Ehlert 93944e7f4b Fixed build.
"Nice" improvement DS.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402474
2008-08-24 05:05:04 +00:00
Scott Ehlert 1251093ec1 Improved bot detection slightly. This was meant to go along with the fix for amb1801.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402473
2008-08-24 04:35:48 +00:00
David Anderson c951a6ca7c Reverted to old cmd functionality for original engine.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402469
2008-08-23 19:59:18 +00:00
David Anderson 70a594f354 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--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402468
2008-08-23 19:51:02 +00:00
David Anderson 9b03490b1a Fixed crash when TF2 extension couldn't load.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402467
2008-08-23 09:46:52 +00:00
David Anderson edb7b49c25 Fixed bogus warning from GCC.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402466
2008-08-23 09:29:27 +00:00
David Anderson 0c1c984eaf Add a poor man's build trigger.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402465
2008-08-23 08:02:44 +00:00
David Anderson b595047fdf Fixed OP_SWITCH accidentally using the wrong address to get the pcode base (regression based on assumption of JitWriter::inbase).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402464
2008-08-19 06:40:25 +00:00
David Anderson 2c25c09420 Ew! No spaces in filenames.
--HG--
rename : tools/gamedata md5/Makefile => tools/gamedata_md5/Makefile
rename : tools/gamedata md5/TextParsers.cpp => tools/gamedata_md5/TextParsers.cpp
rename : tools/gamedata md5/TextParsers.h => tools/gamedata_md5/TextParsers.h
rename : tools/gamedata md5/main.cpp => tools/gamedata_md5/main.cpp
rename : tools/gamedata md5/main.h => tools/gamedata_md5/main.h
rename : tools/gamedata md5/md5.cpp => tools/gamedata_md5/md5.cpp
rename : tools/gamedata md5/md5.h => tools/gamedata_md5/md5.h
rename : tools/gamedata md5/msvc9/gamedatamd5.sln => tools/gamedata_md5/msvc9/gamedatamd5.sln
rename : tools/gamedata md5/msvc9/gamedatamd5.vcproj => tools/gamedata_md5/msvc9/gamedatamd5.vcproj
rename : tools/gamedata md5/sm_memtable.cpp => tools/gamedata_md5/sm_memtable.cpp
rename : tools/gamedata md5/sm_memtable.h => tools/gamedata_md5/sm_memtable.h
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402463
2008-08-17 18:27:51 +00:00
David Anderson f6b088c2e6 Fixed amb1928 (EndOfMapVoteEnabled should be optional).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402462
2008-08-15 17:21:48 +00:00
David Anderson 1cf87d4ad9 Fixed build for new jit. Can't seem to kill off one of Microsoft's retarded NONSTDC warning, oh well.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402461
2008-08-15 05:41:20 +00:00
David Anderson 0aad4353cf Removed debug mode from plugin_settings.cfg.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402460
2008-08-15 05:33:57 +00:00
David Anderson 7875fe1acd Landed sourcepawn-1.2. The big changes:
1) JIT compilation/optimization now occurs per-function, and only when functions are first used.  We're now officially a whole-method JIT rather than an AOT compiler (albiet, still a simple JIT).  This has two implications: Functions are now much better abstracted internally, and loading a plugin is now much less expensive.  If a function contains calls to other functions, THOSE functions are only compiled when they're invoked as well.

2) I've removed debug mode.  We always show full backtraces now, as there was a very cheap way to implement this which really cleaned up everything.  This is great for a number of reasons -- there's less code, the JIT is better designed, we don't need to relocate debug tables, and best of all we no longer have to tell users to enable debug mode at their own expense.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402459
2008-08-15 05:22:26 +00:00
Matt Woodrow 95aca7b61b Fixed amb1924 - Nextmap command now checks if end of map voting is enabled
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402441
2008-08-10 05:39:25 +00:00
Matt Woodrow e52e3c4639 Initial Import of beta structs extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402440
2008-08-08 00:17:37 +00:00
Matt Woodrow eee77228e6 amb1919 - HasEndOfMapVote finished should be separate from determining if the vote will run at all.
amb1915 - Mapchooser should disable round end changes if forced to change early.
amb1901 - Timer errors with mapchooser

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402439
2008-08-08 00:06:14 +00:00
Matt Woodrow 2b0cc7b4ea Fixed amb1899 - Duplicate maps in auto generated maplists
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402438
2008-08-07 23:32:09 +00:00
Matt Woodrow eaccf6f90b Fixed amb1918 - Ban menu should compare userids, not client indexes
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402436
2008-08-07 23:16:16 +00:00
Matt Woodrow a01848c774 Increased Clientprefs error reporting and a rare leak on database connection failed.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402434
2008-08-05 08:00:54 +00:00
Matt Woodrow ea748cfdbd Fixed a few file handle leaks
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402432
2008-07-31 21:08:00 +00:00
Matt Woodrow 401c6b445d Fixed amb1891 : Basechat didn't check for blank message in private say's
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402431
2008-07-30 08:08:19 +00:00
Matt Woodrow 3c0b289694 Added custom gamedata section parsing to GameConfigs.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402429
2008-07-30 00:03:10 +00:00
Matt Woodrow 8182bdb476 More file handle leaks fixed.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402428
2008-07-29 06:12:52 +00:00
Matt Woodrow ae7e5a6a4b Pending Map should no longer be shown when mapvotes are disabled.
Removed tf2 include from mapchooser.
Moved sm_setnextmap to mapchooser and made it block the end of map vote.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402427
2008-07-28 07:47:28 +00:00
David Anderson 50eb77926e fixed amb1885: regression in IsInExec() which caused ThrowNativeError to fail
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402426
2008-07-27 06:29:58 +00:00
Matt Woodrow bd24893837 Probably helps to close files after opening them.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402425
2008-07-27 00:01:17 +00:00
Matt Woodrow dad66c9204 Nextmap command (basetriggers.sp) will now show 'Pending Vote' if mapchooser is running, and the vote has not yet occured.
Few cvar description changes in rockthevote.sp

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402423
2008-07-17 07:47:11 +00:00
David Anderson 9292e0f816 Fixed a bug where natives with no owner could be bound (crashing).
Fixed a bug where FakeNative entries were leaked.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402422
2008-07-16 03:46:10 +00:00
David Anderson 4d48fc7ae5 Fixed double-period showing on native failures.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402421
2008-07-16 03:37:37 +00:00
David Anderson 463cfb0015 fixed a crash-on-load bug in clientprefs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402420
2008-07-16 02:48:50 +00:00
Matt Woodrow 3ed5d1e8d7 Fixed build. I <3 you too gcc.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402419
2008-07-15 02:26:22 +00:00
Matt Woodrow e64e2534eb Fixed amb1810 - Clientprefs no longer blocks load.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402418
2008-07-15 00:24:08 +00:00
Matt Woodrow 67e28d7475 Moved nextmap command into basetriggers.sp
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402417
2008-07-13 07:01:54 +00:00
Matt Woodrow 64b8049d70 Fixed build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402416
2008-07-13 06:13:28 +00:00
Matt Woodrow dd75e88cbb Identities are now dropped before extensions unload.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402415
2008-07-13 05:36:52 +00:00
Matt Woodrow c75d607a00 - Added ForceChangeLevel and Map History to nextmap api
- Changed base plugins to use new api
- Added sm_maphistory command to nextmap.sp

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402413
2008-07-13 05:13:37 +00:00
David Anderson 8126aa6bb8 using 'goto' is now an error
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402412
2008-07-12 22:28:10 +00:00
Scott Ehlert 846caf1298 Builds against latest OB SDK now
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402410
2008-07-12 09:05:19 +00:00
Scott Ehlert c2917a8dd4 Fixed Windows build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402409
2008-07-12 04:08:41 +00:00
David Anderson 9e443cfdd3 fixed release build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402408
2008-07-12 03:30:00 +00:00
David Anderson b743af8a72 fixed cstrike build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402407
2008-07-12 03:19:55 +00:00
David Anderson 8a4c96b252 fixed build (I hope)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402404
2008-07-11 09:28:04 +00:00
David Anderson 0392e55ef7 fixed module version path
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402403
2008-07-11 09:27:03 +00:00
David Anderson fa5ee3287f fixed regressions in debug mode
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402402
2008-07-11 09:24:12 +00:00
Matt Woodrow e1882f97a1 Added amb1826 - 'nextmap' command now attempts to obey 'sm_trigger_show' if available.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402401
2008-07-11 08:31:57 +00:00
David Anderson 1a156deca5 landed massive refactoring of the JIT. contexts are actually contexts now, and a higher level structure wraps sp_plugin_t info. on that note, both sp_plugin_t and sp_context_t are entirely opaque, and not even core has access to them. amazingly, i managed to keep binary compatibility here although a large number of functions are deprecated (and core should eventually stop calling them).
NOTE: the JIT is now embeddable out-of-box and usable by other projects which is pretty cool.  I will commit a shell app demonstrating this soon

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402400
2008-07-11 08:18:43 +00:00
David Anderson 5668f23b50 fixed a compat regression, forgot msvc does funky things with overloaded virtual calls
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402399
2008-07-11 06:51:21 +00:00
David Anderson 232f344c41 FindPluginByContext works again
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402398
2008-07-11 05:15:43 +00:00
David Anderson 79cf4e07eb GetContext() now returns 'this' as a hack (shouldn't+can't be accessed anyway)
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402397
2008-07-11 05:14:32 +00:00
David Anderson f9b294d89e updated makefile to actually work
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402396
2008-07-10 05:42:10 +00:00
David Anderson a88d7c1cdc fixed a number of regressions, things are starting to load
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402395
2008-07-10 05:38:54 +00:00
David Anderson 85760603b7 fixed linux build
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402394
2008-07-10 03:38:04 +00:00
Matt Woodrow ea1f5e86c0 Gamedata fetcher now unlocks gamedata files after a successful query
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402393
2008-07-10 01:26:02 +00:00
Matt Woodrow b1072d3b09 Fixed amb1838 - Mapchooser should not instantly start a new vote if the current one was cancelled (and caused a stack overflow)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402392
2008-07-10 01:11:51 +00:00
Matt Woodrow 81632dda97 Fixed unload crash with tf2 extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402391
2008-07-09 02:03:13 +00:00
Matt Woodrow 80fdbcf8c7 Fixed regression in ForwardSys with ET_LowEvent
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402390
2008-07-08 23:55:29 +00:00
Scott Ehlert bd2361c8ae Bumped IForwardSys
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402388
2008-07-08 21:17:05 +00:00
Scott Ehlert c9a81c0651 - 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--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402386
2008-07-08 09:20:47 +00:00
David Anderson aa096f2385 fixed a few really dumb crash bugs in refac-jit
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402383
2008-07-08 07:59:33 +00:00
Matt Woodrow 53acb70260 Fixed build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402382
2008-07-07 23:12:21 +00:00
Matt Woodrow 6ef4c4b3ad Fixed amb1828 - Not killing timers properly
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402381
2008-07-07 22:17:55 +00:00
Matt Woodrow 4ac38946f2 Fixed amb1815 - Custom admin menu wasn't escaping input
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402380
2008-07-07 22:11:49 +00:00
David Anderson af54ae6af7 fixed some build issues. deprecated ISourceMod::GetScriptingVM
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402378
2008-07-07 06:33:42 +00:00
David Anderson 2c23544b29 amazingly, core now builds. it probably crashes horribly but i'll test tomorrow.
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402377
2008-07-07 06:25:15 +00:00
David Anderson 5351bbec71 more api for core
sets profiler+debugger now

--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402376
2008-07-07 06:24:54 +00:00
David Anderson 492c913aa9 added api calls needed by core
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402375
2008-07-07 05:28:42 +00:00
David Anderson 31dd23fbd9 committed public api changes (context and plugin are now private)
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402374
2008-07-07 04:58:49 +00:00
David Anderson 3f38171d8c refac-jit is almost done i think, next comes getting core compatible.
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402373
2008-07-07 04:56:29 +00:00
David Anderson 307adb34ab moved more files around
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402371
2008-07-06 05:04:38 +00:00
David Anderson 8a4af4d22f moved files around pre-emptively
--HG--
branch : refac-jit
rename : sourcepawn/jit/x86/msvc8/jit-x86.sln => sourcepawn/jit/msvc8/jit-x86.sln
rename : sourcepawn/jit/x86/msvc8/jit-x86.vcproj => sourcepawn/jit/msvc8/jit-x86.vcproj
rename : core/vm/sp_vm_basecontext.cpp => sourcepawn/jit/sp_vm_basecontext.cpp
rename : core/vm/sp_vm_basecontext.h => sourcepawn/jit/sp_vm_basecontext.h
rename : core/vm/sp_vm_engine.cpp => sourcepawn/jit/sp_vm_engine.cpp
rename : core/vm/sp_vm_engine.h => sourcepawn/jit/sp_vm_engine.h
rename : core/vm/sp_vm_function.cpp => sourcepawn/jit/sp_vm_function.cpp
rename : core/vm/sp_vm_function.h => sourcepawn/jit/sp_vm_function.h
rename : core/zlib/adler32.c => sourcepawn/jit/zlib/adler32.c
rename : core/zlib/compress.c => sourcepawn/jit/zlib/compress.c
rename : core/zlib/crc32.c => sourcepawn/jit/zlib/crc32.c
rename : core/zlib/crc32.h => sourcepawn/jit/zlib/crc32.h
rename : core/zlib/deflate.c => sourcepawn/jit/zlib/deflate.c
rename : core/zlib/deflate.h => sourcepawn/jit/zlib/deflate.h
rename : core/zlib/gzio.c => sourcepawn/jit/zlib/gzio.c
rename : core/zlib/infback.c => sourcepawn/jit/zlib/infback.c
rename : core/zlib/inffast.c => sourcepawn/jit/zlib/inffast.c
rename : core/zlib/inffast.h => sourcepawn/jit/zlib/inffast.h
rename : core/zlib/inffixed.h => sourcepawn/jit/zlib/inffixed.h
rename : core/zlib/inflate.c => sourcepawn/jit/zlib/inflate.c
rename : core/zlib/inflate.h => sourcepawn/jit/zlib/inflate.h
rename : core/zlib/inftrees.c => sourcepawn/jit/zlib/inftrees.c
rename : core/zlib/inftrees.h => sourcepawn/jit/zlib/inftrees.h
rename : core/zlib/trees.c => sourcepawn/jit/zlib/trees.c
rename : core/zlib/trees.h => sourcepawn/jit/zlib/trees.h
rename : core/zlib/uncompr.c => sourcepawn/jit/zlib/uncompr.c
rename : core/zlib/zconf.h => sourcepawn/jit/zlib/zconf.h
rename : core/zlib/zlib.h => sourcepawn/jit/zlib/zlib.h
rename : core/zlib/zutil.c => sourcepawn/jit/zlib/zutil.c
rename : core/zlib/zutil.h => sourcepawn/jit/zlib/zutil.h
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402370
2008-07-06 04:59:39 +00:00
David Anderson 2e7b6b5ba5 jit refactoring branch
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402369
2008-07-06 04:49:55 +00:00
David Anderson 9a02cb9dc8 synced dod:s gamedata changes from 1.0.3
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402368
2008-07-06 03:37:40 +00:00
David Anderson 43c085eea3 synced config changes from 1.0.3
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402367
2008-07-06 03:35:58 +00:00
Matt Woodrow 6a834ffef7 Fixed requiring dependencies at the wrong time.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402366
2008-07-06 03:30:06 +00:00
David Anderson 86c8ec847a fixed crazybuilds
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402365
2008-07-06 02:28:00 +00:00
David Anderson 2df2b791d8 amb1797 - reduced query staggering time from 500ms to 50ms
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402364
2008-07-06 00:51:05 +00:00
David Anderson 0e1ae4d85b fixed amb1808 - KickClient() is delayed and does not crash -- KickClientEx() is the old functionality
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402363
2008-07-06 00:45:26 +00:00
David Anderson 3d96f8f127 fixed amb1763 - clear function call status on a new call
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402361
2008-07-06 00:02:11 +00:00
David Anderson 2cc809be0c fixed amb1748 - timeleft was spammable from console
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402359
2008-07-05 23:02:27 +00:00
Matt Woodrow d2d2578314 Fixed more critical hit crashes when compiled on msvc8.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402358
2008-07-05 22:28:02 +00:00
Matt Woodrow 76b51aed07 Fixed trunk versioning properly this time.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402356
2008-07-05 09:23:55 +00:00
Borja Ferrer d0cbd943f1 fixed eyeangles helper not being freed
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402345
2008-07-05 00:15:18 +00:00
Matt Woodrow c67a3cd749 Nominations not blocking current map and excluded maps when used from console.
Removed error causing debug stuff from mapchooser.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402343
2008-07-04 22:54:14 +00:00
Borja Ferrer bf0354dbb9 fixed amb1801, IsFakeClient() wasn't working for TF2 causing false results and crashes
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402341
2008-07-04 19:04:33 +00:00
Matt Woodrow bc4f24e94d Temporarily added back version numbers to builds.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402339
2008-07-04 00:21:34 +00:00
Matt Woodrow 73203fb7b3 Removed unneeded dod:s beta scan script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402338
2008-07-03 08:54:58 +00:00
Matt Woodrow 89c49c3976 And again with the fixes
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402337
2008-07-03 07:30:50 +00:00
Matt Woodrow 89a56ac3e1 Output now shows params for overloaded functions
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402336
2008-07-03 06:52:28 +00:00
Matt Woodrow 3cc5bebfa9 Hopefully fixed trunk build.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402335
2008-07-03 06:26:28 +00:00
David Anderson f9cfe7e9da fixed regression in build tool
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402334
2008-07-03 04:32:30 +00:00
Matt Woodrow 5c58f8c97b Updated gamedata files now that dod:s is no longer in beta.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402332
2008-07-03 02:35:35 +00:00
Matt Woodrow bb9f31e555 Changed dod script to support dod:s no longer being beta
--HG--
rename : tools/Vtable scanner/dodsbetascan.sh => tools/Vtable scanner/dodscan.sh
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402331
2008-07-03 02:30:59 +00:00
Matt Woodrow ce57617744 Gamedata query no longer detects a failed query as a crash.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402330
2008-07-02 02:57:08 +00:00
Matt Woodrow 77a7bf385b Added a vtable scan script for dod:s beta
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402329
2008-07-02 01:34:46 +00:00
Matt Woodrow 52d2a1797d A null check that lets the program keep running is somewhat pointless.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402328
2008-07-01 23:44:33 +00:00
Matt Woodrow 111a3a7169 Added a null check on the vtable symbol
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402327
2008-07-01 23:42:19 +00:00
Matt Woodrow a513a2a6f8 And the most important piece: Import of experimental gamedata autoupdater. Also new debug command "sm_gamedata_md5 <filename>"
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402323
2008-07-01 09:48:17 +00:00
Matt Woodrow f3f46fc126 Minor fix to the filename reading logic. Almost done!
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402322
2008-07-01 09:38:20 +00:00
Matt Woodrow 3cff457c6d More changes to support the shell script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402321
2008-07-01 09:29:02 +00:00
Matt Woodrow 853b080aa4 Updated shell script to remove windows line endings
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402320
2008-07-01 09:24:22 +00:00
Matt Woodrow 261023800e Updated gamedatamd5 to print the md5 in a more usable format and added shell script (thanks wowsawce!) for updating gamedata files.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402319
2008-07-01 09:13:27 +00:00
Matt Woodrow 7314d81947 Forgot SM doesn't use the new sdk yet
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402318
2008-07-01 09:10:21 +00:00
Matt Woodrow d530d0c726 Big critical hits cleanup. Cleaner, easier to maintain, uses less memory and should be much less likely to cause crashes when valve change things on me.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402317
2008-07-01 09:04:00 +00:00
David Anderson b01dd0798c clientprefs now uses the new dbi dependency shim
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402316
2008-07-01 06:13:09 +00:00
David Anderson 968045ae62 - Interface dropping semantics are now changed, any pointer can be piped through.
- IDBDriver lets you bind driver dependencies and cleanly shutdown now

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402315
2008-07-01 06:12:16 +00:00
Matt Woodrow 4106620928 New mapchooser, rockthevote and nominations plugins finally ready. Removed the existing mapmanager stuff.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402313
2008-07-01 01:18:52 +00:00
Matt Woodrow ac9b9f8c2a Removed DEBUG from admin-sql-threaded.sp (amb1780)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402312
2008-06-30 23:18:26 +00:00
Matt Woodrow cdf54a3db1 Fixed mem leak in clientprefs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402310
2008-06-30 23:07:54 +00:00
Scott Ehlert 8a5d833c89 Updated DOD:S Beta offsets
Added FireOutput support for DOD:S (amb1749)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402309
2008-06-30 05:43:31 +00:00
Matt Woodrow 57bba6d83f Import of gamedata daemon. I love imported stuff.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402304
2008-06-30 02:34:21 +00:00
Matt Woodrow 2c08bb3a96 FORGOTTEN QUOTE
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402303
2008-06-30 02:11:58 +00:00
Matt Woodrow 6d4938f6b5 Removed cruft.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402302
2008-06-30 02:04:30 +00:00
Matt Woodrow 7104e187cc Import of Vtable scanner
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402301
2008-06-30 02:03:56 +00:00
Matt Woodrow 2fc7a017e1 Import of GameData MD5 hashing app.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402298
2008-06-29 22:23:14 +00:00
Matt Woodrow e0a69507a0 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--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402295
2008-06-29 05:04:41 +00:00
Matt Woodrow 29de57d415 Fixed an uninitialised string causing weird results.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402292
2008-06-29 03:27:15 +00:00
Matt Woodrow 42359a243a Entity Outputs now fail silently if the mod is not supported.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402282
2008-06-26 08:07:47 +00:00
Matt Woodrow 81e40c32c8 Slight change to the vtable dump because it wasn't working all the time.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402271
2008-06-21 09:28:42 +00:00
David Anderson 350044c9a8 changelog for 1.0.3
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402266
2008-06-21 08:18:12 +00:00
Matt Woodrow bc1bb2cba2 Fixed ForcePlayerSuicide.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402263
2008-06-20 23:35:00 +00:00
David Anderson 6079c927ad fixed amb1765 - GiveNamedItem was supported even though it didn't work
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402260
2008-06-20 03:58:36 +00:00
Matt Woodrow 42f61acc45 Fixed gamedata files for the pyro update
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402257
2008-06-19 23:42:08 +00:00
Matt Woodrow bc8c9ba691 Should fix amb1756 - Invalid access on TraceRay handles.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402256
2008-06-19 03:13:57 +00:00
David Anderson 6e59d8ae5c updated licenses
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402255
2008-06-13 07:26:09 +00:00
David Anderson 749177d0b3 updated license
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402254
2008-06-13 07:24:43 +00:00
Scott Ehlert 4a32aff158 Fixed regression (introduced by revision 2242 aka Phase 0) where 'sm plugins list' displayed all plugins as having an id of 1
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402253
2008-06-11 08:28:34 +00:00
Scott Ehlert ac68a441ee All natives that use a recipient filter now actually validate the clients passed to them.
This includes StartMessage(), StartMessageEx() from Core as well as EmitSound(), EmitSentence(), and TE_Send() from SDKTools

(Warning: This may potentially cause a minor compatibility problem with plugins that don't check client validity before passing to these natives)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402252
2008-06-11 08:07:17 +00:00
Matt Woodrow 119592eefe Fixed typo in banning.inc
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402251
2008-06-09 22:17:09 +00:00
Matt Woodrow 72a1fb06d0 I'm sure i'll get this right eventually.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402250
2008-06-09 07:24:24 +00:00
Matt Woodrow 8a7ced18de Second attempt at fixing SetUserInfo (try committing the right file this time)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402249
2008-06-09 07:21:26 +00:00
Matt Woodrow 06c8f3a093 Fixed SetUserInfo to work on bots
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402248
2008-06-09 07:18:49 +00:00
Matt Woodrow 22aa6561b5 Added SetUserInfo command to sdktools.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402247
2008-06-09 07:12:32 +00:00
Scott Ehlert 9ac54e5fb2 Fixed rare crash in event manager when a null IGameEvent pointer was passed to the IGameEventManager2::FireEvent() hooks
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402245
2008-06-06 04:55:27 +00:00
David Anderson 2c94b1268a phase0, new versioning. we don't use build numbers anymore except (VS_VERSIONINFO stays until phase 3 is done)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402242
2008-06-02 05:03:27 +00:00
Matt Woodrow 46ce91c4f7 Fixed amb1735 - Client Prefs create table queries typo
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402241
2008-06-01 22:31:58 +00:00
Matt Woodrow 953da3f6e0 Fixed amb1734 - Escape characters are now enabled for the custom admin menu config.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402240
2008-06-01 22:24:11 +00:00
Scott Ehlert 076b5191c9 Removed TF2_GivePlayerWeapon() and TF2_EquipPlayerClassWeapons() stocks as they no longer work at all
The 'weapons' paramater in the TF2_SetPlayerClass() class is now ignored since it no longer works

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402237
2008-05-31 22:33:17 +00:00
David Anderson 20d12fad9f added links to the doc in the adminmenu configs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402230
2008-05-31 19:01:46 +00:00
David Anderson b18bd78c51 fixed build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402229
2008-05-31 09:27:33 +00:00
David Anderson c3492f0192 removed dynamicmenu folder -- everything is consistent now
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402226
2008-05-31 07:57:33 +00:00
Scott Ehlert d595e020cd Added #pragma deprecated to GetEntDataEnt() and SetEntDataEnt()
(these were already considered deprecated, but now the compiler will officially complain about them)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402225
2008-05-30 22:42:30 +00:00
Scott Ehlert 5b4f98b354 Fixed amb1727 - TF2_Disguise and TF2_RemoveDisguise had incorrect signatures
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402223
2008-05-30 22:38:04 +00:00
David Anderson 6e2ac7376e updated changelog (i should have done these two in one commit)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402222
2008-05-29 05:40:51 +00:00
David Anderson 1a86604d99 fixed amb1686 - ReplaceString or ReplaceStringEx with an empty search string would crash. it now throws an error instead.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402220
2008-05-29 05:39:29 +00:00
David Anderson 049f63e6fd added 1.0.2 preliminary changelog
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402219
2008-05-29 05:01:50 +00:00
David Anderson 3aea76cfb3 insignificant changes from branch
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402218
2008-05-29 04:50:59 +00:00
David Anderson 3b4c800baa (merging from branch) fixed amb1583 - MySQL string fetch from prepared queries returned corrupted data.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402217
2008-05-29 04:47:42 +00:00
David Anderson ca9b2784bd extensions now use the repository build number intsead of their local commit number
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402204
2008-05-29 03:19:55 +00:00
Scott Ehlert df83dbc04e Fixed Windows trunk build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402202
2008-05-28 04:28:04 +00:00
David Anderson 81af704f58 added amb1715 - tracehull
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402201
2008-05-28 03:04:28 +00:00
David Anderson 627e4fd115 committed two forgotten files and updated the linux makefile
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402200
2008-05-26 07:52:27 +00:00
Matt Woodrow 044ee841f2 Fixed amb1690 - Client prefs tables now create themselves.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402199
2008-05-26 07:51:36 +00:00
David Anderson c93d05f622 rewrite of the native and dependency binding/interaction code. this will ease the transition for native overrides, and greatly simplifies most of the logic. all native binding code now takes place almost entirely in ShareSys, and PluginSys supplements this logic where appropriate. extensionsys has been cleaned up
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402198
2008-05-26 07:51:11 +00:00
David Anderson c824afc61e oh
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402197
2008-05-26 07:48:26 +00:00
David Anderson 3d015908d9 deleted msvc9 files
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402196
2008-05-26 01:50:48 +00:00
Matt Woodrow bff2b0a95d Added amb1665 and amb1381 - Added other map limits to 'timeleft' and handling of timeleft/nextmap console commands.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402195
2008-05-26 01:09:10 +00:00
Matt Woodrow c9b320d645 Fixed amb1713 - The tiniest of tiny mixups in description orders.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402194
2008-05-25 20:50:11 +00:00
Matt Woodrow 29ee014a94 Quick build fix until my mapchooser changes are completed.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402192
2008-05-25 20:25:59 +00:00
Scott Ehlert aa73e41f29 Fixed CrazyDebug not working with Episode One games
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402191
2008-05-25 12:46:03 +00:00
Matt Woodrow 0a829027eb Fixed amb1663 - Dynamic Menu didn't use the ExitBack functionality
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402189
2008-05-25 07:54:30 +00:00
Matt Woodrow 9c7249a1e9 Fixed amb1709 - Dynamic Menu selections not resetting on exit
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402187
2008-05-25 07:44:58 +00:00
Matt Woodrow d9357d5224 Fixed amb1454 - Nextmap broken on mods that use the scores usermsg differently to CS:S
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402185
2008-05-25 07:11:16 +00:00
Matt Woodrow 73a20de2ff Added server check to clientprefs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402184
2008-05-25 03:26:31 +00:00
Matt Woodrow 8cd8228251 Fixed amb1358 - Timeleft not reseting on TF2 restarts
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402183
2008-05-25 02:07:52 +00:00
David Anderson 02faa8fbd6 looks like valve is trying to degrade radio menus to deprecate them. thanks guys, quality!
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402180
2008-05-24 09:57:40 +00:00
David Anderson 79485eef38 fixed amb1684 - regression in password handling
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402179
2008-05-24 09:17:35 +00:00
David Anderson b2d25f2a77 added quick tool for fetching dlls of mdmps
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402177
2008-05-24 06:48:35 +00:00
Scott Ehlert e794883b1f Added support for recent Day of Defeat Beta
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402175
2008-05-24 06:06:13 +00:00
David Anderson 2a11739e86 added amb1694 - FindCharInString()
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402174
2008-05-24 05:02:35 +00:00
Matt Woodrow dea6b06e2c Added a load-block for incorrect mods to TF2 and cstrike extensions.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402173
2008-05-24 04:08:29 +00:00
David Anderson 13cf254f08 how did i forget to commit this? sm_revote
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402171
2008-05-24 03:04:10 +00:00
Matt Woodrow 531c359fb9 Updated crit hit offsets.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402170
2008-05-21 23:45:18 +00:00
David Anderson 9550e55160 added a changelog
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402169
2008-05-21 05:43:44 +00:00
David Anderson 40e0857a29 added a forward that helps prevent against race conditions in map config plugins
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402162
2008-05-21 02:12:12 +00:00
Scott Ehlert 47fa9d9464 Fixed amb1688 - Linux GivePlayerItem/GiveNamedItem offset for Day of Defeat was incorrect
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402161
2008-05-20 09:45:13 +00:00
David Anderson d827c0fd2d added amb1685 - GetTickInterval()
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402158
2008-05-20 05:39:37 +00:00
Matt Woodrow c16afc9cd3 Fixed amb1687 - Infinite loop in Entity Outputs
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402157
2008-05-20 02:51:02 +00:00
David Anderson a18b1e0790 fixed a bug where if a plugin errored during the instantiation process, then its index could be reported as -1 from debug messages
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402156
2008-05-20 02:30:55 +00:00
David Anderson 80b2ea646a fixed a delayed unload crash in sdktools
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402155
2008-05-20 02:24:42 +00:00
Matt Woodrow f7613f80f1 Fixed Crit hits sigs for Windows and cleaned up the code somewhat
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402154
2008-05-18 00:51:51 +00:00
David Anderson b90386276f fixed wrong re-use of variable
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402153
2008-05-17 18:14:34 +00:00
David Anderson 8ad5d61878 added a new ia32 macro for the mov eax opcode
cleaned up a bit of the crit hook code

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402152
2008-05-17 08:30:17 +00:00
David Anderson b2fbd9691d added amb1119 - sm_revote command
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402151
2008-05-17 05:12:52 +00:00
David Anderson 0fac3fd74e fixed a bug in the new translation code usage
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402150
2008-05-17 05:10:36 +00:00
David Anderson 3342a84cf4 fixed amb1646 - implemented NetFlow_Both functionality
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402149
2008-05-15 05:52:30 +00:00
Matt Woodrow 21359ea17e Fixed amb1657 - Server should see admin version of sm_who
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402148
2008-05-14 22:40:36 +00:00
David Anderson a7cc2609e1 added amb1448 - duplicate admins are now combined rather than excluded
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402145
2008-05-14 05:31:14 +00:00
Scott Ehlert 9023afff0d Trunk build fixes
Fixed up IGameHelpers.h such that it no longer requires HL2SDK headers if a function doesn't need them

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402144
2008-05-13 08:22:49 +00:00
Matt Woodrow f388b0612b Build fix attempt
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402142
2008-05-12 09:18:50 +00:00
Matt Woodrow c7dbacc134 Quick renaming
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402141
2008-05-12 08:56:24 +00:00
Matt Woodrow d88ba02fde CLIENT PREFS ARE GO!!1!shiftone!!1!
Fully implemented amb734 - Including console interface and menu for clients to use.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402140
2008-05-12 08:06:47 +00:00
Scott Ehlert 6e91780e73 Err, fixed Linux build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402139
2008-05-12 02:05:57 +00:00
Scott Ehlert 77ff2c40bd Symbols no longer stripped on Linux for easier debugging
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402137
2008-05-11 07:49:30 +00:00
David Anderson aee95b6c74 bug fix, optimization
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402135
2008-05-10 19:21:11 +00:00
David Anderson f1ef53cdff implemented amb1613 - p2p voice filters now work
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402134
2008-05-10 19:17:21 +00:00
David Anderson 9a7c884c21 fixed linux build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402133
2008-05-10 09:30:13 +00:00
David Anderson c7418e70ba added amb1666 - rehaul over the ml api so extensions can easily use translations
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402132
2008-05-10 09:23:55 +00:00
Scott Ehlert 1e70b04f48 Removed odd debug code, err, in CrazyDebug of all places
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402131
2008-05-09 08:22:39 +00:00
Scott Ehlert 1adb549a8d CrazyDebug just got crazier!
1) Now works with SrcDS -console + DEP on Windows
2) Updated vcproj files for OB, Episode 1, etc

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402129
2008-05-09 08:04:27 +00:00
Matt Woodrow 35eb2f2ce5 A sad response to amb1655 - TF2_SetPlayerInvuln is broken and now removed.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402127
2008-05-08 23:43:02 +00:00
Borja Ferrer 2030ef9114 removed these functions in tf2 for now to avoid more crashes
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402125
2008-05-04 15:52:34 +00:00
Scott Ehlert c5330c73b7 Attempted fix for amb1648 - stack corruption when GetClientEyeAngles() is called on Windows
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402124
2008-05-02 07:47:38 +00:00
Matt Woodrow 7a968cb33c Re-added the msvc8 folder that I broke.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402122
2008-05-02 01:31:15 +00:00
Matt Woodrow a2aa6b0daf Added msvc9 Project files to sdktools. Badly.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402121
2008-05-01 23:48:27 +00:00
Matt Woodrow 8df36003a8 Updated TF2 Extension to fix critical hits.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402119
2008-05-01 07:29:46 +00:00
Matt Woodrow f226e6d70b Missing ! in sample_ext
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402115
2008-05-01 02:43:32 +00:00
Matt Woodrow 394424c52f Moved mapchooser tf2 fix into trunk
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402112
2008-05-01 02:39:35 +00:00
Scott Ehlert 5c6a2868d9 Updated TF2 virtual offsets for goldrush/medic update
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402109
2008-04-30 04:15:09 +00:00
David Anderson 62047b6d0d fixed amb1645 - command help typo
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402107
2008-04-29 15:14:50 +00:00
Borja Ferrer 5e721623a0 fixed a math mistake
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402104
2008-04-27 19:41:51 +00:00
Matt Woodrow 90b739ae48 I love you gcc.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402102
2008-04-25 06:05:35 +00:00
Matt Woodrow 7262dd5e79 TF2 Round count mapchooser fix.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402100
2008-04-25 05:26:39 +00:00
Matt Woodrow f41aefc525 Cleaned up a few sdktools files.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402097
2008-04-25 05:20:17 +00:00
Matt Woodrow 0c22ab3972 Trying to upgrade clientprefs to msvc9 - Part 2
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402096
2008-04-25 00:08:27 +00:00
Matt Woodrow 221e7d48a7 Trying to upgrade clientprefs to msvc9 - Part 1
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402095
2008-04-24 23:27:50 +00:00
Scott Ehlert 21c0466b3d Added any tag to ADT array functions to fix potential tag mismatches
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402094
2008-04-24 10:25:44 +00:00
Matt Woodrow 47f8d0eef5 Added amb1623 - More reserved slots kick types.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402092
2008-04-22 22:50:27 +00:00
Matt Woodrow d0286c1391 Fixed amb1634 - GetPlayerResourceData incorrectly memorising offsets.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402091
2008-04-22 22:05:03 +00:00
David Anderson eac0e274a6 amb1597 - renamed legacy translation files
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402089
2008-04-22 00:44:14 +00:00
Matt Woodrow af05dbbcdf Incparser upgrades.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402088
2008-04-21 21:41:38 +00:00
Matt Woodrow ac256a6c24 Bail's pedantic parser made me do it.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402087
2008-04-19 10:35:24 +00:00
Matt Woodrow 0771411eac Fixed linux build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402085
2008-04-19 04:14:47 +00:00
Matt Woodrow e6de7c0c2d Fixed amb1607 - TF2 extension critical hit crashes.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402083
2008-04-19 03:41:14 +00:00
David Anderson 8d021c6caf fixed some doc inconsistencies on ProcessTargetString
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402081
2008-04-19 00:44:28 +00:00
Scott Ehlert 9487f9d631 Updated NOTICE.txt to describe how to add svn:keywords to existing files
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402079
2008-04-17 10:00:52 +00:00
Scott Ehlert 678cb82ec0 Gah, finalized the revised ILibrarySys::GetFileExtension() code
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402078
2008-04-17 09:28:46 +00:00
Scott Ehlert c4c8948d95 Oops. Fixed ILibrarySys::GetFileExtension() to work properly on Windows again.
(Had accidentally copied revised version from my Linux-only propcheck program)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402075
2008-04-17 09:23:18 +00:00
Scott Ehlert 1e1f0de4ec Rewrote ILibrarySys::GetFileExtension() to fix the following issues:
- Crash when NULL was passed
- Crash when blank string '\0' was passed
- Incorrect result returned when file name began with a period. These files are now considered to not have any extension.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402074
2008-04-17 09:19:36 +00:00
Matt Woodrow 84bde330cd Fixed build.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402073
2008-04-17 06:08:18 +00:00
Matt Woodrow e63a5cd3dc Initial import of amb734 - Client preferences extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402072
2008-04-17 04:58:09 +00:00
Matt Woodrow 6c38c9264e Added Active support for TF2
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402071
2008-04-17 02:46:31 +00:00
David Anderson 946834b868 added amb1620 - ActivateEntity
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402068
2008-04-16 23:29:03 +00:00
Matt Woodrow 726aa68be9 added amb1181 - New reserve slot type
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402067
2008-04-16 07:35:52 +00:00
Matt Woodrow 16bdac4635 Added amb1609 - Persistant option to TF2_SetPlayerClass
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402066
2008-04-16 05:41:34 +00:00
David Anderson d014010a99 added amb1610 - StripQuotes()
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402063
2008-04-16 05:27:09 +00:00
David Anderson 07915461e9 fixed typo
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402062
2008-04-16 05:04:33 +00:00
David Anderson e24f15e7df fixed amb1615 (typo)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402061
2008-04-14 14:15:44 +00:00
Matt Woodrow 90d4fed4a9 Fixed minor player selection bug in tf2 extension
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402059
2008-04-14 03:13:15 +00:00
David Anderson 101d2359de fixed a gcc whine
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402057
2008-04-13 06:08:47 +00:00
David Anderson 046ce18e8b added amb1538 - adt_stack
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402056
2008-04-13 06:06:27 +00:00
David Anderson 883e77bc60 fixed crash bug (regression) when extensions failed to load
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402055
2008-04-13 04:00:44 +00:00
Borja Ferrer 6d2a3a7964 fixed amb1586 for real
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402052
2008-04-12 23:03:30 +00:00
David Anderson 2fbd32cd1a fixed amb1591 - mods like IOS:S which, in listen server mode add bots before the player, caused crashes in SM
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402050
2008-04-12 02:18:03 +00:00
Borja Ferrer 800838d76a fixed build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402048
2008-04-12 02:11:16 +00:00
Borja Ferrer 93b2edde8c forgot to commit this
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402046
2008-04-12 01:58:07 +00:00
Borja Ferrer a483ec5dc5 experimental fix for amb1586 - team native crash
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402044
2008-04-12 01:35:45 +00:00
David Anderson c42a26bb66 fixed crash bug on shutdown
removed implementations from header

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402043
2008-04-12 01:33:55 +00:00
Matt Woodrow 75a77c1925 Fixed amb1611 - Spy knife critical detour reading from wrong gamedata key
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402041
2008-04-12 00:58:34 +00:00
Scott Ehlert c473d75d3d Added more missing svn:keywords properties to some files (this should be the last of them before I never have to do this again)
Moved sm_memtable files in sqlite extension to sdk directory (to be consistent with topmenus)
Some extension source files had an incorrect extension name in their headers

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402037
2008-04-11 17:16:36 +00:00
Matt Woodrow 0c5e4b5a2f Fixed amb1601 - Wrong ConVar handle in vote FF menu
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402036
2008-04-11 08:04:11 +00:00
Matt Woodrow dcb9efa131 Fixed amb1594 - SetPlayerClass issues with spawning
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402034
2008-04-11 07:58:06 +00:00
Scott Ehlert 70301419b1 Added svn:keywords property to some files that didn't have them already
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402030
2008-04-10 19:28:26 +00:00
Borja Ferrer ad37496d34 just some cleaning
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402029
2008-04-10 19:25:50 +00:00
David Anderson 472e9969d9 added util.cpp to makefile
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402027
2008-04-10 18:44:15 +00:00
Scott Ehlert e1aba62c15 added debug out for fopen failure - really
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402026
2008-04-10 18:14:30 +00:00
David Anderson 3a061aa38d added dynamicmenu to packager
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402025
2008-04-10 17:21:32 +00:00
David Anderson d5f5239eeb added debug output for fopen failure
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402023
2008-04-10 17:16:21 +00:00
Matt Woodrow 8ba1d5e333 Forgot a semicolon
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402021
2008-04-10 05:22:51 +00:00
David Anderson e618900688 new macros actually work now
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402019
2008-04-10 05:21:27 +00:00
Matt Woodrow ec69b34cbb Added Critical Hit hook to TF2 extension
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402016
2008-04-10 04:49:17 +00:00
David Anderson 430a860927 added amb1558 - __BINARY_PATH__ and __BINARY_FILE__
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402015
2008-04-10 00:10:45 +00:00
Scott Ehlert f08ce7f62f Oh god, Spring Cleaning Part San (3) - Finaare
- Removed batsupport extension
 - Made EVERY makefile consistent with the changes originally made to the sample extensions's makefile
 - Sample MM:S extension now uses unified makefile
 - Various innumerable changes to VS project files

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402012
2008-04-09 09:10:28 +00:00
David Anderson 13e8cf9ed8 reverted compiler change that didn't work out so well
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402011
2008-04-09 05:59:21 +00:00
David Anderson 53d11eae63 fix for amb1594 part 1 - missing semicolons
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402009
2008-04-08 23:42:17 +00:00
David Anderson 72b6510e61 fix for amb1595
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402007
2008-04-08 23:35:58 +00:00
David Anderson ea189849de fixed amb1590 - tf2 didn't autoload
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402004
2008-04-06 17:54:53 +00:00
David Anderson 8a2c175420 addressed amb1585 - url wasn't canonical
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402001
2008-04-06 17:21:13 +00:00
David Anderson 544ed79284 fixed typo in the tf version files
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401999
2008-04-06 08:20:22 +00:00
David Anderson 222b543adb added regex versioning to windows
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401998
2008-04-06 08:20:02 +00:00
David Anderson 2bec3aaa49 added versioning to regex (linux only)
added regex/tf to version markup list
bumped all svn_versions to 1.1

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401997
2008-04-06 08:13:30 +00:00
David Anderson 50c50a8f6c build tool now has regex+tf2 extensions
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401995
2008-04-06 07:49:50 +00:00
David Anderson f0f44687b6 fixed linux build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401994
2008-04-06 07:37:03 +00:00
David Anderson f295c6f4fd new makefile
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401993
2008-04-06 07:13:00 +00:00
David Anderson b455ac4f4e merged changes back from 1.0.1
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401992
2008-04-06 06:56:45 +00:00
Matt Woodrow 3d349378ad Forgot license headers for the tf2 include files.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401988
2008-04-05 00:06:27 +00:00
Matt Woodrow b865f96886 Added amb1186 - TF2 Extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401987
2008-04-04 22:37:14 +00:00
Matt Woodrow 10bd6c298e Fixed amb1579 bug in entity outputs and added hl2mp to the supported games.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401982
2008-04-03 23:57:54 +00:00
Scott Ehlert 4d3d51b5dd Fixed amb1577 - CreateConVar return documentation was incorrect
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401980
2008-04-02 17:43:58 +00:00
Matt Woodrow 51d5f79f1e Changed UnHook -> Unhook for entity output natives.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401979
2008-04-02 01:58:45 +00:00
Matt Woodrow 9b4bdd05b5 Removed a stray debug message from entity outputs.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401978
2008-04-02 01:46:20 +00:00
Matt Woodrow a0b05dc624 Added amb1528 - Entity Output Hooking.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401977
2008-04-02 01:22:02 +00:00
Scott Ehlert 79fb305722 Spring Cleaning, Part Ni (2)
- Renamed output file in regex extension project file from sample.ext.dll to regex.ext.dll
- Revampled sample extension Makefile. It is now possible to build an extension that doesn't require the use of Metamod using it.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401976
2008-04-01 04:22:47 +00:00
Matt Woodrow fbe46934a4 Added EquipPlayerWeapon to SDKTools. Offsets for CS:S and TF2 added.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401975
2008-04-01 00:51:21 +00:00
Matt Woodrow b9bd1b1037 How the hell did that get there.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401974
2008-04-01 00:06:08 +00:00
Matt Woodrow b9aac380d4 Added sm_dump_datamaps server command.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401973
2008-03-31 23:13:31 +00:00
Matt Woodrow 127c89de4e Big changes to dynamic menu. Removed constant kv tracking. Tested everything.
Import of config files.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401972
2008-03-31 22:44:18 +00:00
Scott Ehlert 251cced1f8 Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401971
2008-03-30 07:00:22 +00:00
Scott Ehlert 02931c94cf Changed env var used in include paths: SOURCEMM -> SORCEMM16
Removed some unneccessary build configuartations in some project files

--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401970
2008-03-28 06:21:34 +00:00
Scott Ehlert 3a14544385 Changed env var used in include paths: SOURCEMM -> SORCEMM16
Changed env var used in include paths: SOURCEMM142 -> SORCEMM14
Removed some unneccessary build configuartations in some project files

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401969
2008-03-28 06:18:26 +00:00
Scott Ehlert 33b2847ec3 Added scripting/adminmenu directory to build tool
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401968
2008-03-28 04:51:53 +00:00
Scott Ehlert a3d5a0151d Err, these got added accidentally apparently. Thanks a lot TSVN.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401965
2008-03-27 05:02:00 +00:00
Scott Ehlert 97c26eee3c Updated copyright year
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401964
2008-03-27 04:54:56 +00:00
Scott Ehlert cc3c16c079 Changed the environment variable used in the include paths from SOURCEMM -> SOURCEMM16
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401961
2008-03-27 04:00:57 +00:00
David Anderson c5af41d983 merged branch-1.1.0 back into trunk
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401960
2008-03-26 03:52:37 +00:00
Scott Ehlert 3bcd296d99 Merged crash fix (amb1539) from 1.0.1 branch
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401958
2008-03-21 04:26:53 +00:00
Scott Ehlert 83a1ebcf0f Removed debug code?
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401954
2008-03-20 19:52:30 +00:00
David Anderson 8ba6d5cbba bumped trunk version
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401953
2008-03-17 15:30:39 +00:00
David Anderson bb85c5eda2 -branch, implemented "goto"
-branch, added a new jit opcode -- 165/op.stackadjust(1), stk = frm+n

--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401937
2008-03-13 17:08:05 +00:00
David Anderson a64894bbe4 updated to trunk code
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401936
2008-03-13 17:04:25 +00:00
Matt Woodrow 50760d853f Cleaned up a few things in regex extension and updated project files to build on both engines. Linux makefiles probably still won't work.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401925
2008-03-04 23:18:16 +00:00
Matt Woodrow 62b08e923c Import of some basic tf2 stuff. Needs debugging properly.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401855
2008-01-17 00:31:58 +00:00
Matt Woodrow 2f41af814e Initial import of regex extension
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401848
2008-01-10 22:01:36 +00:00
Matt Woodrow d28eca4bb3 Increased max length for list items
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401831
2007-12-28 02:41:52 +00:00
Matt Woodrow 306be48027 Fixed dynamic menu reading userid2 as userid
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401830
2007-12-26 02:41:04 +00:00
Matt Woodrow 4ad308897f Few dynamic menu bug fixes.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401829
2007-12-26 01:16:38 +00:00
Michael McKoy f6b6dff4c0 Don't even bother trying to compile these, it's not finished. Just committing for archiving purposes, this is not intended for 1.0 release.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401813
2007-12-19 22:19:34 +00:00
Matt Woodrow 3ba7c63862 Initial import of dynamic menu code (amb1039)
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401788
2007-12-10 21:02:00 +00:00
David Anderson 20112fe6cc skeleton tf2 extension for ferret
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401722
2007-11-23 05:27:58 +00:00
David Anderson 3f49d29274 merged trunk back into 1.1.0 branch for "safety"
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401721
2007-11-23 05:10:33 +00:00
David Anderson 0601988e80 branched trunk to 1.1.0
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401681
2007-11-11 20:59:20 +00:00
David Anderson 9eb41bc475 removed local branch
--HG--
branch : dvander
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/dvander%4027
2006-07-15 05:11:30 +00:00
Borja Ferrer 7cd5c96087 identaAaAtion
--HG--
branch : faluco
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/faluco%4017
2006-07-15 01:36:48 +00:00
791 changed files with 68777 additions and 14077 deletions
+15
View File
@@ -0,0 +1,15 @@
# Binaries
\.dll$
\.exe$
\.so$
# Files generated by Visual Studio
\.aps$
\.ncb$
\.suo$
\.user$
# Build directories
/CrazyDebug.*
/Debug.*
/Release.*
+1
View File
@@ -0,0 +1 @@
54539fa4e51f98d7841c853c1370dff6ccd3cdf2 sourcemod-1.0.0
+3 -18
View File
@@ -1,21 +1,6 @@
We now use svn:keywords "Id" on all .c/.cpp/.h/.sp/.inc files. Please make sure your client is configured properly.
WINDOWS:
Open your Application Data folder.
Windows XP/2000: C:\Documents and Settings\<user>\Application Data
Windows Vista: C:\Users\<user>\AppData\Roaming
CONFIGURE YOUR IDENTITY FOR MERCURIAL!
IF YOU ARE A DEVELOPER WITH PUSH ACCESS, DO IT NOW KPLZTHX.
Now go to Subversion. Open the "config" file with a text editor.
http://wiki.alliedmods.net/Mercurial_Tutorial#Identity
LINUX:
Open ~/.subversion/config with your favorite text editor.
Under [miscellany], uncomment this line:
# enable-auto-props = yes
Under [auto-props], add these lines:
*.c = svn:keywords=Id
*.cpp = svn:keywords=Id
*.h = svn:keywords=Id
*.sp = svn:keywords=Id
*.inc = svn:keywords=Id
+151
View File
@@ -0,0 +1,151 @@
SourceMod Changelog
----------------------------
SourceMod 1.1.0 [2008-12-28]
URL: http://wiki.alliedmods.net/SourceMod_1.1.0_Release_Notes
Major features:
* New map management plugins.
* New reserved slot type.
* GameData updates are retrieved remotely
* Client Preferences extension for per-client "cookies"
* New incremental and independent JIT
Changes:
- Added new client preferences extension (API in clientprefs.inc, bug 1925).
- Added new gamedata auto-update functionality (bug 2602).
- Revamped and greatly expanded map management plugins and their functionality (bug 2201).
- Debug mode is now always on; as there is no longer a performance loss, there is no non-debug mode.
- The timeleft trigger can now handle mp_winlimit, mp_fraglimit, and mp_maxrounds (bug 2344).
- Translations can now be in separate files and placed in language-unique folders.
- The leading "STEAM_0:" or "STEAM_1:" in SteamIDs can now be omitted from admin files.
- Added sm_revote command so clients can participate in a vote that fell off their screen (bug 2156).
- Added Core API for creating stack structures (adt_stack.inc, bug 2441).
- Added API for extending mapchooser (mapchooser.inc, bug 2201).
- Added Core API for map transition control and history (nextmap.inc).
- Added TF2 forward for overriding how critical hits are calculated.
- Added SetClientInfo() native for modifying how a server sees a client's setinfo properties.
- Added CreateDirectory() native (bug 3253).
- Added "magic" MaxClients variable to replace slower GetMaxClients() call.
- Added support for three-letter language codes (bug 3526).
- Functions to control client versus client mic listening now work as described (bug 2498).
- Fixed SDKTools not being reloadable, and fixed a related bug in Handle type removal (bug 2753).
- Rewrote internal translation handling. Extensions now have access to an ITranslator API (bug 2535).
- Rewrote internal handling of dependencies (especially relating to native providers) (bug 2466).
- Added user config hooks to IGameConfigManager, for parsing user-defined sections.
- Revamped SourcePawn API. Removed and deprecated many structures and functions accidentally exposed publicly.
- Revamped SourcePawn structure, it is now separable from SourceMod for other projects.
- Renamed basefuncommands.phrases.txt to funcommands.phrases.txt (bug 2485).
- Renamed basefunvotes.phrases.txt to funvotes.phrases.txt (bug 2485).
- Added IDBDriver API call for extensions to handle IDBDriver dependencies properly.
- Usermessage natives now validate clients to prevent crashing.
- Fixed OnConfigsExecuted not working on listen servers.
- Fixed out-of-handle conditions in CreateTimer() causing crashes (bug 3381).
- Fixed accessing invalid Handles causing crashes (bug 3359).
- Fixed memory corruption with MySQL + FetchString (bug 3352).
- Fixed ReadFileString ignoring its fourth parameter (bug 3459).
- Fixed sm_sql_addadmin reading the immunity field as a password (bug 3395).
- Fixed ReadFile sign-extending instead of zero-extending (bug 3449).
----------------------------
SourceMod 1.0.4 [2008-09-14]
Changes:
- Fixed amb1986: Format() with very long strings could crash if the input and output buffers overlapped.
- Fixed amb1938: The compiler ate too many characters in preprocessor macros.
- Fixed amb1935: Topmenu child names were not uncached when a category was deleted.
- Fixed amb1929: Banning via the console threw a runtime error.
- Fixed amb1918: Ban menu should compare userids, not client indexes
- Fixed amb1916: Threaded query delay is now 50ms instead of 500ms.
- Fixed amb1899: Duplicate maps in auto generated maplists.
- Fixed amb1891: Basechat didn't check for blank message in private says.
- Fixed amb1853: Ternary operators with string assignments could chop strings off.
- Fixed amb1815: Custom admin menu wasn't escaping input.
- Fixed amb1808: KickClient() is now delayed to prevent crashes, use KickClientEx for old functionality.
- Fixed amb1802: Possible crash when a client disconnected.
- Fixed amb1801: Improved bot detection, and fixed bots crashing if inside an OrangeBox server.cfg.
- Fixed amb1780: admin-sql-threaded had a debug spew turned on.
- Fixed amb1779: Crash in GetTeamName() on mods that don't support it.
- Fixed amb1763: Function call status is now cleared on a new function call.
- Fixed amb1749: Updated and improved DoD:S SDKTools coverage.
- Fixed team native crashes in SDKTools for mods like Insurgency.
- Fixed various file handle leaks.
----------------------------
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.
+12
View File
@@ -0,0 +1,12 @@
// Custom admin menu commands.
// For more information:
//
// http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
//
// Note: This file must be in Valve KeyValues format (no multiline comments)
//
"Commands"
{
}
+20
View File
@@ -0,0 +1,20 @@
/* Add group options to be added to 'group' or 'groupplayer' type submenus
* The left side is the name that will show in the menu, right is the command that will be fired
*
* For more information: http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
*/
Groups
{
"All" "@all"
"Bots" "@bots"
"Alive" "@alive"
"Dead" "@dead"
"Humans" "@humans"
"Current aim" "@aim"
/* You can enable these if you are using Counter-Strike Source and running the cstrike extension */
// "Terrorists" "@t"
// "Counter-Terrorists" "@ct"
}
+31
View File
@@ -88,4 +88,35 @@
* "off" - Translate using default server's language
*/
"AllowClLanguageVar" "On"
/**
* Enables or Disables SourceMod's automatic gamedata updating.
*
* The default value is "no". A value of "yes" will block the Auto Updater.
*/
"DisableAutoUpdate" "no"
/**
* If set to yes, a successful gamedata update will attempt to restart SourceMod.
* SourceMod is unloaded and reloaded, and the map is changed to the current map.
* Since gamedata updates occur when the server loads, impact should be minimal.
* But to be safe, this option is disabled by default.
*/
"ForceRestartAfterUpdate" "no"
/**
* Sets the server to connect to for auotmatic gamedata updates.
*/
"AutoUpdateServer" "smupdate.alliedmods.net"
/**
* Sets the port to connect to on the AutoUpdateServer server
*/
"AutoUpdatePort" "6500"
/**
* Whether to show debug spew.
* Currently this will log details about the gamedata updating process.
*/
"DebugSpew" "no"
}
+11
View File
@@ -18,4 +18,15 @@
"driver" "sqlite"
"database" "sourcemod-local"
}
"clientprefs"
{
"driver" "sqlite"
"host" "localhost"
"database" "clientprefs-sqlite"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}
}
-1
View File
@@ -1,6 +1,5 @@
"Languages"
{
"en" "English"
"es" "Español"
}
+7 -1
View File
@@ -51,9 +51,15 @@
"target" "default"
}
/* For the "randomcycle" plugin */
/* For the "rockthevote" plugin */
"rockthevote"
{
"target" "default"
}
/* For the "nominations" plugin */
"nominations"
{
"target" "default"
}
}
+2 -4
View File
@@ -6,14 +6,13 @@
* Available properties for plugins are:
* "pause" - Whether or not the plugin should load paused - "yes" or "no" (default)
* "lifetime" - Lifetime of the plugin. Options:
* "mapsync" - Plugins should be reloaded on mapchange if changed (default)
* "global" - Plugin will never be unloaded or updated
* "mapsync" - Plugins should be reloaded on mapchange if changed (default)
* "global" - Plugin will never be unloaded or updated
* "blockload" - Plugin will always be blocked from loading. Implicit (automatic) loads
* produce no error, but explicit (manual) loads will show an error message.
* (Options are one of "yes" or "no")
*
* You can also have an "Options" section declaring options to pass onto the JIT:
* "debug" - Whether or not to load the plugin in debug mode
* "profile" - Bit flags for profiling level. Add flags together to reach a value.
* WARNING: Profiler is _ALPHA_ software! Use it at your own risk for
* development cycles only (not production setups).
@@ -32,7 +31,6 @@
"Options"
{
"debug" "no"
}
}
}
@@ -0,0 +1,17 @@
CREATE TABLE sm_cookies
(
id INTEGER unsigned NOT NULL auto_increment,
name varchar(30) NOT NULL UNIQUE,
description varchar(255),
access INTEGER,
PRIMARY KEY (id)
);
CREATE TABLE sm_cookie_cache
(
player varchar(65) NOT NULL,
cookie_id int(10) NOT NULL,
value varchar(100),
timestamp int NOT NULL,
PRIMARY KEY (player, cookie_id)
);
@@ -0,0 +1,16 @@
CREATE TABLE sm_cookies
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name varchar(30) NOT NULL UNIQUE,
description varchar(255),
access INTEGER
);
CREATE TABLE sm_cookie_cache
(
player varchar(65) NOT NULL,
cookie_id int(10) NOT NULL,
value varchar(100),
timestamp int,
PRIMARY KEY (player, cookie_id)
);
+1 -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
+1 -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
+367 -6
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
@@ -41,12 +41,14 @@
#include "sourcemod.h"
#include "sm_stringutil.h"
#include "sourcemm_api.h"
#include "sm_srvcmds.h"
#define LEVEL_STATE_NONE 0
#define LEVEL_STATE_LEVELS 1
#define LEVEL_STATE_FLAGS 2
AdminCache g_Admins;
char g_ReverseFlags[26];
AdminFlag g_FlagLetters[26];
bool g_FlagSet[26];
@@ -160,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);
@@ -299,8 +299,23 @@ void AdminCache::OnSourceModAllInitialized()
void AdminCache::OnSourceModLevelChange(const char *mapName)
{
int i;
AdminFlag flag;
/* For now, we only read these once per level. */
s_FlagReader.LoadLevels();
for (i = 0; i < 26; i++)
{
if (FindFlag('a' + i, &flag))
{
g_ReverseFlags[flag] = 'a' + i;
}
else
{
g_ReverseFlags[flag] = '?';
}
}
}
void AdminCache::OnSourceModShutdown()
@@ -434,7 +449,9 @@ AdminId AdminCache::CreateAdmin(const char *name)
assert(pUser->magic == USR_MAGIC_UNSET);
id = m_FreeUserList;
m_FreeUserList = pUser->next_user;
} else {
}
else
{
id = m_pMemory->CreateMem(sizeof(AdminUser), (void **)&pUser);
pUser->grp_size = 0;
pUser->grp_table = -1;
@@ -454,19 +471,28 @@ AdminId AdminCache::CreateAdmin(const char *name)
{
m_FirstUser = id;
m_LastUser = id;
} else {
}
else
{
AdminUser *pPrev = (AdminUser *)m_pMemory->GetAddress(m_LastUser);
pPrev->next_user = id;
pUser->prev_user = m_LastUser;
m_LastUser = id;
}
/* Since we always append to the tail, we should invalidate their next */
pUser->next_user = -1;
if (name && name[0] != '\0')
{
int nameidx = m_pStrings->AddString(name);
pUser = (AdminUser *)m_pMemory->GetAddress(id);
pUser->nameidx = nameidx;
}
else
{
pUser->nameidx = -1;
}
return id;
}
@@ -1156,6 +1182,12 @@ bool AdminCache::BindAdminIdentity(AdminId id, const char *auth, const char *ide
return false;
}
/* If the id was a steam id strip off the STEAM_*: part */
if (strcmp(auth, "steam") == 0 && strncmp(ident, "STEAM_", 6) == 0)
{
ident += 8;
}
if (sm_trie_retrieve(pTable, ident, NULL))
{
return false;
@@ -1178,6 +1210,12 @@ AdminId AdminCache::FindAdminByIdentity(const char *auth, const char *identity)
return INVALID_ADMIN_ID;
}
/* If the id was a steam id strip off the STEAM_*: part */
if (strcmp(auth, "steam") == 0 && strncmp(identity, "STEAM_", 6) == 0)
{
identity += 8;
}
void *object;
if (!sm_trie_retrieve(pTable, identity, &object))
{
@@ -1412,6 +1450,12 @@ void AdminCache::SetAdminPassword(AdminId id, const char *password)
return;
}
if (password[0] == '\0')
{
pUser->password = -1;
return;
}
int i_password = m_pStrings->AddString(password);
pUser = (AdminUser *)m_pMemory->GetAddress(id);
pUser->password = i_password;
@@ -1587,7 +1631,9 @@ bool AdminCache::CanAdminTarget(AdminId id, AdminId target)
bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
{
if (c < 'a' || c > 'z')
if (c < 'a'
|| c > 'z'
|| !g_FlagSet[(unsigned)c - (unsigned)'a'])
{
return false;
}
@@ -1600,6 +1646,21 @@ bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
return true;
}
bool AdminCache::FindFlagChar(AdminFlag flag, char *c)
{
if (!g_FlagSet[flag])
{
return false;
}
if (c)
{
*c = g_ReverseFlags[flag];
}
return true;
}
FlagBits AdminCache::ReadFlagString(const char *flags, const char **end)
{
FlagBits bits = 0;
@@ -1730,3 +1791,303 @@ bool AdminCache::CheckAccess(int client, const char *cmd, FlagBits flags, bool o
return g_ConCmds.CheckCommandAccess(client, cmd, bits) ? 1 : 0;
}
void iterator_glob_basic_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\"%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_glob_grp_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_group_basic_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\t\t\"%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_group_grp_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\t\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
}
void AdminCache::DumpCache(FILE *fp)
{
int *itable;
AdminId aid;
GroupId gid;
char flagstr[64];
unsigned int num;
AdminUser *pAdmin;
AdminGroup *pGroup;
char name_buffer[512];
fprintf(fp, "\"Groups\"\n{\n");
num = 0;
gid = m_FirstGroup;
while (gid != INVALID_GROUP_ID
&& (pGroup = GetGroup(gid)) != NULL)
{
num++;
FillFlagString(pGroup->addflags, flagstr, sizeof(flagstr));
fprintf(fp, "\t/* num = %d, gid = 0x%X */\n", num, gid);
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pGroup->nameidx));
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pGroup->immunity_level);
if (pGroup->immune_table != -1
&& (itable = (int *)m_pMemory->GetAddress(pGroup->immune_table)) != NULL)
{
AdminGroup *pAltGroup;
const char *gname, *mod;
for (int i = 1; i <= itable[0]; i++)
{
if ((pAltGroup = GetGroup(itable[i])) == NULL)
{
/* Assume the rest of the table is corrupt */
break;
}
gname = GetString(pAltGroup->nameidx);
if (atoi(gname) != 0)
{
mod = "@";
}
else
{
mod = "";
}
fprintf(fp, "\t\t\"immunity\"\t\t\"%s%s\"\n", mod, gname);
}
}
fprintf(fp, "\n\t\t\"Overrides\"\n\t\t{\n");
if (pGroup->pCmdGrpTable != NULL)
{
sm_trie_bad_iterator(pGroup->pCmdGrpTable,
name_buffer,
sizeof(name_buffer),
iterator_group_grp_override,
fp);
}
if (pGroup->pCmdTable != NULL)
{
sm_trie_bad_iterator(pGroup->pCmdTable,
name_buffer,
sizeof(name_buffer),
iterator_group_basic_override,
fp);
}
fprintf(fp, "\t\t}\n");
fprintf(fp, "\t}\n");
if ((gid = pGroup->next_grp) != INVALID_GROUP_ID)
{
fprintf(fp, "\n");
}
}
fprintf(fp, "}\n\n");
fprintf(fp, "\"Admins\"\n{\n");
num = 0;
aid = m_FirstUser;
while (aid != INVALID_ADMIN_ID
&& (pAdmin = GetUser(aid)) != NULL)
{
num++;
FillFlagString(pAdmin->flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t/* num = %d, aid = 0x%X, serialno = 0x%X*/\n", num, aid, pAdmin->serialchange);
if (pAdmin->nameidx != -1)
{
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pAdmin->nameidx));
}
else
{
fprintf(fp, "\t\"\"\n\t{\n");
}
if (pAdmin->auth.identidx != -1)
{
fprintf(fp, "\t\t\"auth\"\t\t\t\"%s\"\n", GetMethodName(pAdmin->auth.index));
fprintf(fp, "\t\t\"identity\"\t\t\"%s\"\n", GetString(pAdmin->auth.identidx));
}
if (pAdmin->password != -1)
{
fprintf(fp, "\t\t\"password\"\t\t\"%s\"\n", GetString(pAdmin->password));
}
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pAdmin->immunity_level);
if (pAdmin->grp_count != 0
&& pAdmin->grp_table != -1
&& (itable = (int *)m_pMemory->GetAddress(pAdmin->grp_table)) != NULL)
{
unsigned int i;
for (i = 0; i < pAdmin->grp_count; i++)
{
if ((pGroup = GetGroup(itable[i])) == NULL)
{
/* Assume the rest of the table is corrupt */
break;
}
fprintf(fp, "\t\t\"group\"\t\t\t\"%s\"\n", GetString(pGroup->nameidx));
}
}
fprintf(fp, "\t}\n");
if ((aid = pAdmin->next_user) != INVALID_ADMIN_ID)
{
fprintf(fp, "\n");
}
}
fprintf(fp, "}\n\n");
fprintf(fp, "\"Overrides\"\n{\n");
if (m_pCmdGrpOverrides != NULL)
{
sm_trie_bad_iterator(m_pCmdGrpOverrides,
name_buffer,
sizeof(name_buffer),
iterator_glob_grp_override,
fp);
}
if (m_pCmdOverrides != NULL)
{
sm_trie_bad_iterator(m_pCmdOverrides,
name_buffer,
sizeof(name_buffer),
iterator_glob_basic_override,
fp);
}
fprintf(fp, "}\n");
}
AdminGroup *AdminCache::GetGroup(GroupId gid)
{
AdminGroup *pGroup;
pGroup = (AdminGroup *)m_pMemory->GetAddress(gid);
if (!pGroup || pGroup->magic != GRP_MAGIC_SET)
{
return NULL;
}
return pGroup;
}
AdminUser *AdminCache::GetUser(AdminId aid)
{
AdminUser *pAdmin;
pAdmin = (AdminUser *)m_pMemory->GetAddress(aid);
if (!pAdmin || pAdmin->magic != USR_MAGIC_SET)
{
return NULL;
}
return pAdmin;
}
const char *AdminCache::GetMethodName(unsigned int index)
{
List<AuthMethod>::iterator iter;
for (iter=m_AuthMethods.begin();
iter!=m_AuthMethods.end();
iter++)
{
if (index-- == 0)
{
return (*iter).name.c_str();
}
}
return NULL;
}
const char *AdminCache::GetString(int idx)
{
return m_pStrings->GetString(idx);
}
size_t AdminCache::FillFlagString(FlagBits bits, char *buffer, size_t maxlen)
{
size_t pos;
unsigned int i, num_flags;
AdminFlag flags[AdminFlags_TOTAL];
num_flags = FlagBitsToArray(bits, flags, AdminFlags_TOTAL);
pos = 0;
for (i = 0; pos < maxlen && i < num_flags; i++)
{
if (FindFlagChar(flags[i], &buffer[pos]))
{
pos++;
}
}
buffer[pos] = '\0';
return pos;
}
CON_COMMAND(sm_dump_admcache, "Dumps the admin cache for debugging")
{
FILE *fp;
char buffer[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, buffer, sizeof(buffer), "data/admin_cache_dump.txt");
if ((fp = fopen(buffer, "wt")) == NULL)
{
g_RootMenu.ConsolePrint("Could not open file for writing: %s", buffer);
return;
}
g_Admins.DumpCache(fp);
g_RootMenu.ConsolePrint("Admin cache dumped to: %s", buffer);
fclose(fp);
}
+8 -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
@@ -153,6 +153,7 @@ public: //IAdminSystem
bool FindFlag(const char *str, AdminFlag *pFlag);
bool FindFlag(char c, AdminFlag *pAdmFlag);
FlagBits ReadFlagString(const char *flags, const char **end);
size_t FillFlagString(FlagBits bits, char *buffer, size_t maxlen);
unsigned int GetAdminSerialChange(AdminId id);
bool CanAdminUseCommand(int client, const char *cmd);
const char *GetGroupName(GroupId gid);
@@ -164,8 +165,13 @@ public: //IAdminSystem
const char *cmd,
FlagBits flags,
bool override_only);
bool FindFlagChar(AdminFlag flag, char *c);
public:
bool IsValidAdmin(AdminId id);
void DumpCache(FILE *fp);
AdminGroup *GetGroup(GroupId gid);
AdminUser *GetUser(AdminId id);
const char *GetString(int idx);
private:
void _UnsetCommandOverride(const char *cmd);
void _UnsetCommandGroupOverride(const char *group);
@@ -174,6 +180,7 @@ private:
void DumpCommandOverrideCache(OverrideType type);
Trie *GetMethodByIndex(unsigned int index);
bool GetMethodIndex(const char *name, unsigned int *_index);
const char *GetMethodName(unsigned int index);
void NameFlag(const char *str, AdminFlag flag);
public:
BaseStringTable *m_pStrings;
+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
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "CDataPack.h"
+1 -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
+13 -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
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
extern HandleType_t htCellArray;
@@ -40,14 +40,17 @@ public:
CellArray(size_t blocksize) : m_Data(NULL), m_BlockSize(blocksize), m_AllocSize(0), m_Size(0)
{
}
~CellArray()
{
free(m_Data);
}
size_t size() const
{
return m_Size;
}
cell_t *push()
{
if (!GrowIfNeeded(1))
@@ -58,18 +61,22 @@ public:
m_Size++;
return arr;
}
cell_t *at(size_t b) const
{
return &m_Data[b * m_BlockSize];
}
size_t blocksize() const
{
return m_BlockSize;
}
void clear()
{
m_Size = 0;
}
bool swap(size_t item1, size_t item2)
{
/* Make sure there is extra space available */
@@ -90,6 +97,7 @@ public:
return true;
}
void remove(size_t index)
{
/* If we're at the end, take the easy way out */
@@ -107,6 +115,7 @@ public:
m_Size--;
}
cell_t *insert_at(size_t index)
{
/* Make sure it'll fit */
@@ -124,6 +133,7 @@ public:
return src;
}
bool resize(size_t count)
{
if (count <= m_Size)
@@ -132,7 +142,7 @@ public:
return true;
}
if(!GrowIfNeeded(count - m_Size))
if (!GrowIfNeeded(count - m_Size))
{
return false;
}
+1 -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
+8 -13
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
@@ -57,7 +57,6 @@ extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegat
ChatTriggers g_ChatTriggers;
bool g_bSupressSilentFails = false;
CPhraseFile *g_pFloodPhrases = NULL;
ChatTriggers::ChatTriggers() : m_pSayCmd(NULL), m_bWillProcessInPost(false),
m_bTriggerWasSilent(false), m_ReplyTo(SM_REPLY_CONSOLE)
@@ -114,10 +113,7 @@ void ChatTriggers::OnSourceModAllInitialized()
void ChatTriggers::OnSourceModAllInitialized_Post()
{
unsigned int file_id;
file_id = g_Translator.FindOrAddPhraseFile("antiflood.phrases.txt");
g_pFloodPhrases = g_Translator.GetFileByIndex(file_id);
g_pCorePhrases->AddPhraseFile("antiflood.phrases");
}
void ChatTriggers::OnSourceModGameInitialized()
@@ -216,15 +212,14 @@ void ChatTriggers::OnSayCommand_Pre()
{
char buffer[128];
/* :TODO: log an error? */
if (g_Translator.CoreTransEx(g_pFloodPhrases,
client,
buffer,
if (!CoreTranslate(
buffer,
sizeof(buffer),
"Flooding the server",
"%T",
2,
NULL,
NULL)
!= Trans_Okay)
"Flooding the server",
&client))
{
UTIL_Format(buffer, sizeof(buffer), "You are flooding the server!");
}
+1 -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 -8
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
@@ -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
@@ -379,14 +404,14 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
/* On a listen server, sometimes the server host's client index can be set as 0.
* So index 1 is passed to the command callback to correct this potential problem.
*/
if (client == 0 && !engine->IsDedicatedServer())
if (!engine->IsDedicatedServer())
{
pHook->pf->PushCell(1);
} else {
pHook->pf->PushCell(client);
client = g_Players.ListenClient();
}
pHook->pf->PushCell(client);
pHook->pf->PushCell(args);
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
{
if (tempres > result)
@@ -494,8 +519,7 @@ bool ConCmdManager::CheckAccess(int client, const char *cmd, AdminCmdInfo *pAdmi
/* If we got here, the command failed... */
char buffer[128];
if (g_Translator.CoreTrans(client, buffer, sizeof(buffer), "No Access", NULL, NULL)
!= Trans_Okay)
if (!CoreTranslate(buffer, sizeof(buffer), "%T", 2, NULL, "No Access", &client))
{
UTIL_Format(buffer, sizeof(buffer), "You do not have access to this command");
}
+1 -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
+1 -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
+1 -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
+125 -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,23 +40,83 @@
#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");
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_APPLE
ConVar sm_corecfgfile("sm_corecfgfile", "addons/sourcemod/configs/core.cfg", 0, "SourceMod core configuration file");
#endif
IForward *g_pOnServerCfg = NULL;
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()
{
g_RootMenu.AddRootConsoleCommand("config", "Set core configuration options", this);
g_pOnServerCfg = g_Forwards.CreateForward("OnServerCfg", ET_Ignore, 0, NULL);
g_pOnConfigsExecuted = g_Forwards.CreateForward("OnConfigsExecuted", ET_Ignore, 0, NULL);
g_pOnAutoConfigsBuffered = g_Forwards.CreateForward("OnAutoConfigsBuffered", ET_Ignore, 0, NULL);
}
void CoreConfig::OnSourceModShutdown()
@@ -64,11 +124,61 @@ void CoreConfig::OnSourceModShutdown()
g_RootMenu.RemoveRootConsoleCommand("config", this);
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)
{
if (engine->IsDedicatedServer())
{
g_ServerCfgFile = icvar->FindVar("servercfgfile");
}
else
{
g_ServerCfgFile = icvar->FindVar("lservercfgfile");
}
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)
@@ -165,7 +275,7 @@ inline bool IsPathSepChar(char c)
{
#if defined PLATFORM_WINDOWS
return (c == '\\' || c == '/');
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_POSIX
return (c == '/');
#endif
}
@@ -382,7 +492,7 @@ void SM_ExecuteForPlugin(IPluginContext *ctx)
void SM_ExecuteAllConfigs()
{
if (g_bConfigsExecd)
if (g_bGotServerStart)
{
return;
}
@@ -403,7 +513,8 @@ void SM_ExecuteAllConfigs()
}
iter->Release();
engine->ServerCommand("sm internal 1\n");
g_bGotServerStart = true;
CheckAndFinalizeConfigs();
}
void SM_ConfigsExecuted_Global()
@@ -418,3 +529,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;
+110 -56
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
@@ -29,12 +29,74 @@
* Version: $Id$
*/
#if 0
#include "sm_globals.h"
#include "sourcemm_api.h"
#include "Tlhelp32.h"
#include "LibrarySys.h"
#include "minidump.h"
#include "sm_stringutil.h"
bool HookImportAddrTable(BYTE *base, const char *func, DWORD hookfunc, char *err, size_t maxlength)
{
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)base;
if (dos->e_magic != IMAGE_DOS_SIGNATURE)
{
UTIL_Format(err, maxlength, "%s", "Could not detect valid DOS signature");
return false;
}
IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)(base + dos->e_lfanew);
if (nt->Signature != IMAGE_NT_SIGNATURE)
{
UTIL_Format(err, maxlength, "%s", "Could not detect valid NT signature");
return false;
}
IMAGE_IMPORT_DESCRIPTOR *desc =
(IMAGE_IMPORT_DESCRIPTOR *)
(base + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if (base == (BYTE *)desc)
{
UTIL_Format(err, maxlength, "%s", "Could not find IAT");
return false;
}
bool entryFound = false;
while (desc->Name)
{
if (desc->FirstThunk != 0)
{
IMAGE_THUNK_DATA *data = (IMAGE_THUNK_DATA *)(base + desc->OriginalFirstThunk);
DWORD *iat = (DWORD *)(base + desc->FirstThunk);
while (data->u1.Function)
{
if ((data->u1.Ordinal & IMAGE_ORDINAL_FLAG32) != IMAGE_ORDINAL_FLAG32)
{
IMAGE_IMPORT_BY_NAME *import = (IMAGE_IMPORT_BY_NAME *)(base + data->u1.AddressOfData);
if (strcmp((char *)import->Name, func) == 0)
{
DWORD oldprot, oldprot2;
VirtualProtect(iat, 4, PAGE_READWRITE, &oldprot);
*iat = hookfunc;
VirtualProtect(iat, 4, oldprot, &oldprot2);
entryFound = true;
}
}
data++;
iat++;
}
}
desc++;
}
if (!entryFound)
{
UTIL_Format(err, maxlength, "Could not find IAT entry for %s", func);
return false;
}
return true;
}
BOOL
WINAPI
@@ -62,6 +124,24 @@ FARPROC WINAPI GetProcAddress2(HMODULE hModule, LPCSTR lpProcName)
return GetProcAddress(hModule, lpProcName);
}
HMODULE WINAPI LoadLibraryEx2(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags)
{
HMODULE lib = LoadLibraryEx(lpFileName, hFile, dwFlags);
/* Steam.dll seems to get loaded using an abs path, thus the use of stristr() */
if (stristr(lpFileName, "steam.dll"))
{
char err[64];
if (!HookImportAddrTable((BYTE *)lib, "GetProcAddress", (DWORD)GetProcAddress2, err, sizeof(err)))
{
Error("[SM] %s in steam.dll\n", err);
return NULL;
}
}
return lib;
}
class CrazyWindowsDebugger : public SMGlobalClass
{
public:
@@ -69,6 +149,9 @@ public:
{
HANDLE hModuleList = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
MODULEENTRY32 me32;
BYTE *engine = NULL;
BYTE *steam = NULL;
char err[64];
me32.dwSize = sizeof(MODULEENTRY32);
@@ -77,69 +160,40 @@ public:
Error("Could not initialize crazy debugger!");
}
bool found = false;
do
{
if (strcasecmp(me32.szModule, "steam.dll") == 0)
if (strcasecmp(me32.szModule, "engine.dll") == 0)
{
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)me32.modBaseAddr;
if (dos->e_magic != IMAGE_DOS_SIGNATURE)
{
Error("[SM] Could not detect steam.dll with valid DOS signature");
}
char *base = (char *)dos;
IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)(base + dos->e_lfanew);
if (nt->Signature != IMAGE_NT_SIGNATURE)
{
Error("[SM] Could not detect steam.dll with valid NT signature");
}
IMAGE_IMPORT_DESCRIPTOR *desc =
(IMAGE_IMPORT_DESCRIPTOR *)
(base + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if (base == (char *)desc)
{
Error("[SM] Could not find the steam.dll IAT");
}
while (desc->Name)
{
if (desc->FirstThunk != 0)
{
IMAGE_THUNK_DATA *data = (IMAGE_THUNK_DATA *)(base + desc->OriginalFirstThunk);
DWORD *iat = (DWORD *)(base + desc->FirstThunk);
while (data->u1.Function)
{
if ((data->u1.Ordinal & IMAGE_ORDINAL_FLAG32) != IMAGE_ORDINAL_FLAG32)
{
IMAGE_IMPORT_BY_NAME *import = (IMAGE_IMPORT_BY_NAME *)(base + data->u1.AddressOfData);
if (strcmp((char *)import->Name, "GetProcAddress") == 0)
{
DWORD oldprot, oldprot2;
VirtualProtect(iat, 4, PAGE_READWRITE, &oldprot);
*iat = (DWORD)GetProcAddress2;
VirtualProtect(iat, 4, oldprot, &oldprot2);
found = true;
goto _end;
}
}
data++;
iat++;
}
}
desc++;
}
break;
engine = me32.modBaseAddr;
}
else if (strcasecmp(me32.szModule, "steam.dll") == 0)
{
steam = me32.modBaseAddr;
}
} while (Module32Next(hModuleList, &me32));
_end:
CloseHandle(hModuleList);
if (!found)
/* This really should not happen, but ... */
if (!engine)
{
Error("Could not find steam.dll's GetProcAddress IAT entry");
Error("[SM] Could not find engine.dll\n");
}
CloseHandle(hModuleList);
/* Steam.dll isn't loaded yet */
if (!steam)
{
if (!HookImportAddrTable(engine, "LoadLibraryExA", (DWORD)LoadLibraryEx2, err, sizeof(err)))
{
Error("[SM] %s in engine.dll)\n", err);
}
}
else
{
if (!HookImportAddrTable(steam, "GetProcAddress", (DWORD)GetProcAddress2, err, sizeof(err)))
{
Error("[SM] %s in steam.dll)\n", err);
}
}
}
} s_CrazyDebugger;
#endif
+7 -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
@@ -717,3 +717,9 @@ const char *DBManager::GetDefaultDriverName()
{
return m_DefDriver.c_str();
}
void DBManager::AddDependency(IExtension *myself, IDBDriver *driver)
{
g_Extensions.AddRawDependency(myself, driver->GetIdentity(), driver);
}
+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
@@ -92,6 +92,7 @@ public: //IDBManager
Handle_t CreateHandle(DBHandleType type, void *ptr, IdentityToken_t *pToken);
HandleError ReadHandle(Handle_t hndl, DBHandleType type, void **ptr);
HandleError ReleaseHandle(Handle_t hndl, DBHandleType type, IdentityToken_t *token);
void AddDependency(IExtension *myself, IDBDriver *driver);
public: //ITextListener_SMC
void ReadSMC_ParseStart();
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
+21 -11
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
@@ -36,16 +36,23 @@
DebugReport g_DbgReporter;
/* I'm really lazy. This should probably be exported to ISourcePawnEngine someday,
* but we need to make sure the JIT will deal with the version bump.
*/
extern const char *GetSourcePawnErrorMessage(int error);
void DebugReport::OnSourceModAllInitialized()
{
g_pSourcePawn->SetDebugListener(this);
}
void DebugReport::OnDebugSpew(const char *msg, ...)
{
va_list ap;
char buffer[512];
va_start(ap, msg);
UTIL_FormatArgs(buffer, sizeof(buffer), msg, ap);
va_end(ap);
g_Logger.LogMessage("[SM] %s", buffer);
}
void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, const char *message, ...)
{
va_list ap;
@@ -56,7 +63,7 @@ void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, c
va_end(ap);
const char *plname = g_PluginSys.FindPluginByContext(ctx->GetContext())->GetFilename();
const char *error = GetSourcePawnErrorMessage(err);
const char *error = g_pSourcePawn2->GetErrorString(err);
if (error)
{
@@ -73,7 +80,7 @@ void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, c
{
func_idx >>= 1;
sp_public_t *function;
if (ctx->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
if (ctx->GetRuntime()->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
{
g_Logger.LogError("[SM] Unable to call function \"%s\" due to above error(s).", function->name);
}
@@ -91,7 +98,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr
va_end(ap);
const char *plname = g_PluginSys.FindPluginByContext(pContext->GetContext())->GetFilename();
const char *error = GetSourcePawnErrorMessage(err);
const char *error = g_pSourcePawn2->GetErrorString(err);
if (error)
{
@@ -103,7 +110,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr
g_Logger.LogError("[SM] %s", buffer);
IPluginDebugInfo *pDebug;
if ((pDebug = pContext->GetDebugInfo()) == NULL)
if ((pDebug = pContext->GetRuntime()->GetDebugInfo()) == NULL)
{
g_Logger.LogError("[SM] Debug mode is not enabled for \"%s\"", plname);
g_Logger.LogError("[SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug %d on",
@@ -181,6 +188,9 @@ int DebugReport::_GetPluginIndex(IPluginContext *ctx)
}
iter->Release();
return -1;
/* If we don't know which plugin this is, it's one being loaded. Fake its index for now. */
return g_PluginSys.GetPluginCount() + 1;
}
+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
@@ -43,6 +43,8 @@ public: // SMGlobalClass
void OnSourceModAllInitialized();
public: // IDebugListener
void OnContextExecuteError(IPluginContext *ctx, IContextTrace *error);
void OnDebugSpew(const char *msg, ...);
public:
void GenerateError(IPluginContext *ctx, cell_t func_idx, int err, const char *message, ...);
void GenerateCodeError(IPluginContext *ctx, uint32_t code_addr, int err, const char *message, ...);
private:
+13 -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
@@ -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 -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
@@ -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
@@ -266,43 +266,12 @@ void CExtension::MarkAllLoaded()
}
}
void CExtension::AddPlugin(IPlugin *pPlugin)
void CExtension::AddPlugin(CPlugin *pPlugin)
{
/* Unfortunately we have to do this :( */
if (m_Plugins.find(pPlugin) != m_Plugins.end())
if (m_Dependents.find(pPlugin) != m_Dependents.end())
{
m_Plugins.push_back(pPlugin);
}
}
void CExtension::RemovePlugin(IPlugin *pPlugin)
{
m_Plugins.remove(pPlugin);
List<WeakNative>::iterator iter = m_WeakNatives.begin();
while (iter != m_WeakNatives.end())
{
if ((*iter).pl == pPlugin)
{
iter = m_WeakNatives.erase(iter);
}
else
{
iter++;
}
}
iter = m_ReplacedNatives.begin();
while (iter != m_ReplacedNatives.end())
{
if ((*iter).pl == pPlugin)
{
iter = m_ReplacedNatives.erase(iter);
}
else
{
iter++;
}
m_Dependents.push_back(pPlugin);
}
}
@@ -336,7 +305,7 @@ bool CLocalExtension::IsLoaded()
return (m_pLib != NULL);
}
void CExtension::AddDependency(IfaceInfo *pInfo)
void CExtension::AddDependency(const IfaceInfo *pInfo)
{
if (m_Deps.find(*pInfo) == m_Deps.end())
{
@@ -664,6 +633,20 @@ void CExtensionManager::BindDependency(IExtension *pRequester, IfaceInfo *pInfo)
}
}
void CExtensionManager::AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface)
{
CExtension *pExt = (CExtension *)ext;
CExtension *pOwner = GetExtensionFromIdent(other);
IfaceInfo info;
info.iface = (SMInterface *)iface;
info.owner = pOwner;
pExt->AddDependency(&info);
pOwner->AddChildDependent(pExt, (SMInterface *)iface);
}
void CExtensionManager::AddInterface(IExtension *pOwner, SMInterface *pInterface)
{
CExtension *pExt = (CExtension *)pOwner;
@@ -671,7 +654,7 @@ void CExtensionManager::AddInterface(IExtension *pOwner, SMInterface *pInterface
pExt->AddInterface(pInterface);
}
void CExtensionManager::BindChildPlugin(IExtension *pParent, IPlugin *pPlugin)
void CExtensionManager::BindChildPlugin( IExtension *pParent, CPlugin *pPlugin )
{
CExtension *pExt = (CExtension *)pParent;
@@ -684,7 +667,7 @@ void CExtensionManager::OnPluginDestroyed(IPlugin *plugin)
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
{
(*iter)->RemovePlugin(plugin);
(*iter)->DropRefsTo((CPlugin *)plugin);
}
}
@@ -709,77 +692,6 @@ CExtension *CExtensionManager::FindByOrder(unsigned int num)
return NULL;
}
void CExtensionManager::BindAllNativesToPlugin(IPlugin *pPlugin)
{
IPluginContext *pContext = pPlugin->GetBaseContext();
List<CExtension *> exts;
uint32_t natives = pContext->GetNativesNum();
sp_native_t *native;
sm_extnative_t *x_native;
sm_repnative_t *r_native;
for (uint32_t i=0; i<natives; i++)
{
/* Make sure the native is valid */
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
continue;
}
/* Make sure the native is not already bound */
if (native->status == SP_NATIVE_BOUND)
{
/* If it is bound, see if there is a replacement. */
if ((r_native = m_RepNatives.retrieve(native->name)) == NULL)
{
continue;
}
/* Rewrite the address. Whee! */
native->pfn = r_native->info.func;
/* Make sure this will unload safely */
WeakNative wn((CPlugin *)pPlugin, i);
r_native->owner->m_ReplacedNatives.push_back(wn);
continue;
}
/* See if we've got this native in our cache */
if ((x_native = m_ExtNatives.retrieve(native->name)) == NULL)
{
continue;
}
/* Try and bind it */
if (pContext->BindNativeToIndex(i, x_native->info->func) != SP_ERROR_NONE)
{
continue;
}
/* See if it's optional */
if (native->flags & SP_NTVFLAG_OPTIONAL)
{
WeakNative wkn = WeakNative((CPlugin *)pPlugin, i);
x_native->owner->m_WeakNatives.push_back(wkn);
}
else if (exts.find(x_native->owner) == exts.end())
{
exts.push_back(x_native->owner);
}
}
List<CExtension *>::iterator iter;
for (iter = exts.begin(); iter != exts.end(); iter++)
{
CExtension *pExt = (*iter);
if (pExt->m_Plugins.find(pPlugin) != pExt->m_Plugins.end())
{
continue;
}
pExt->m_Plugins.push_back(pPlugin);
}
}
bool CExtensionManager::UnloadExtension(IExtension *_pExt)
{
if (!_pExt)
@@ -804,12 +716,12 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
if (pExt->IsLoaded())
{
/* Unload any dependent plugins */
List<IPlugin *>::iterator p_iter = pExt->m_Plugins.begin();
while (p_iter != pExt->m_Plugins.end())
List<CPlugin *>::iterator p_iter = pExt->m_Dependents.begin();
while (p_iter != pExt->m_Dependents.end())
{
/* We have to manually unlink ourselves here, since we're no longer being managed */
g_PluginSys.UnloadPlugin((*p_iter));
p_iter = pExt->m_Plugins.erase(p_iter);
p_iter = pExt->m_Dependents.erase(p_iter);
}
List<String>::iterator s_iter;
@@ -820,30 +732,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
g_PluginSys.OnLibraryAction((*s_iter).c_str(), false, true);
}
/* Unbind weak natives */
List<WeakNative>::iterator wkn_iter;
for (wkn_iter=pExt->m_WeakNatives.begin(); wkn_iter!=pExt->m_WeakNatives.end(); wkn_iter++)
{
WeakNative & wkn = (*wkn_iter);
sp_context_t *ctx = wkn.pl->GetContext();
ctx->natives[wkn.idx].status = SP_NATIVE_UNBOUND;
}
/* Unbind replacement natives, link them back to their originals */
for (wkn_iter = pExt->m_ReplacedNatives.begin();
wkn_iter != pExt->m_ReplacedNatives.end();
wkn_iter++)
{
WeakNative & wkn = (*wkn_iter);
sp_context_t *ctx = wkn.pl->GetContext();
sm_repnative_t *r_native = m_RepNatives.retrieve(ctx->natives[wkn.idx].name);
if (r_native == NULL || ctx->natives[wkn.idx].pfn != r_native->info.func)
{
continue;
}
ctx->natives[wkn.idx].pfn = r_native->original;
}
/* Notify and/or unload all dependencies */
List<CExtension *>::iterator c_iter;
CExtension *pDep;
@@ -898,44 +786,7 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
/* Unbind our natives from Core */
List<const sp_nativeinfo_t *>::iterator native_iter;
for (native_iter = pExt->m_Natives.begin();
native_iter != pExt->m_Natives.end();
native_iter++)
{
const sp_nativeinfo_t *natives = (*native_iter);
sm_extnative_t *x_native;
for (unsigned int n = 0;
natives[n].name != NULL && natives[n].func != NULL;
n++)
{
x_native = m_ExtNatives.retrieve(natives[n].name);
if (x_native && x_native->owner == pExt)
{
m_ExtNatives.remove(natives[n].name);
}
}
}
/* Unbind our replacement natives */
List<sm_repnative_t>::iterator rep_iter = m_RepNativeList.begin();
while (rep_iter != m_RepNativeList.end())
{
sm_repnative_t & r_native = (*rep_iter);
if (r_native.owner == pExt)
{
m_RepNatives.remove(r_native.info.name);
rep_iter = m_RepNativeList.erase(rep_iter);
}
else
{
rep_iter++;
}
}
/* Tell it to unload */
pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
pExt->DropEverything();
}
IdentityToken_t *pIdentity;
@@ -949,6 +800,13 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
}
/* Tell it to unload */
if (pExt->IsLoaded())
{
IExtensionInterface *pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
pExt->Unload();
delete pExt;
@@ -962,44 +820,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
return true;
}
void CExtensionManager::AddNatives(IExtension *pOwner, const sp_nativeinfo_t *natives)
{
CExtension *pExt = (CExtension *)pOwner;
pExt->m_Natives.push_back(natives);
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if (m_ExtNatives.retrieve(natives[i].name) != NULL)
{
continue;
}
sm_extnative_t x_native;
x_native.info = &natives[i];
x_native.owner = pExt;
m_ExtNatives.insert(natives[i].name, x_native);
}
}
void CExtensionManager::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
SPVM_NATIVE_FUNC orig;
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((orig = g_PluginSys.FindCoreNative(natives[i].name)) == NULL)
{
continue;
}
sm_repnative_t rep;
rep.info = natives[i];
rep.owner = (CExtension *)myself;
rep.original = orig;
m_RepNativeList.push_back(rep);
m_RepNatives.insert(natives[i].name, rep);
}
}
void CExtensionManager::MarkAllLoaded()
{
List<CExtension *>::iterator iter;
@@ -1206,7 +1026,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
if (!pExt->IsLoaded()
|| (!pExt->m_ChildDeps.size() && !pExt->m_Plugins.size()))
|| (!pExt->m_ChildDeps.size() && !pExt->m_Dependents.size()))
{
char filename[PLATFORM_MAX_PATH];
snprintf(filename, PLATFORM_MAX_PATH, "%s", pExt->GetFilename());
@@ -1216,7 +1036,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
else
{
List<IPlugin *> plugins;
List<CPlugin *> plugins;
if (pExt->m_ChildDeps.size())
{
g_RootMenu.ConsolePrint("[SM] Unloading %s will unload the following extensions: ", pExt->GetFilename());
@@ -1246,9 +1066,9 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
{
g_RootMenu.ConsolePrint(" -> %s", pExt->GetFilename());
/* Add to plugin unload list */
List<IPlugin *>::iterator p_iter;
for (p_iter=pOther->m_Plugins.begin();
p_iter!=pOther->m_Plugins.end();
List<CPlugin *>::iterator p_iter;
for (p_iter=pOther->m_Dependents.begin();
p_iter!=pOther->m_Dependents.end();
p_iter++)
{
if (plugins.find((*p_iter)) == plugins.end())
@@ -1260,12 +1080,12 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
}
}
if (pExt->m_Plugins.size())
if (pExt->m_Dependents.size())
{
g_RootMenu.ConsolePrint("[SM] Unloading %s will unload the following plugins: ", pExt->GetFilename());
List<IPlugin *>::iterator iter;
IPlugin *pPlugin;
for (iter = pExt->m_Plugins.begin(); iter != pExt->m_Plugins.end(); iter++)
List<CPlugin *>::iterator iter;
CPlugin *pPlugin;
for (iter = pExt->m_Dependents.begin(); iter != pExt->m_Dependents.end(); iter++)
{
pPlugin = (*iter);
if (plugins.find(pPlugin) == plugins.end())
@@ -1369,3 +1189,20 @@ IExtension *CExtensionManager::LoadExternal(IExtensionInterface *pInterface,
return pExt;
}
void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
{
IExtensionInterface *pAPI;
List<CExtension *>::iterator iter;
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
{
if ((pAPI = (*iter)->GetAPI()) == NULL)
{
continue;
}
if (pAPI->GetExtensionVersion() > 3)
{
pAPI->OnCoreMapStart(pEdictList, edictCount, clientMax);
}
}
}
@@ -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,6 +43,7 @@
#include <IPluginSys.h>
#include <IRootConsoleMenu.h>
#include "PluginSys.h"
#include "NativeOwner.h"
using namespace SourceMod;
using namespace SourceHook;
@@ -55,15 +56,9 @@ struct sm_extnative_t
const sp_nativeinfo_t *info;
};
/* Replacement native */
struct sm_repnative_t
{
CExtension *owner;
sp_nativeinfo_t info;
SPVM_NATIVE_FUNC original;
};
class CExtension : public IExtension
class CExtension :
public IExtension,
public CNativeOwner
{
friend class CExtensionManager;
public:
@@ -78,11 +73,10 @@ public: //IExtension
bool IsRunning(char *error, size_t maxlength);
public:
void SetError(const char *error);
void AddDependency(IfaceInfo *pInfo);
void AddDependency(const IfaceInfo *pInfo);
void AddChildDependent(CExtension *pOther, SMInterface *iface);
void AddInterface(SMInterface *pInterface);
void AddPlugin(IPlugin *pPlugin);
void RemovePlugin(IPlugin *pPlugin);
void AddPlugin(CPlugin *pPlugin);
void MarkAllLoaded();
void AddLibrary(const char *library);
public:
@@ -103,10 +97,6 @@ protected:
List<IfaceInfo> m_Deps; /** Dependencies */
List<IfaceInfo> m_ChildDeps; /** Children who might depend on us */
List<SMInterface *> m_Interfaces;
List<IPlugin *> m_Plugins;
List<const sp_nativeinfo_t *> m_Natives;
List<WeakNative> m_WeakNatives;
List<WeakNative> m_ReplacedNatives;
List<String> m_Libraries;
unsigned int unload_code;
bool m_bFullyLoaded;
@@ -169,25 +159,26 @@ public:
IExtension *LoadAutoExtension(const char *path);
void BindDependency(IExtension *pOwner, IfaceInfo *pInfo);
void AddInterface(IExtension *pOwner, SMInterface *pInterface);
void BindChildPlugin(IExtension *pParent, IPlugin *pPlugin);
void AddNatives(IExtension *pOwner, const sp_nativeinfo_t *natives);
void BindAllNativesToPlugin(IPlugin *pPlugin);
void BindChildPlugin(IExtension *pParent, CPlugin *pPlugin);
void MarkAllLoaded();
void AddDependency(IExtension *pSource, const char *file, bool required, bool autoload);
void TryAutoload();
void AddLibrary(IExtension *pSource, const char *library);
bool LibraryExists(const char *library);
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
void CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
void AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface);
public:
CExtension *GetExtensionFromIdent(IdentityToken_t *ptr);
void Shutdown();
CNativeOwner *GetNativeOwner(IExtension *pExt)
{
CExtension *p = (CExtension *)pExt;
return p;
}
private:
CExtension *FindByOrder(unsigned int num);
private:
List<CExtension *> m_Libs;
List<sm_repnative_t> m_RepNativeList;
KTrie<sm_repnative_t> m_RepNatives;
KTrie<sm_extnative_t> m_ExtNatives;
};
extern CExtensionManager g_Extensions;
@@ -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
@@ -186,6 +186,11 @@ void CForwardManager::ReleaseForward(IForward *forward)
void CForwardManager::ForwardFree(CForward *fwd)
{
if (fwd == NULL)
{
return;
}
m_FreeForwards.push(fwd);
m_managed.remove(fwd);
}
@@ -283,15 +288,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 +312,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 +330,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 +361,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 +388,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 +406,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,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
+83 -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
@@ -42,6 +42,7 @@
#include "LibrarySys.h"
#include "HandleSys.h"
#include "sm_crc32.h"
#include "GameDataFetcher.h"
#if defined PLATFORM_LINUX
#include <dlfcn.h>
@@ -64,6 +65,7 @@ char g_GameName[256] = {'$', '\0'};
#define PSTATE_GAMEDEFS_SIGNATURES_SIG 8
#define PSTATE_GAMEDEFS_CRC 9
#define PSTATE_GAMEDEFS_CRC_BINARY 10
#define PSTATE_GAMEDEFS_CUSTOM 11
#if defined PLATFORM_WINDOWS
#define PLATFORM_NAME "windows"
@@ -71,6 +73,9 @@ char g_GameName[256] = {'$', '\0'};
#elif defined PLATFORM_LINUX
#define PLATFORM_NAME "linux"
#define PLATFORM_SERVER_BINARY "server_i486.so"
#elif defined PLATFORM_APPLE
#define PLATFORM_NAME "undef"
#define PLATFORM_SERVER_BINARY "undef.dylib"
#endif
struct TempSigInfo
@@ -95,6 +100,9 @@ CGameConfig::CGameConfig(const char *file)
m_pSigs = sm_trie_create();
m_pStrings = new BaseStringTable(512);
m_RefCount = 0;
m_CustomLevel = 0;
m_CustomHandler = NULL;
}
CGameConfig::~CGameConfig()
@@ -171,6 +179,17 @@ SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *n
}
else
{
ITextListener_SMC **pListen = g_GameConfigs.m_customHandlers.retrieve(name);
if (pListen != NULL)
{
m_CustomLevel = 0;
m_ParseState = PSTATE_GAMEDEFS_CUSTOM;
m_CustomHandler = *pListen;
m_CustomHandler->ReadSMC_ParseStart();
break;
}
m_IgnoreLevel++;
}
break;
@@ -220,6 +239,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')
@@ -232,6 +252,12 @@ SMCResult CGameConfig::ReadSMC_NewSection(const SMCStates *states, const char *n
}
break;
}
case PSTATE_GAMEDEFS_CUSTOM:
{
m_CustomLevel++;
return m_CustomHandler->ReadSMC_NewSection(states, name);
break;
}
/* No sub-sections allowed:
case PSTATE_GAMEDEFS_OFFSETS_OFFSET:
case PSTATE_GAMEDEFS_KEYS:
@@ -299,6 +325,8 @@ SMCResult CGameConfig::ReadSMC_KeyValue(const SMCStates *states, const char *key
bShouldBeReadingDefault = true;
}
}
} else if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM) {
return m_CustomHandler->ReadSMC_KeyValue(states, key, value);
}
return SMCResult_Continue;
@@ -312,6 +340,13 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
return SMCResult_Continue;
}
if (m_CustomLevel)
{
m_CustomLevel--;
m_CustomHandler->ReadSMC_LeavingSection(states);
return SMCResult_Continue;
}
switch (m_ParseState)
{
case PSTATE_GAMES:
@@ -324,6 +359,12 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
m_ParseState = PSTATE_GAMES;
break;
}
case PSTATE_GAMEDEFS_CUSTOM:
{
m_ParseState = PSTATE_GAMEDEFS;
m_CustomHandler->ReadSMC_ParseEnd(false, false);
break;
}
case PSTATE_GAMEDEFS_KEYS:
case PSTATE_GAMEDEFS_OFFSETS:
{
@@ -522,6 +563,15 @@ bool CGameConfig::Reparse(char *error, size_t maxlength)
state.line,
state.col,
msg ? msg : "Unknown error");
if (m_ParseState == PSTATE_GAMEDEFS_CUSTOM)
{
//error occurred while parsing a custom section
m_CustomHandler->ReadSMC_ParseEnd(true, true);
m_CustomHandler = NULL;
m_CustomLevel = 0;
}
return false;
}
@@ -598,7 +648,7 @@ void GameConfigManager::OnSourceModStartup(bool late)
strncopy(g_GameDesc + 1, SERVER_CALL(GetGameDescription)(), sizeof(g_GameDesc) - 1);
KeyValues *pGameInfo = new KeyValues("GameInfo");
if (pGameInfo->LoadFromFile(basefilesystem, "gameinfo.txt"))
if (g_HL2.KVLoadFromFile(pGameInfo, basefilesystem, "gameinfo.txt"))
{
const char *str;
if ((str = pGameInfo->GetString("game", NULL)) != NULL)
@@ -630,6 +680,13 @@ void GameConfigManager::OnSourceModAllShutdown()
bool GameConfigManager::LoadGameConfigFile(const char *file, IGameConfig **_pConfig, char *error, size_t maxlength)
{
/* A crash was detected during last load - We block the gamedata loading so it hopefully won't happen again */
if (g_blockGameDataLoad)
{
UTIL_Format(error, maxlength, "GameData loaded blocked due to detected crash");
return false;
}
CGameConfig *pConfig;
if (sm_trie_retrieve(m_pLookup, file, (void **)&pConfig))
@@ -684,3 +741,27 @@ IGameConfig *GameConfigManager::ReadHandle(Handle_t hndl, IdentityToken_t *ident
return conf;
}
void GameConfigManager::AddUserConfigHook( const char *sectionname, ITextListener_SMC *listener )
{
m_customHandlers.insert(sectionname, listener);
}
void GameConfigManager::RemoveUserConfigHook( const char *sectionname, ITextListener_SMC *listener )
{
ITextListener_SMC **pListener = m_customHandlers.retrieve(sectionname);
if (pListener == NULL)
{
return;
}
if (*pListener != listener)
{
return;
}
m_customHandlers.remove(sectionname);
return;
}
+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
@@ -38,6 +38,7 @@
#include "sm_trie.h"
#include "sm_globals.h"
#include "sm_memtable.h"
#include "sm_trie_tpl.h"
using namespace SourceMod;
using namespace SourceHook;
@@ -82,6 +83,10 @@ private:
char m_offset[64];
char m_Game[256];
bool bShouldBeReadingDefault;
/* Custom Sections */
unsigned int m_CustomLevel;
ITextListener_SMC *m_CustomHandler;
};
class GameConfigManager :
@@ -97,6 +102,8 @@ public: //IGameConfigManager
IGameConfig *ReadHandle(Handle_t hndl,
IdentityToken_t *ident,
HandleError *err);
void AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener);
void RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener);
public: //SMGlobalClass
void OnSourceModStartup(bool late);
void OnSourceModAllInitialized();
@@ -104,6 +111,8 @@ public: //SMGlobalClass
private:
List<CGameConfig *> m_cfgs;
Trie *m_pLookup;
public:
KTrie<ITextListener_SMC *> m_customHandlers;
};
extern GameConfigManager g_GameConfigs;
+909
View File
@@ -0,0 +1,909 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "GameDataFetcher.h"
#include "bitbuf.h"
#ifdef PLATFORM_WINDOWS
#include <winsock2.h>
#else
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#define INVALID_SOCKET -1
#define closesocket close
#define WSAGetLastError() errno
#endif
#include "sh_vector.h"
#include "sh_string.h"
#include "sm_version.h"
#ifdef ORANGEBOX_BUILD
#include "convar_sm_ob.h"
#else
#include "convar_sm.h"
#endif
#include "sourcemm_api.h"
#include "time.h"
#include "TimerSys.h"
#include "compat_wrappers.h"
#include "sm_stringutil.h"
#include "md5.h"
#include "frame_hooks.h"
#define QUERY_MAX_LENGTH 1024
static BuildMD5ableBuffer g_MD5Builder;
static FetcherThread g_FetchThread;
static FILE *logfile = NULL;
bool g_disableGameDataUpdate = false;
/**
* Note on this. If we issue a reload and changelevel, my srcds.exe will emit
* Assertion Failed: !m_bServiceStarted
* on quit. This seems like a non-issue, because before we just terminated the
* server anyway. If anyone notices and files a bug, we can look into it further.
*/
bool g_restartAfterUpdate = false;
static bool was_level_started = false;
static int g_serverPort = 6500;
static char g_serverAddress[100] = "smupdate.alliedmods.net";
static void _ForceRestart(void *data)
{
char cmd[300];
g_Logger.LogMessage("Automatically restarting SourceMod after a successful gamedata update.");
UTIL_Format(cmd, sizeof(cmd), "meta unload %d\n", g_PLID);
engine->ServerCommand(cmd);
UTIL_Format(cmd, sizeof(cmd), "changelevel \"%s\"\n", STRING(gpGlobals->mapname));
engine->ServerCommand(cmd);
UTIL_Format(cmd, sizeof(cmd), "echo SourceMod restarted after gamedata update.\n");
engine->ServerCommand(cmd);
}
static void ForceRestart()
{
FrameAction action;
action.action = _ForceRestart;
action.data = NULL;
AddFrameAction(action);
}
void FetcherThread::RunThread(IThreadHandle *pHandle)
{
char lock_path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, lock_path, sizeof(lock_path), "data/temp");
g_LibSys.CreateFolder(lock_path);
g_SourceMod.BuildPath(Path_SM, lock_path, sizeof(lock_path), "data/temp/gamedata.lock");
char log_path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, log_path, sizeof(log_path), "logs/gamedata");
g_LibSys.CreateFolder(log_path);
time_t t;
GetAdjustedTime(&t);
tm *curtime = localtime(&t);
g_SourceMod.BuildPath(Path_SM,
log_path,
sizeof(log_path),
"logs/gamedata/L%04d%02d%02d.log",
curtime->tm_year + 1900,
curtime->tm_mon + 1,
curtime->tm_mday);
logfile = fopen(log_path, "at");
if (!logfile)
{
/* :( */
return;
}
//Create a blank lock file
FILE *fp = fopen(lock_path, "w");
if (fp)
{
fclose(fp);
}
char query[QUERY_MAX_LENGTH];
/* Check for updated gamedata files */
int len = BuildGameDataQuery(query, QUERY_MAX_LENGTH);
if (len == 0)
{
g_Logger.LogToFileOnly(logfile, "Could not build gamedata query!");
fclose(logfile);
unlink(lock_path);
return;
}
/* We check this late so we have the MD5 sums available. This may change in the future. */
if (g_disableGameDataUpdate)
{
g_Logger.LogToFileOnly(logfile, "Skipping gamedata fetcher (DisableAutoUpdate set)");
fclose(logfile);
unlink(lock_path);
return;
}
/* Create a new socket for this connection */
int socketDescriptor = ConnectSocket();
if (socketDescriptor == INVALID_SOCKET)
{
fclose(logfile);
unlink(lock_path);
return;
}
int sent = SendData(socketDescriptor, query, len);
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Sent gamedata query");
ENDIF_DEBUG_SPEW
if (sent == 0)
{
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Failed to send gamedata query data to remote host");
ENDIF_DEBUG_SPEW
closesocket(socketDescriptor);
fclose(logfile);
unlink(lock_path);
return;
}
ProcessGameDataQuery(socketDescriptor);
/* And we're done! */
closesocket(socketDescriptor);
fclose(logfile);
unlink(lock_path);
}
void FetcherThread::OnTerminate(IThreadHandle *pHandle, bool cancel)
{
g_blockGameDataLoad = false;
if (cancel)
{
return;
}
if (wasSuccess)
{
HandleUpdateStatus(updateStatus, build);
if (needsRestart)
{
if (g_restartAfterUpdate)
{
if (was_level_started)
{
ForceRestart();
}
}
else
{
g_Logger.LogMessage("Your gamedata files have been updated, please restart your server.");
}
}
}
else if (!g_disableGameDataUpdate)
{
g_Logger.LogError("An error occurred in the gamedata fetcher, see your gamedata log files for more information.");
}
}
int FetcherThread::BuildGameDataQuery(char *buffer, int maxlen)
{
char gamedata_path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, gamedata_path, sizeof(gamedata_path), "gamedata");
IDirectory *dir = g_LibSys.OpenDirectory(gamedata_path);
if (dir == NULL)
{
return 0;
}
bf_write Writer = bf_write("GameDataQuery", buffer, maxlen);
Writer.WriteByte('A'); //Generic Header char
Writer.WriteByte('G'); //G for gamedata query, or green, like my hat.
short build[4] = { SVN_FILE_VERSION };
Writer.WriteBytes(&build[0], 8);
Writer.WriteByte(0); // Initialize the file counter - Index 10
while (dir->MoreFiles())
{
if (dir->IsEntryFile())
{
const char *name = dir->GetEntryName();
size_t len = strlen(name);
if (len >= 4 && strcmp(&name[len-4], ".txt") == 0)
{
MD5 md5;
SMCError err;
SMCStates states;
unsigned char raw[16];
char file[PLATFORM_MAX_PATH];
g_LibSys.PathFormat(file, sizeof(file), "%s/%s", gamedata_path, name);
g_MD5Builder.checksum = &md5;
if ((err = g_TextParser.ParseFile_SMC(file, &g_MD5Builder, &states)) == SMCError_Okay)
{
md5.raw_digest(raw);
(uint8_t)buffer[10]++; //Increment the file counter
Writer.WriteBytes(raw, 16);
FileData *data = new FileData();
data->filename = new SourceHook::String(file);
md5.hex_digest(data->checksum);
filenames.push_back(data);
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Parsed file: %s as %s", file, data->checksum);
ENDIF_DEBUG_SPEW
}
else
{
IF_DEBUG_SPEW
const char *error = g_TextParser.GetSMCErrorString(err);
g_Logger.LogToFileOnly(logfile, "Parsing of file %s failed: %s", file, error);
ENDIF_DEBUG_SPEW
}
}
}
dir->NextEntry();
}
return Writer.GetNumBytesWritten();
}
int FetcherThread::ConnectSocket()
{
#if defined PLATFORM_WINDOWS
WSADATA wsaData;
WSAStartup(0x0101, &wsaData);
#endif
struct protoent *ptrp;
if ((ptrp = getprotobyname("tcp")) == NULL)
{
g_Logger.LogToFileOnly(logfile, "Error: Failed to find TCP protocol");
return INVALID_SOCKET;
}
int socketDescriptor = socket(AF_INET, SOCK_STREAM, ptrp->p_proto);
if (socketDescriptor == INVALID_SOCKET)
{
char error[255];
g_LibSys.GetPlatformErrorEx(WSAGetLastError(), error, sizeof(error));
g_Logger.LogToFileOnly(logfile, "Error: Failed to create socket: %s", error);
closesocket(socketDescriptor);
return INVALID_SOCKET;
}
struct hostent *he;
struct sockaddr_in local_addr;
local_addr.sin_family = AF_INET;
local_addr.sin_port = htons((u_short)g_serverPort);
he = gethostbyname(g_serverAddress);
if (!he)
{
if ((local_addr.sin_addr.s_addr = inet_addr(g_serverAddress)) == INADDR_NONE)
{
g_Logger.LogToFileOnly(logfile, "Couldn't locate address: %s", g_serverAddress);
closesocket(socketDescriptor);
return INVALID_SOCKET;
}
}
else
{
memcpy(&local_addr.sin_addr, (struct in_addr *)he->h_addr, he->h_length);
}
if (connect(socketDescriptor, (struct sockaddr *) &local_addr, sizeof(local_addr)) < 0)
{
char error[255];
g_LibSys.GetPlatformErrorEx(WSAGetLastError(), error, sizeof(error));
g_Logger.LogToFileOnly(logfile, "Couldn't connect to %s: %s", g_serverAddress, error);
closesocket(socketDescriptor);
return INVALID_SOCKET;
}
return socketDescriptor;
}
void FetcherThread::ProcessGameDataQuery(int socketDescriptor)
{
char buffer[50];
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Waiting for reply!");
ENDIF_DEBUG_SPEW
//Read in the header bytes
int returnLen = RecvData(socketDescriptor, buffer, 12);
if (returnLen == 0)
{
char error[255];
g_LibSys.GetPlatformErrorEx(WSAGetLastError(), error, sizeof(error));
g_Logger.LogToFileOnly(logfile, "Did not receive reply: %s", error);
return;
}
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Received Header!");
ENDIF_DEBUG_SPEW
bf_read Reader = bf_read("GameDataQuery", buffer, 12);
if (Reader.ReadByte() != 'A' || Reader.ReadByte() != 'G')
{
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Unknown Query Response");
ENDIF_DEBUG_SPEW
return;
}
updateStatus = (UpdateStatus)Reader.ReadByte();
build[0] = Reader.ReadShort();
build[1] = Reader.ReadShort();
build[2] = Reader.ReadShort();
build[3] = Reader.ReadShort();
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile,
"Update Status: %i - Latest %i.%i.%i.%i",
updateStatus,
build[0],
build[1],
build[2],
build[3]);
ENDIF_DEBUG_SPEW
int changedFiles = Reader.ReadByte();
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Files to download: %i", changedFiles);
ENDIF_DEBUG_SPEW
for (int i=0; i<changedFiles; i++)
{
//Read in the file index and byte count
returnLen = RecvData(socketDescriptor, buffer, 5);
if (returnLen == 0)
{
/* Timeout or fail? */
return;
}
Reader.StartReading(buffer, 5);
int index = Reader.ReadByte();
int tempLen = Reader.ReadUBitLong(32);
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "File index %i and length %i", index, tempLen);
ENDIF_DEBUG_SPEW
void *memPtr;
memtable->CreateMem(tempLen+1, &memPtr);
//Read the contents of our file into the memtable
returnLen = RecvData(socketDescriptor, (char *)memPtr, tempLen);
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Received %i bytes", returnLen);
ENDIF_DEBUG_SPEW
if (returnLen == 0)
{
/* Timeout or fail? */
return;
}
((unsigned char *)memPtr)[tempLen] = '\0';
FileData *data = filenames.at(index);
const char *filename;
if (data != NULL)
{
filename = data->filename->c_str();
FILE *fp = fopen(filename, "w");
if (fp)
{
fprintf(fp, "%s", (const char *)memPtr);
fclose(fp);
}
else
{
g_Logger.LogToFileOnly(logfile, "Failed to open file \"%s\" for writing", filename);
}
}
else
{
filename = "";
}
memtable->Reset();
g_Logger.LogToFileOnly(logfile, "Updated file: %s", filename);
}
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "File Downloads Completed!");
ENDIF_DEBUG_SPEW
needsRestart = false;
if (changedFiles > 0)
{
needsRestart = true;
}
//Read changed file count
returnLen = RecvData(socketDescriptor, buffer, 1);
if (returnLen == 0)
{
char error[255];
g_LibSys.GetPlatformErrorEx(WSAGetLastError(), error, sizeof(error));
g_Logger.LogToFileOnly(logfile, "Did not receive count reply: %s", error);
return;
}
Reader.StartReading(buffer, 1);
changedFiles = Reader.ReadByte();
if (changedFiles < 1)
{
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "No unknown files. We're all done");
ENDIF_DEBUG_SPEW
return;
}
char *changedFileIndexes = new char[changedFiles];
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "%i files were unknown", changedFiles);
ENDIF_DEBUG_SPEW
returnLen = RecvData(socketDescriptor, changedFileIndexes, changedFiles);
if (returnLen == 0)
{
char error[255];
g_LibSys.GetPlatformErrorEx(WSAGetLastError(), error, sizeof(error));
g_Logger.LogToFileOnly(logfile, "Did not receive list reply: %s", error);
return;
}
Reader.StartReading(changedFileIndexes, changedFiles);
for (int i=0; i<changedFiles; i++)
{
int index = Reader.ReadByte();
char fileName[30];
FileData *data = filenames.at(index);
const char* pathname;
if (data != NULL)
{
pathname = data->filename->c_str();
}
else
{
pathname = "";
}
g_LibSys.GetFileFromPath(fileName, sizeof(fileName), pathname);
IF_DEBUG_SPEW
g_Logger.LogToFileOnly(logfile, "Unknown File %i : %s", index, fileName);
ENDIF_DEBUG_SPEW
}
delete [] changedFileIndexes;
wasSuccess = true;
}
int FetcherThread::RecvData(int socketDescriptor, char *buffer, int len)
{
fd_set fds;
struct timeval tv;
/* Create a 10 Second Timeout */
tv.tv_sec = 10;
tv.tv_usec = 0;
int bytesReceivedTotal = 0;
while (bytesReceivedTotal < len)
{
/* Add our socket to a socket set */
FD_ZERO(&fds);
FD_SET(socketDescriptor, &fds);
/* Wait max of 10 seconds for recv to become available */
select(socketDescriptor+1, &fds, NULL, NULL, &tv);
int bytesReceived = 0;
/* Is there a limit on how much we can receive? Some site said 1024 bytes, which will be well short of a file */
if (FD_ISSET(socketDescriptor, &fds))
{
bytesReceived = recv(socketDescriptor, buffer+bytesReceivedTotal, len-bytesReceivedTotal, 0);
}
if (bytesReceived == 0 || bytesReceived == -1)
{
return 0;
}
bytesReceivedTotal += bytesReceived;
}
return bytesReceivedTotal;
}
int FetcherThread::SendData(int socketDescriptor, char *buffer, int len)
{
fd_set fds;
struct timeval tv;
tv.tv_sec = 10;
tv.tv_usec = 0;
int sentBytesTotal = 0;
while (sentBytesTotal < len)
{
FD_ZERO(&fds);
FD_SET(socketDescriptor, &fds);
select(socketDescriptor+1, NULL, &fds, NULL, &tv);
int sentBytes = 0;
if (FD_ISSET(socketDescriptor, &fds))
{
sentBytes = send(socketDescriptor, buffer+sentBytesTotal, len-sentBytesTotal, 0);
}
if (sentBytes == 0 || sentBytes == -1)
{
return 0;
}
sentBytesTotal += sentBytes;
}
return sentBytesTotal;
}
void FetcherThread::HandleUpdateStatus(UpdateStatus status, short version[4])
{
switch (status)
{
case Update_Unknown:
case Update_Current:
{
break;
}
case Update_NewBuild:
{
break;
}
case Update_MinorAvailable:
{
g_Logger.LogMessage("SourceMod Update: A new release of SourceMod is now available from sourcemod.net");
g_Logger.LogMessage("Current Version: %i.%i.%i Available: %i.%i.%i", version[0], version[1], version[2], version[0], version[1], version[2]);
break;
}
case Update_MajorAvailable:
{
g_Logger.LogMessage("SourceMod Update: An major release of SourceMod is now available from sourcemod.net");
g_Logger.LogMessage("Current Version: %i.%i.%i Available: %i.%i.%i", version[0], version[1], version[2], version[0], version[1], version[2]);
break;
}
case Update_CriticalAvailable:
{
g_Logger.LogError("SourceMod Update: A critical SourceMod release is available from sourcemod.net. It is strongly recommended that you update!");
g_Logger.LogMessage("Current Version: %i.%i.%i Available: %i.%i.%i", version[0], version[1], version[2], version[0], version[1], version[2]);
break;
}
}
}
bool g_blockGameDataLoad = false;
static IThreadHandle *fetch_thread_hndl;
class InitFetch : public SMGlobalClass
{
public:
void OnSourceModAllInitialized_Post()
{
char lock_path[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, lock_path, sizeof(lock_path), "data/temp/gamedata.lock");
if (g_LibSys.IsPathFile(lock_path) && g_LibSys.PathExists(lock_path))
{
g_Logger.LogError("sourcemod/data/temp/gamedata.lock file detected. This is most likely due to a crash during GameData updating - Blocking GameData loading");
g_Logger.LogError("If this error persists delete the file manually");
g_blockGameDataLoad = true;
}
ThreadParams fetchThreadParams = ThreadParams();
fetchThreadParams.prio = ThreadPrio_Low;
fetch_thread_hndl = g_pThreader->MakeThread(&g_FetchThread, &fetchThreadParams);
}
void OnSourceModShutdown()
{
fetch_thread_hndl->WaitForThread();
fetch_thread_hndl->DestroyThis();
}
void OnSourceModLevelActivated()
{
was_level_started = true;
if (g_restartAfterUpdate &&
g_FetchThread.wasSuccess &&
g_FetchThread.needsRestart)
{
ForceRestart();
}
}
void OnSourceModLevelEnd()
{
was_level_started = false;
}
ConfigResult OnSourceModConfigChanged(const char *key,
const char *value,
ConfigSource source,
char *error,
size_t maxlength)
{
if (strcasecmp(key, "DisableAutoUpdate") == 0)
{
if (strcasecmp(value, "yes") == 0)
{
g_disableGameDataUpdate = true;
return ConfigResult_Accept;
}
else if (strcasecmp(value, "no") == 0)
{
g_disableGameDataUpdate = false;
return ConfigResult_Accept;
}
return ConfigResult_Reject;
}
if (strcasecmp(key, "ForceRestartAfterUpdate") == 0)
{
if (strcasecmp(value, "yes") == 0)
{
g_restartAfterUpdate = true;
return ConfigResult_Accept;
}
else if (strcasecmp(value, "no") == 0)
{
g_restartAfterUpdate = false;
return ConfigResult_Accept;
}
return ConfigResult_Reject;
}
if (strcasecmp(key, "AutoUpdateServer") == 0)
{
UTIL_Format(g_serverAddress, sizeof(g_serverAddress), "%s", value);
return ConfigResult_Accept;
}
if (strcasecmp(key, "AutoUpdatePort") == 0)
{
int port = atoi(value);
if (!port)
{
return ConfigResult_Reject;
}
g_serverPort = port;
return ConfigResult_Accept;
}
return ConfigResult_Ignore;
}
} g_InitFetch;
BuildMD5ableBuffer::BuildMD5ableBuffer()
{
stringTable = new BaseStringTable(2048);
}
BuildMD5ableBuffer::~BuildMD5ableBuffer()
{
delete stringTable;
}
void BuildMD5ableBuffer::ReadSMC_ParseStart()
{
stringTable->Reset();
}
SMCResult BuildMD5ableBuffer::ReadSMC_KeyValue(const SMCStates *states,
const char *key,
const char *value)
{
stringTable->AddString(key);
stringTable->AddString(value);
return SMCResult_Continue;
}
SMCResult BuildMD5ableBuffer::ReadSMC_NewSection(const SMCStates *states, const char *name)
{
stringTable->AddString(name);
return SMCResult_Continue;
}
void BuildMD5ableBuffer::ReadSMC_ParseEnd(bool halted, bool failed)
{
if (halted || failed)
{
return;
}
void *data = stringTable->GetMemTable()->GetAddress(0);
if (data != NULL)
{
checksum->update((unsigned char *)data, stringTable->GetMemTable()->GetActualMemUsed());
}
checksum->finalize();
}
CON_COMMAND(sm_gamedata_md5, "Checks the MD5 sum for a given gamedata file")
{
#if !defined ORANGEBOX_BUILD
CCommand args;
#endif
if (args.ArgC() < 2)
{
g_SMAPI->ConPrint("Usage: sm_gamedata_md5 <file>\n");
return;
}
const char *file = args.Arg(1);
if (!file || file[0] == '\0')
{
g_SMAPI->ConPrint("Usage: sm_gamedata_md5 <file>\n");
return;
}
SourceHook::CVector<FileData *>::iterator iter = g_FetchThread.filenames.begin();
FileData *curData;
while (iter != g_FetchThread.filenames.end())
{
curData = (*iter);
char fileName[30];
g_LibSys.GetFileFromPath(fileName, sizeof(fileName), curData->filename->c_str());
if (strcmpi(fileName, file) == 0)
{
g_SMAPI->ConPrintf("MD5 Sum: %s\n", curData->checksum);
return;
}
iter++;
}
g_SMAPI->ConPrint("File not found!\n");
}
FetcherThread::~FetcherThread()
{
SourceHook::CVector<FileData *>::iterator iter = filenames.begin();
FileData *curData;
while (iter != filenames.end())
{
curData = (*iter);
delete curData->filename;
delete curData;
iter = filenames.erase(iter);
}
}
FetcherThread::FetcherThread()
{
memtable = new BaseMemTable(4096);
wasSuccess = false;
needsRestart = false;
}
+106
View File
@@ -0,0 +1,106 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_GAMEDATAFETCHER_H_
#define _INCLUDE_SOURCEMOD_GAMEDATAFETCHER_H_
#include "sourcemod.h"
#include "TextParsers.h"
#include "IThreader.h"
#include "Logger.h"
#include "LibrarySys.h"
#include "ThreadSupport.h"
#include "sm_memtable.h"
#include <sh_string.h>
#include <sh_list.h>
enum UpdateStatus
{
Update_Unknown = 0, /* Version wasn't recognised or version querying is unsupported */
Update_Current = 1, /* Server is running latest version */
Update_NewBuild = 2, /* Server is on a svn release and a newer version is available */
Update_MinorAvailable = 3, /* Server is on a release and a minor release has superceeded it */
Update_MajorAvailable = 4, /* Server is on a release and a major release has superceeded it */
Update_CriticalAvailable = 5, /* A critical update has been released (security fixes etc) */
};
class MD5;
class BuildMD5ableBuffer : public ITextListener_SMC
{
public:
BuildMD5ableBuffer();
~BuildMD5ableBuffer();
void ReadSMC_ParseStart();
SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
void ReadSMC_ParseEnd(bool halted, bool failed);
public:
MD5 *checksum;
private:
BaseStringTable *stringTable;
};
struct FileData
{
SourceHook::String *filename;
char checksum[33];
};
class FetcherThread : public IThread
{
public:
FetcherThread();
~FetcherThread();
public:
void RunThread(IThreadHandle *pHandle);
void OnTerminate(IThreadHandle *pHandle, bool cancel);
private:
int BuildGameDataQuery(char *buffer, int maxlen);
void ProcessGameDataQuery(int SocketDescriptor);
int RecvData(int socketDescriptor, char *buffer, int len);
int SendData(int socketDescriptor, char *buffer, int len);
int ConnectSocket();
void HandleUpdateStatus(UpdateStatus status, short version[4]);
public:
SourceHook::CVector<FileData *> filenames;
bool needsRestart;
bool wasSuccess;
private:
UpdateStatus updateStatus;
BaseMemTable *memtable;
short build[4];
};
extern bool g_blockGameDataLoad;
#endif // _INCLUDE_SOURCEMOD_GAMEDATAFETCHER_H_
+70 -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
@@ -114,8 +114,6 @@ void CHalfLife2::OnSourceModAllInitialized()
m_HinTextMsg = g_UserMsgs.GetMessageIndex("HintText");
m_VGUIMenu = g_UserMsgs.GetMessageIndex("VGUIMenu");
g_ShareSys.AddInterface(NULL, this);
FindInSendTable("CTFPlayer", "m_nDisguiseClass");
}
#if !defined METAMOD_PLAPI_VERSION
@@ -437,6 +435,47 @@ bool CHalfLife2::IsLANServer()
return (sv_lan->GetInt() != 0);
}
bool CHalfLife2::KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID)
{
#if defined METAMOD_PLAPI_VERSION
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
#else
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
#endif
{
Assert(filesystem);
#ifdef _MSC_VER
Assert(_heapchk() == _HEAPOK);
#endif
FileHandle_t f = filesystem->Open(resourceName, "rb", pathID);
if (!f)
return false;
// load file into a null-terminated buffer
int fileSize = filesystem->Size(f);
char *buffer = (char *)MemAllocScratch(fileSize + 1);
Assert(buffer);
filesystem->Read(buffer, fileSize, f); // read into local buffer
buffer[fileSize] = 0; // null terminate file as EOF
filesystem->Close( f ); // close file after reading
bool retOK = kv->LoadFromBuffer( resourceName, buffer, filesystem );
MemFreeScratch();
return retOK;
}
else
{
return kv->LoadFromFile(filesystem, resourceName, pathID);
}
}
void CHalfLife2::PushCommandStack(const CCommand *cmd)
{
CachedCommandInfo info;
@@ -472,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);
}
}
+14 -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
@@ -41,6 +41,8 @@
#include "sm_queue.h"
#include <IGameHelpers.h>
#include <KeyValues.h>
#include <server_class.h>
#include <datamap.h>
class CCommand;
@@ -77,6 +79,13 @@ struct CachedCommandInfo
#endif
};
struct DelayedKickInfo
{
int userid;
int client;
char buffer[384];
};
class CHalfLife2 :
public SMGlobalClass,
public IGameHelpers
@@ -99,6 +108,7 @@ public: //IGameHelpers
bool HintTextMsg(int client, const char *msg);
bool ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show);
bool IsLANServer();
bool KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID = NULL);
public:
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
void ProcessFakeCliCmdQueue();
@@ -107,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
@@ -122,6 +134,7 @@ private:
Queue<DelayedFakeCliCmd *> m_CmdQueue;
CStack<DelayedFakeCliCmd *> m_FreeCmds;
CStack<CachedCommandInfo> m_CommandStack;
Queue<DelayedKickInfo> m_DelayedKicks;
};
extern CHalfLife2 g_HL2;
@@ -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
@@ -493,7 +493,7 @@ HandleError HandleSystem::GetHandle(Handle_t handle,
unsigned int serial = (handle >> 16);
unsigned int index = (handle & HANDLESYS_HANDLE_MASK);
if (index == 0 || index == 0xFFFF)
if (index == 0 || index > m_HandleTail || index > HANDLESYS_MAX_HANDLES)
{
return HandleError_Index;
}
@@ -910,6 +910,15 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
}
}
/* Remove it from the type cache. */
if (pType->nameIdx != -1)
{
const char *typeName;
typeName = m_strtab->GetString(pType->nameIdx);
sm_trie_delete(m_TypeLookup, typeName);
}
return true;
}
@@ -990,7 +999,7 @@ bool HandleSystem::TryAndFreeSomeHandles()
g_Logger.LogFatal("[SM] Reloading plugin to free %d handles.", highest_handle_count);
g_Logger.LogFatal("[SM] Contact the author(s) of this plugin to correct this error.", highest_handle_count);
highest_owner->GetContext()->n_err = SP_ERROR_MEMACCESS;
highest_owner->GetBaseContext()->ThrowNativeErrorEx(SP_ERROR_MEMACCESS, "Memory leak");
return g_PluginSys.UnloadPlugin(highest_owner);
}
@@ -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
@@ -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
@@ -138,7 +138,7 @@ bool CDirectory::IsEntryDirectory()
{
#if defined PLATFORM_WINDOWS
return ((m_fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
char temppath[PLATFORM_MAX_PATH];
snprintf(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName());
return g_LibSys.IsPathDirectory(temppath);
@@ -160,7 +160,7 @@ const char *CDirectory::GetEntryName()
{
#if defined PLATFORM_WINDOWS
return m_fd.cFileName;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return ep ? ep->d_name : "";
#endif
}
@@ -174,7 +174,7 @@ bool CDirectory::IsValid()
{
#if defined PLATFORM_WINDOWS
return (m_dir != INVALID_HANDLE_VALUE);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return (m_dir != NULL);
#endif
}
@@ -214,7 +214,7 @@ bool LibrarySystem::IsPathFile(const char *path)
}
return true;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
struct stat s;
if (stat(path, &s) != 0)
@@ -272,25 +272,51 @@ IDirectory *LibrarySystem::OpenDirectory(const char *path)
}
void LibrarySystem::GetPlatformError(char *error, size_t maxlength)
{
#if defined PLATFORM_WINDOWS
return GetPlatformErrorEx(GetLastError(), error, maxlength);
#elif defined PLATFORM_POSIX
return GetPlatformErrorEx(errno, error, maxlength);
#endif
}
void LibrarySystem::GetPlatformErrorEx(int code, char *error, size_t maxlength)
{
if (error && maxlength)
{
#if defined PLATFORM_WINDOWS
DWORD dw = GetLastError();
FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
(DWORD)code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)error,
maxlength,
NULL);
#elif defined PLATFORM_LINUX
const char *ae = strerror_r(code, error, maxlength);
if (ae != error)
{
UTIL_Format(error, maxlength, "%s", ae);
}
#elif defined PLATFORM_POSIX
snprintf(error, maxlength, "%s", strerror(errno));
strerror_r(code, error, maxlength);
#endif
}
}
void LibrarySystem::GetLoaderError(char *buffer, size_t maxlength)
{
#if defined PLATFORM_WINDOWS
GetPlatformError(buffer, maxlength);
#elif defined PLATFORM_POSIX
if (buffer != NULL && maxlength)
{
strncopy(buffer, dlerror(), maxlength);
}
#endif
}
void LibrarySystem::CloseDirectory(IDirectory *dir)
{
delete dir;
@@ -301,20 +327,16 @@ ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t maxle
LibraryHandle lib;
#if defined PLATFORM_WINDOWS
lib = LoadLibraryA(path);
if (!lib)
{
GetPlatformError(error, maxlength);
return false;
}
#elif defined PLATFORM_POSIX
lib = dlopen(path, RTLD_NOW);
if (!lib)
{
GetPlatformError(error, maxlength);
return false;
}
#endif
if (lib == NULL)
{
GetLoaderError(error, maxlength);
return NULL;
}
return new CLibrary(lib);
}
@@ -344,21 +366,26 @@ size_t LibrarySystem::PathFormat(char *buffer, size_t len, const char *fmt, ...)
const char *LibrarySystem::GetFileExtension(const char *filename)
{
size_t end = strlen(filename) - 1;
size_t len, end;
for (size_t i = end; i >= 0; i--)
len = strlen(filename);
/* Minimum string length for filename with ext would be 3; example: a.a */
if (len < 3)
{
if (i > end)
{
break;
}
return NULL;
}
end = len - 1;
for (size_t i = end; i <= end; i--)
{
if (filename[i] == PLATFORM_SEP_CHAR || filename[i] == PLATFORM_SEP_ALTCHAR)
{
break;
}
if (filename[i] == '.' && i != end)
if (filename[i] == '.' && i != end && i != 0)
{
return &filename[++i];
}
@@ -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
@@ -90,11 +90,13 @@ public:
bool IsPathFile(const char *path);
bool IsPathDirectory(const char *path);
void GetPlatformError(char *error, size_t maxlength);
void GetPlatformErrorEx(int code, char *error, size_t maxlength);
size_t PathFormat(char *buffer, size_t len, const char *fmt, ...);
const char *GetFileExtension(const char *filename);
bool CreateFolder(const char *path);
size_t GetFileFromPath(char *buffer, size_t maxlength, const char *path);
bool FileTime(const char *path, FileTimeType type, time_t *pTime);
void GetLoaderError(char *buffer, size_t maxlength);
};
extern LibrarySystem g_LibSys;
+35 -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
@@ -34,7 +34,7 @@
#include "sourcemm_api.h"
#include "sm_stringutil.h"
#include "Logger.h"
#include "systems/LibrarySys.h"
#include "LibrarySys.h"
#include "TimerSys.h"
#include "sm_version.h"
@@ -245,6 +245,19 @@ void Logger::LogToOpenFile(FILE *fp, const char *msg, ...)
va_end(ap);
}
void Logger::LogToFileOnly(FILE *fp, const char *msg, ...)
{
if (!m_Active)
{
return;
}
va_list ap;
va_start(ap, msg);
LogToFileOnlyEx(fp, msg, ap);
va_end(ap);
}
void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
{
if (!m_Active)
@@ -265,6 +278,26 @@ void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
g_SMAPI->ConPrintf("L %s: %s\n", date, buffer);
}
void Logger::LogToFileOnlyEx(FILE *fp, const char *msg, va_list ap)
{
if (!m_Active)
{
return;
}
char buffer[3072];
UTIL_FormatArgs(buffer, sizeof(buffer), msg, ap);
char date[32];
time_t t;
GetAdjustedTime(&t);
tm *curtime = localtime(&t);
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
fprintf(fp, "L %s: %s\n", date, buffer);
fflush(fp);
}
void Logger::LogMessage(const char *vafmt, ...)
{
if (!m_Active)
+4 -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
@@ -78,6 +78,9 @@ public:
void LogFatal(const char *msg, ...);
void LogToOpenFile(FILE *fp, const char *msg, ...);
void LogToOpenFileEx(FILE *fp, const char *msg, va_list ap);
/* This version does not print to console, and is thus thread-safe */
void LogToFileOnly(FILE *fp, const char *msg, ...);
void LogToFileOnlyEx(FILE *fp, const char *msg, va_list ap);
void MapChange(const char *mapname);
const char *GetLogFileName(LogType type) const;
LoggingMode GetLoggingMode() const;
+73 -71
View File
@@ -1,21 +1,15 @@
#(C)2004-2008 Metamod:Source Development Team
# (C)2004-2008 SourceMod Development Team
# Makefile written by David "BAILOPAN" Anderson
#Local paths
SMSDK = ..
SRCDS_BASE = ~/srcds
HL2SDK_ORIG = ../../hl2sdk
HL2SDK_OB = ../../hl2sdk-ob
SOURCEMM14 = ../../sourcemm-1.4
SOURCEMM16 = ../../sourcemm-1.6
SRCDS_BASE = ~/srcds
SMSDK = ..
#Project options
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing
GCC4_FLAGS = -fvisibility=hidden
GCC4_CPP_FLAGS = -fvisibility-inlines-hidden
DEBUG_FLAGS = -g -ggdb3
CPP = gcc-4.1
MMSOURCE17 = ../../mmsource-1.7
#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreConfig.cpp \
Database.cpp DebugReporter.cpp EventManager.cpp GameConfigs.cpp HalfLife2.cpp Logger.cpp \
@@ -23,111 +17,119 @@ OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreC
sm_autonatives.cpp sm_memtable.cpp sm_srvcmds.cpp sm_stringutil.cpp sm_trie.cpp \
sourcemm_api.cpp sourcemod.cpp MenuStyle_Base.cpp MenuStyle_Valve.cpp MenuManager.cpp \
MenuStyle_Radio.cpp ChatTriggers.cpp ADTFactory.cpp MenuVoting.cpp sm_crc32.cpp \
frame_hooks.cpp concmd_cleaner.cpp Profiler.cpp
frame_hooks.cpp concmd_cleaner.cpp Profiler.cpp PhraseCollection.cpp NextMap.cpp \
NativeOwner.cpp GameDataFetcher.cpp md5.cpp
OBJECTS += smn_admin.cpp smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \
smn_datapacks.cpp smn_entities.cpp smn_events.cpp smn_fakenatives.cpp \
smn_filesystem.cpp smn_float.cpp smn_functions.cpp smn_gameconfigs.cpp smn_halflife.cpp \
smn_handles.cpp smn_keyvalues.cpp smn_banning.cpp smn_maplists.cpp \
smn_lang.cpp smn_player.cpp smn_string.cpp smn_sorting.cpp smn_textparse.cpp smn_timers.cpp \
smn_usermsgs.cpp smn_menus.cpp smn_database.cpp smn_vector.cpp smn_adt_array.cpp \
smn_adt_trie.cpp smn_hudtext.cpp
OBJECTS += systems/ExtensionSys.cpp systems/ForwardSys.cpp systems/HandleSys.cpp \
systems/LibrarySys.cpp systems/PluginInfoDatabase.cpp systems/PluginSys.cpp \
systems/ShareSys.cpp vm/sp_vm_basecontext.cpp vm/sp_vm_function.cpp
smn_adt_trie.cpp smn_hudtext.cpp smn_adt_stack.cpp smn_nextmap.cpp
OBJECTS += ExtensionSys.cpp \
ForwardSys.cpp \
HandleSys.cpp \
LibrarySys.cpp \
PluginInfoDatabase.cpp \
PluginSys.cpp \
ShareSys.cpp
OBJECTS += thread/ThreadWorker.cpp thread/BaseWorker.cpp thread/PosixThreads.cpp ThreadSupport.cpp
OBJECTS_C = zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/gzio.c \
zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c \
zlib/uncompr.c zlib/zutil.c
OBJECTS_SM16 = vm/sp_vm_engine.cpp
##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
override ENGSET = false
ifeq "$(ENGINE)" "original"
HL2SDK = $(HL2SDK_ORIG)
HL2PUB = $(HL2SDK_ORIG)/public
HL2LIB = $(HL2SDK)/linux_sdk
METAMOD = $(SOURCEMM14)
INCLUDE += -I$(HL2PUB)/dlls
HL2LIB = $(HL2SDK_ORIG)/linux_sdk
METAMOD = $(MMSOURCE17)/core-legacy
INCLUDE += -I$(HL2SDK)/public/dlls
SRCDS = $(SRCDS_BASE)
BINARY = sourcemod.1.ep1.so
override ENGSET = true
endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK)/linux_sdk
HL2LIB = $(HL2SDK_OB)/lib/linux
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2PUB)/game/server
METAMOD = $(MMSOURCE17)/core
INCLUDE += -I$(HL2SDK)/public/game/server
SRCDS = $(SRCDS_BASE)/orangebox
BINARY = sourcemod.2.ep2.so
endif
ifeq "$(BINARY)" ""
echo "You must supply ENGINE=orangebox or ENGINE=original"
false
override ENGSET = true
endif
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
tier0_i486.so -lpthread -static-libgcc
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
INCLUDE_SMSDK = -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
-Wno-uninitialized -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSM_DEFAULT_THREADER -m32
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm \
-I$(HL2PUB)/mathlib -Isystems $(INCLUDE_SMSDK)
SM16_INCLUDE = -I. -I.. -I$(SOURCEMM16)/sourcehook $(INCLUDE_SMSDK)
################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################
ifeq "$(DEBUG)" "true"
BIN_DIR = Debug.$(ENGINE)
CFLAGS += $(DEBUG_FLAGS)
CFLAGS += $(C_DEBUG_FLAGS)
else
BIN_DIR = Release.$(ENGINE)
CFLAGS += $(OPT_FLAGS)
CFLAGS += $(C_OPT_FLAGS)
endif
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
-Dstrcmpi=strcasecmp -Wall -Wno-uninitialized -Werror -mfpmath=sse -msse \
-DSOURCEMOD_BUILD -DSM_DEFAULT_THREADER -m32
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
ifeq "$(GCC_VERSION)" "4"
CFLAGS += $(GCC4_FLAGS)
CPPFLAGS += $(GCC4_CPP_FLAGS)
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.ox)
OBJ_LINUX_C := $(OBJECTS_C:%.c=$(BIN_DIR)/%.oc)
OBJ_LINUX_SM16 := $(OBJECTS_SM16:%.cpp=$(BIN_DIR)/%.ok)
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
$(BIN_DIR)/%.ox: %.cpp
$(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
$(BIN_DIR)/%.oc: %.c
$(BIN_DIR)/%.o: %.c
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
$(BIN_DIR)/%.ok: %.cpp
$(CPP) $(SM16_INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all:
all: check
mkdir -p $(BIN_DIR)/systems
mkdir -p $(BIN_DIR)/vm
mkdir -p $(BIN_DIR)/zlib
mkdir -p $(BIN_DIR)/thread
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so;
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so;
$(MAKE) -f Makefile sourcemod
sourcemod: $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16)
$(CPP) $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
check:
if [ "$(ENGSET)" = "false" ]; then \
echo "You must supply ENGINE=orangebox or ENGINE=original"; \
exit 1; \
fi
sourcemod: check $(OBJ_LINUX)
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
debug:
$(MAKE) -f Makefile all DEBUG=true
default: all
clean:
rm -rf $(BIN_DIR)/*.ox
rm -rf $(BIN_DIR)/systems/*.ox
rm -rf $(BIN_DIR)/zlib/*.oc
rm -rf $(BIN_DIR)/vm/*.ox
rm -rf $(BIN_DIR)/thread/*.ox
clean: check
rm -rf $(BIN_DIR)/*.o
rm -rf $(BIN_DIR)/systems/*.o
rm -rf $(BIN_DIR)/thread/*.o
rm -rf $(BIN_DIR)/$(BINARY)
+1 -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
+1 -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
+28 -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
@@ -41,6 +41,7 @@
#include "ShareSys.h"
#include "HandleSys.h"
#include "sourcemm_api.h"
#include "Translator.h"
MenuManager g_Menus;
VoteMenuHandler s_VoteHandler;
@@ -585,14 +586,20 @@ skip_search:
{
if (exitBackButton)
{
CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
if (!CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Back", &client))
{
UTIL_Format(text, sizeof(text), "Back");
}
dr.style = ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_ExitBack;
}
else
{
CorePlayerTranslate(client, text, sizeof(text), "Previous", NULL);
if (!CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Previous", &client))
{
UTIL_Format(text, sizeof(text), "Previous");
}
dr.style = (displayPrev ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Back;
@@ -610,7 +617,10 @@ skip_search:
/* NEXT */
if (displayNext || canDrawDisabled)
{
CorePlayerTranslate(client, text, sizeof(text), "Next", NULL);
if (!CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Next", &client))
{
UTIL_Format(text, sizeof(text), "Next");
}
dr.style = (displayNext ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Next;
@@ -638,7 +648,10 @@ skip_search:
/* EXIT */
if (exitButton)
{
CorePlayerTranslate(client, text, sizeof(text), "Exit", NULL);
if (!CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Exit", &client))
{
UTIL_Format(text, sizeof(text), "Exit");
}
dr.style = ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Exit;
@@ -777,3 +790,13 @@ unsigned int MenuManager::GetRemainingVoteDelay()
{
return s_VoteHandler.GetRemainingVoteDelay();
}
bool MenuManager::IsClientInVotePool(int client)
{
return s_VoteHandler.IsClientInVotePool(client);
}
bool MenuManager::RedrawClientVoteMenu(int client)
{
return s_VoteHandler.RedrawToClient(client);
}
+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
@@ -89,6 +89,8 @@ public:
bool IsVoteInProgress();
void CancelVoting();
unsigned int GetRemainingVoteDelay();
bool IsClientInVotePool(int client);
bool RedrawClientVoteMenu(int client);
public: //IHandleTypeDispatch
void OnHandleDestroy(HandleType_t type, void *object);
bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize);
+1 -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
+1 -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
+1 -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
+1 -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
+1 -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
+1 -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
+89 -11
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
@@ -113,14 +113,19 @@ void VoteMenuHandler::OnClientDisconnected(int client)
return;
}
/* Wipe out their vote if they had one */
/* Wipe out their vote if they had one. We have to make sure the the the
* newly connected client is not allowed to vote.
*/
int item;
if ((item = m_ClientVotes[client]) >= 0)
if ((item = m_ClientVotes[client]) >= -1)
{
assert((unsigned)item < m_Items);
assert(m_Votes[item] > 0);
m_Votes[item]--;
m_ClientVotes[client] = -1;
if (item >= 0)
{
assert((unsigned)item < m_Items);
assert(m_Votes[item] > 0);
m_Votes[item]--;
}
m_ClientVotes[client] = -2;
}
}
@@ -129,18 +134,28 @@ bool VoteMenuHandler::IsVoteInProgress()
return (m_pCurMenu != NULL);
}
bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int clients[], unsigned int max_time, unsigned int flags/* =0 */)
bool VoteMenuHandler::StartVote(IBaseMenu *menu,
unsigned int num_clients,
int clients[],
unsigned int max_time,
unsigned int flags/* =0 */)
{
if (!InitializeVoting(menu, menu->GetHandler(), max_time, flags))
{
return false;
}
/* Note: we can use game time and not universal time because
* if we're voting then players are in-game.
*/
float fVoteDelay = sm_vote_delay.GetFloat();
if (fVoteDelay < 1.0)
{
g_next_vote = 0.0;
} else {
}
else
{
/* This little trick breaks for infinite votes!
* However, we just ignore that since those 1) shouldn't exist and
* 2) people must be checking IsVoteInProgress() beforehand anyway.
@@ -148,8 +163,15 @@ bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int c
g_next_vote = gpGlobals->curtime + fVoteDelay + (float)max_time;
}
m_fStartTime = gpGlobals->curtime;
m_nMenuTime = max_time;
for (unsigned int i=0; i<num_clients; i++)
{
if (clients[i] < 1 || clients[i] > 256)
{
continue;
}
menu->Display(clients[i], max_time, this);
}
@@ -158,6 +180,58 @@ bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int c
return true;
}
bool VoteMenuHandler::IsClientInVotePool(int client)
{
if (client < 1
|| client > g_Players.MaxClients()
|| m_pCurMenu == NULL)
{
return false;
}
return (m_ClientVotes[client] > -2);
}
bool VoteMenuHandler::GetClientVoteChoice(int client, unsigned int *pItem)
{
if (!IsClientInVotePool(client)
|| m_ClientVotes[client] == -1)
{
return false;
}
*pItem = m_ClientVotes[client];
return true;
}
bool VoteMenuHandler::RedrawToClient(int client)
{
unsigned int time_limit;
if (!IsClientInVotePool(client))
{
return false;
}
if (m_nMenuTime == MENU_TIME_FOREVER)
{
time_limit = m_nMenuTime;
}
else
{
time_limit = (int)((float)m_nMenuTime - (gpGlobals->curtime - m_fStartTime));
/* Make sure this doesn't round to zero */
if (time_limit == MENU_TIME_FOREVER)
{
time_limit = 1;
}
}
return m_pCurMenu->Display(client, time_limit, this);
}
bool VoteMenuHandler::InitializeVoting(IBaseMenu *menu,
IMenuHandler *handler,
unsigned int time,
@@ -187,7 +261,9 @@ bool VoteMenuHandler::InitializeVoting(IBaseMenu *menu,
m_Votes[i] = 0;
}
m_Votes.resize(m_Items, 0);
} else {
}
else
{
for (unsigned int i=0; i<m_Items; i++)
{
m_Votes[i] = 0;
@@ -252,7 +328,9 @@ void VoteMenuHandler::EndVoting()
if (fVoteDelay < 1.0)
{
g_next_vote = 0.0;
} else {
}
else
{
g_next_vote = gpGlobals->curtime + fVoteDelay;
}
+6 -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
@@ -72,6 +72,9 @@ public:
IBaseMenu *GetCurrentMenu();
bool IsCancelling();
unsigned int GetRemainingVoteDelay();
bool IsClientInVotePool(int client);
bool GetClientVoteChoice(int client, unsigned int *pItem);
bool RedrawToClient(int client);
private:
void Reset(IMenuHandler *mh);
void DecrementPlayerCount();
@@ -93,6 +96,8 @@ private:
unsigned int m_NumVotes;
unsigned int m_VoteTime;
unsigned int m_VoteFlags;
float m_fStartTime;
unsigned int m_nMenuTime;
int m_ClientVotes[256+1];
};
+144
View File
@@ -0,0 +1,144 @@
#include "NativeOwner.h"
#include "ShareSys.h"
#include "PluginSys.h"
CNativeOwner::CNativeOwner() : m_nMarkSerial(0)
{
}
void CNativeOwner::SetMarkSerial(unsigned int serial)
{
m_nMarkSerial = serial;
}
unsigned int CNativeOwner::GetMarkSerial()
{
return m_nMarkSerial;
}
void CNativeOwner::AddDependent(CPlugin *pPlugin)
{
m_Dependents.push_back(pPlugin);
}
void CNativeOwner::AddWeakRef(const WeakNative & ref)
{
m_WeakRefs.push_back(ref);
}
void CNativeOwner::AddNatives(const sp_nativeinfo_t *natives)
{
NativeEntry *pEntry;
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((pEntry = g_ShareSys.AddNativeToCache(this, &natives[i])) == NULL)
{
continue;
}
m_Natives.push_back(pEntry);
}
}
void CNativeOwner::PropogateMarkSerial(unsigned int serial)
{
CNativeOwner *pOwner;
List<CPlugin *>::iterator iter;
for (iter = m_Dependents.begin();
iter != m_Dependents.end();
iter++)
{
pOwner = (*iter);
pOwner->SetMarkSerial(serial);
}
}
void CNativeOwner::UnbindWeakRef(const WeakNative & ref)
{
sp_native_t *native;
IPluginContext *pContext;
pContext = ref.pl->GetBaseContext();
if ((pContext->GetNativeByIndex(ref.idx, &native)) == SP_ERROR_NONE)
{
/* If there is no reference, the native must be unbound */
if (ref.entry == NULL)
{
native->status = SP_NATIVE_UNBOUND;
native->pfn = NULL;
}
/* If we've cached a reference, it's a core native we can
* rebind back to its original (this was a replacement).
*/
else
{
native->pfn = ref.entry->func;
}
}
}
void CNativeOwner::DropEverything()
{
NativeEntry *pEntry;
List<WeakNative>::iterator iter;
List<NativeEntry *>::iterator ntv_iter;
/* Unbind and remove all weak references to us */
iter = m_WeakRefs.begin();
while (iter != m_WeakRefs.end())
{
UnbindWeakRef((*iter));
iter = m_WeakRefs.erase(iter);
}
/* Unmark our replacement natives */
ntv_iter = m_ReplacedNatives.begin();
while (ntv_iter != m_ReplacedNatives.end())
{
pEntry = (*ntv_iter);
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
ntv_iter = m_ReplacedNatives.erase(ntv_iter);
}
/* Strip all of our natives from the cache */
ntv_iter = m_Natives.begin();
while (ntv_iter != m_Natives.end())
{
g_ShareSys.ClearNativeFromCache(this, (*ntv_iter)->name);
ntv_iter = m_Natives.erase(ntv_iter);
}
}
void CNativeOwner::DropWeakRefsTo(CPlugin *pPlugin)
{
List<WeakNative>::iterator iter;
iter = m_WeakRefs.begin();
while (iter != m_WeakRefs.end())
{
WeakNative & ref = (*iter);
if (ref.pl == pPlugin)
{
iter = m_WeakRefs.erase(iter);
}
else
{
iter++;
}
}
}
void CNativeOwner::DropRefsTo(CPlugin *pPlugin)
{
m_Dependents.remove(pPlugin);
DropWeakRefsTo(pPlugin);
}
void CNativeOwner::AddReplacedNative(NativeEntry *pEntry)
{
m_ReplacedNatives.push_back(pEntry);
}
+59
View File
@@ -0,0 +1,59 @@
#ifndef _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
#define _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
#include <sp_vm_types.h>
#include <sh_list.h>
class CPlugin;
struct NativeEntry;
struct WeakNative
{
WeakNative(CPlugin *plugin, uint32_t index) :
pl(plugin), idx(index), entry(NULL)
{
pl = plugin;
idx = index;
}
WeakNative(CPlugin *plugin, uint32_t index, NativeEntry *pEntry) :
pl(plugin), idx(index), entry(pEntry)
{
pl = plugin;
idx = index;
}
CPlugin *pl;
uint32_t idx;
NativeEntry *entry;
};
using namespace SourceHook;
class CNativeOwner
{
public:
CNativeOwner();
public:
virtual void DropEverything();
public:
void AddNatives(const sp_nativeinfo_t *info);
public:
void SetMarkSerial(unsigned int serial);
unsigned int GetMarkSerial();
void PropogateMarkSerial(unsigned int serial);
public:
void AddDependent(CPlugin *pPlugin);
void AddWeakRef(const WeakNative & ref);
void DropRefsTo(CPlugin *pPlugin);
void AddReplacedNative(NativeEntry *pEntry);
private:
void DropWeakRefsTo(CPlugin *pPlugin);
void UnbindWeakRef(const WeakNative & ref);
protected:
List<CPlugin *> m_Dependents;
unsigned int m_nMarkSerial;
List<WeakNative> m_WeakRefs;
List<NativeEntry *> m_Natives;
List<NativeEntry *> m_ReplacedNatives;
};
#endif //_INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
+225
View File
@@ -0,0 +1,225 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "NextMap.h"
#include "Logger.h"
#include "sourcemm_api.h"
#include "sm_stringutil.h"
#include "sourcehook.h"
#include "sm_srvcmds.h"
NextMapManager g_NextMap;
SH_DECL_HOOK2_void(IVEngineServer, ChangeLevel, SH_NOATTRIB, 0, const char *, const char *);
#if defined ORANGEBOX_BUILD
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
ConCommand *changeLevelCmd = NULL;
ConVar sm_nextmap("sm_nextmap", "", FCVAR_NOTIFY);
bool g_forcedChange = false;
void NextMapManager::OnSourceModAllInitialized_Post()
{
#if defined ORANGEBOX_BUILD
SH_ADD_HOOK(IVEngineServer, ChangeLevel, engine, SH_MEMBER(this, &NextMapManager::HookChangeLevel), false);
#else
SH_ADD_HOOK_MEMFUNC(IVEngineServer, ChangeLevel, engine, this, &NextMapManager::HookChangeLevel, false);
#endif
ConCommandBase *pBase = icvar->GetCommands();
ConCommand *pCmd = NULL;
while (pBase)
{
if (strcmp(pBase->GetName(), "changelevel") == 0)
{
/* Don't want to return convar with same name */
if (!pBase->IsCommand())
{
break;
}
pCmd = (ConCommand *)pBase;
break;
}
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
}
if (pCmd != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, pCmd, CmdChangeLevelCallback, false);
changeLevelCmd = pCmd;
}
}
void NextMapManager::OnSourceModShutdown()
{
#if defined ORANGEBOX_BUILD
SH_REMOVE_HOOK(IVEngineServer, ChangeLevel, engine, SH_MEMBER(this, &NextMapManager::HookChangeLevel), false);
#else
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, ChangeLevel, engine, this, &NextMapManager::HookChangeLevel, false);
#endif
if (changeLevelCmd != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, changeLevelCmd, CmdChangeLevelCallback, false);
}
SourceHook::List<MapChangeData *>::iterator iter;
iter = m_mapHistory.begin();
while (iter != m_mapHistory.end())
{
delete (MapChangeData *)*iter;
iter = m_mapHistory.erase(iter);
}
}
const char *NextMapManager::GetNextMap()
{
return sm_nextmap.GetString();
}
bool NextMapManager::SetNextMap(const char *map)
{
if (!engine->IsMapValid(map))
{
return false;
}
sm_nextmap.SetValue(map);
return true;
}
void NextMapManager::HookChangeLevel(const char *map, const char *unknown)
{
if (g_forcedChange)
{
g_Logger.LogMessage("[SM] Changed map to \"%s\"", map);
RETURN_META(MRES_IGNORED);
}
const char *newmap = sm_nextmap.GetString();
if (newmap[0] == 0 || !engine->IsMapValid(newmap))
{
RETURN_META(MRES_IGNORED);
}
g_Logger.LogMessage("[SM] Changed map to \"%s\"", newmap);
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), newmap);
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), "Normal level change");
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::ChangeLevel, (newmap, unknown));
}
void NextMapManager::OnSourceModLevelChange( const char *mapName )
{
/* Skip the first 'mapchange' when the server starts up */
if (m_tempChangeInfo.startTime != 0)
{
if (strcmp(mapName, m_tempChangeInfo.m_mapName) == 0)
{
/* The map change was as we expected */
m_mapHistory.push_back(new MapChangeData(lastMap, m_tempChangeInfo.m_changeReason, m_tempChangeInfo.startTime));
}
else
{
/* Something intercepted the mapchange */
char newReason[255];
UTIL_Format(newReason, sizeof(newReason), "%s (Map overridden)", m_tempChangeInfo.m_changeReason);
m_mapHistory.push_back(new MapChangeData(lastMap, newReason, m_tempChangeInfo.startTime));
}
/* TODO: Should this be customizable? */
if (m_mapHistory.size() > 20)
{
SourceHook::List<MapChangeData *>::iterator iter;
iter = m_mapHistory.begin();
delete (MapChangeData *)*iter;
m_mapHistory.erase(iter);
}
}
m_tempChangeInfo.m_mapName[0] ='\0';
m_tempChangeInfo.m_changeReason[0] = '\0';
m_tempChangeInfo.startTime = time(NULL);
UTIL_Format(lastMap, sizeof(lastMap), mapName);
}
void NextMapManager::ForceChangeLevel( const char *mapName, const char* changeReason )
{
/* Store the mapname and reason */
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), mapName);
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), changeReason);
/* Change level and skip our hook */
g_forcedChange = true;
engine->ChangeLevel(mapName, NULL);
g_forcedChange = false;
}
NextMapManager::NextMapManager()
{
m_tempChangeInfo = MapChangeData();
m_mapHistory = SourceHook::List<MapChangeData *>();
}
#if defined ORANGEBOX_BUILD
void CmdChangeLevelCallback(const CCommand &command)
{
#else
void CmdChangeLevelCallback()
{
CCommand command;
#endif
if (command.ArgC() < 2)
{
return;
}
if (g_NextMap.m_tempChangeInfo.m_mapName[0] == '\0')
{
UTIL_Format(g_NextMap.m_tempChangeInfo.m_mapName, sizeof(g_NextMap.m_tempChangeInfo.m_mapName), command.Arg(1));
UTIL_Format(g_NextMap.m_tempChangeInfo.m_changeReason, sizeof(g_NextMap.m_tempChangeInfo.m_changeReason), "changelevel Command");
}
}
+99
View File
@@ -0,0 +1,99 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_NEXTMAP_H_
#define _INCLUDE_SOURCEMOD_NEXTMAP_H_
#include "sm_globals.h"
#include "eiface.h"
#include "sh_list.h"
#include "sm_stringutil.h"
struct MapChangeData
{
MapChangeData(const char *mapName, const char *changeReason, time_t time)
{
UTIL_Format(m_mapName, sizeof(m_mapName), mapName);
UTIL_Format(m_changeReason, sizeof(m_changeReason), changeReason);
startTime = time;
}
MapChangeData()
{
m_mapName[0] = '\0';
m_changeReason[0] = '\0';
startTime = 0;
}
char m_mapName[32];
char m_changeReason[100];
time_t startTime;
};
#if defined ORANGEBOX_BUILD
void CmdChangeLevelCallback(const CCommand &command);
#else
void CmdChangeLevelCallback();
#endif
class NextMapManager : public SMGlobalClass
{
public:
NextMapManager();
#if defined ORANGEBOX_BUILD
friend void CmdChangeLevelCallback(const CCommand &command);
#else
friend void CmdChangeLevelCallback();
#endif
void OnSourceModAllInitialized_Post();
void OnSourceModShutdown();
void OnSourceModLevelChange(const char *mapName);
const char *GetNextMap();
bool SetNextMap(const char *map);
void ForceChangeLevel(const char *mapName, const char* changeReason);
void HookChangeLevel(const char *map, const char *unknown);
public:
SourceHook::List<MapChangeData *> m_mapHistory;
private:
MapChangeData m_tempChangeInfo;
char lastMap[32];
};
extern NextMapManager g_NextMap;
#endif //_INCLUDE_SOURCEMOD_NEXTMAP_H_
+131
View File
@@ -0,0 +1,131 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "PhraseCollection.h"
#include "Translator.h"
#include "sm_stringutil.h"
CPhraseCollection::CPhraseCollection()
{
}
CPhraseCollection::~CPhraseCollection()
{
}
void CPhraseCollection::Destroy()
{
delete this;
}
IPhraseFile *CPhraseCollection::AddPhraseFile(const char *filename)
{
size_t i;
unsigned int fid;
IPhraseFile *pFile;
char full_name[PLATFORM_MAX_PATH];
/* No compat shim here. The user should have read the doc. */
UTIL_Format(full_name, sizeof(full_name), "%s.txt", filename);
fid = g_Translator.FindOrAddPhraseFile(full_name);
pFile = g_Translator.GetFileByIndex(fid);
for (i = 0; i < m_Files.size(); i++)
{
if (m_Files[i] == pFile)
{
return pFile;
}
}
m_Files.push_back(pFile);
return pFile;
}
unsigned int CPhraseCollection::GetFileCount()
{
return (unsigned int)m_Files.size();
}
IPhraseFile *CPhraseCollection::GetFile(unsigned int file)
{
if (file >= m_Files.size())
{
return NULL;
}
return m_Files[file];
}
TransError CPhraseCollection::FindTranslation(const char *key, unsigned int langid, Translation *pTrans)
{
size_t i;
for (i = 0; i < m_Files.size(); i++)
{
if (m_Files[i]->GetTranslation(key, langid, pTrans) == Trans_Okay)
{
return Trans_Okay;
}
}
return Trans_BadPhrase;
}
bool CPhraseCollection::FormatString(char *buffer,
size_t maxlength,
const char *format,
void **params,
unsigned int numparams,
size_t *pOutLength,
const char **pFailPhrase)
{
unsigned int arg;
arg = 0;
if (!gnprintf(buffer, maxlength, format, this, params, numparams, arg, pOutLength, pFailPhrase))
{
return false;
}
if (arg != numparams)
{
if (pFailPhrase != NULL)
{
*pFailPhrase = NULL;
}
return false;
}
return true;
}
+65
View File
@@ -0,0 +1,65 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_
#define _INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_
#include <string.h>
#include <sh_vector.h>
#include <ITranslator.h>
using namespace SourceHook;
using namespace SourceMod;
class CPhraseCollection : public IPhraseCollection
{
public:
CPhraseCollection();
~CPhraseCollection();
public:
IPhraseFile *AddPhraseFile(const char *filename);
unsigned int GetFileCount();
IPhraseFile *GetFile(unsigned int file);
void Destroy();
TransError FindTranslation(const char *key, unsigned int langid, Translation *pTrans);
bool FormatString(
char *buffer,
size_t maxlength,
const char *format,
void **params,
unsigned int numparams,
size_t *pOutLength,
const char **pFailPhrase);
private:
CVector<IPhraseFile *> m_Files;
};
#endif //_INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_
+220 -61
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
@@ -46,12 +46,14 @@
#include <inetchannel.h>
#include <iclient.h>
#include "GameConfigs.h"
#include "ExtensionSys.h"
PlayerManager g_Players;
bool g_OnMapStarted = false;
IForward *PreAdminCheck = NULL;
IForward *PostAdminCheck = NULL;
IForward *PostAdminFilter = NULL;
IForward *OnClientConnected = NULL;
const unsigned int *g_NumPlayersToAuth = NULL;
int lifestate_offset = -1;
List<ICommandTargetProcessor *> target_processors;
@@ -67,6 +69,15 @@ SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *)
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t *);
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
#if defined ORANGEBOX_BUILD
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
ConCommand *maxplayersCmd = NULL;
class KickPlayerTimer : public ITimedEvent
{
public:
@@ -120,7 +131,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);
@@ -129,10 +140,40 @@ void PlayerManager::OnSourceModAllInitialized()
m_clauth = g_Forwards.CreateForward("OnClientAuthorized", ET_Ignore, 2, NULL, Param_Cell, Param_String);
m_onActivate = g_Forwards.CreateForward("OnServerLoad", ET_Ignore, 0, NULL);
m_onActivate2 = g_Forwards.CreateForward("OnMapStart", ET_Ignore, 0, NULL);
OnClientConnected = g_Forwards.CreateForward("OnClientConnected", ET_Ignore, 1, p2);
PreAdminCheck = g_Forwards.CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1);
PostAdminCheck = g_Forwards.CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1);
PostAdminFilter = g_Forwards.CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1);
m_bIsListenServer = !engine->IsDedicatedServer();
m_ListenClient = 0;
g_ConVarManager.AddConVarChangeListener("tv_enable", this);
ConCommandBase *pBase = icvar->GetCommands();
ConCommand *pCmd = NULL;
while (pBase)
{
if (strcmp(pBase->GetName(), "maxplayers") == 0)
{
/* Don't want to return convar with same name */
if (!pBase->IsCommand())
{
break;
}
pCmd = (ConCommand *)pBase;
break;
}
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
}
if (pCmd != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, pCmd, CmdMaxplayersCallback, true);
maxplayersCmd = pCmd;
}
}
void PlayerManager::OnSourceModShutdown()
@@ -155,12 +196,20 @@ void PlayerManager::OnSourceModShutdown()
g_Forwards.ReleaseForward(m_clauth);
g_Forwards.ReleaseForward(m_onActivate);
g_Forwards.ReleaseForward(m_onActivate2);
g_Forwards.ReleaseForward(OnClientConnected);
g_Forwards.ReleaseForward(PreAdminCheck);
g_Forwards.ReleaseForward(PostAdminCheck);
g_Forwards.ReleaseForward(PostAdminFilter);
delete [] m_Players;
g_ConVarManager.RemoveConVarChangeListener("tv_enable", this);
if (maxplayersCmd != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, maxplayersCmd, CmdMaxplayersCallback, true);
}
}
ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
@@ -198,14 +247,17 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
/* Initialize all players */
m_maxClients = clientMax;
m_PlayerCount = 0;
m_Players = new CPlayer[m_maxClients + 1];
m_AuthQueue = new unsigned int[m_maxClients + 1];
m_Players = new CPlayer[ABSOLUTE_PLAYER_LIMIT + 1];
m_AuthQueue = new unsigned int[ABSOLUTE_PLAYER_LIMIT + 1];
m_FirstPass = true;
memset(m_AuthQueue, 0, sizeof(unsigned int) * (m_maxClients + 1));
memset(m_AuthQueue, 0, sizeof(unsigned int) * (ABSOLUTE_PLAYER_LIMIT + 1));
g_NumPlayersToAuth = &m_AuthQueue[0];
g_PluginSys.SyncMaxClients(clientMax);
}
g_Extensions.CallOnCoreMapStart(pEdictList, edictCount, clientMax);
m_onActivate->Execute(NULL);
m_onActivate2->Execute(NULL);
@@ -220,6 +272,13 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
g_OnMapStarted = true;
SMGlobalClass *cls = SMGlobalClass::head;
while (cls)
{
cls->OnSourceModLevelActivated();
cls = cls->m_pGlobalClassNext;
}
SM_ExecuteAllConfigs();
}
@@ -283,7 +342,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))
@@ -357,6 +416,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;
@@ -371,23 +431,28 @@ 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;
}
} else {
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
}
else
{
if (!pPlayer->IsFakeClient())
{
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
}
return true;
}
@@ -396,7 +461,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)
{
@@ -411,6 +476,21 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
break;
}
}
if (!pPlayer->IsFakeClient()
&& m_bIsListenServer
&& strncmp(pszAddress, "127.0.0.1", 9) == 0)
{
m_ListenClient = client;
}
cell_t res;
OnClientConnected->PushCell(client);
OnClientConnected->Execute(&res, NULL);
}
else
{
InvalidatePlayer(pPlayer);
}
return true;
@@ -420,8 +500,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())
{
@@ -429,6 +509,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 */
@@ -480,7 +561,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
}
}
m_Players[client].Connect();
pPlayer->Connect();
m_PlayerCount++;
List<IClientListener *>::iterator iter;
@@ -494,9 +575,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();
}
}
@@ -517,17 +598,20 @@ 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);
} else {
}
else
{
/* We don't care, prevent a double call */
return;
}
if (m_Players[client].WasCountedAsInGame())
if (pPlayer->WasCountedAsInGame())
{
m_PlayerCount--;
}
@@ -540,29 +624,12 @@ 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;
}
}
}
InvalidatePlayer(pPlayer);
m_Players[client].Disconnect();
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = 0;
if (m_ListenClient == client)
{
m_ListenClient = 0;
}
}
void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
@@ -592,9 +659,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;
}
@@ -646,8 +713,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;
}
@@ -655,42 +723,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();
}
}
}
@@ -841,6 +909,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
@@ -1166,6 +1261,68 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
}
}
void PlayerManager::OnConVarChanged( ConVar *pConVar, const char *oldValue, float flOldValue )
{
if (pConVar->GetBool() && !atoi(oldValue))
{
MaxPlayersChanged(gpGlobals->maxClients + 1);
}
else
{
MaxPlayersChanged();
}
}
void PlayerManager::OnSourceModMaxPlayersChanged( int newvalue )
{
m_maxClients = newvalue;
}
void PlayerManager::MaxPlayersChanged( int newvalue /*= -1*/ )
{
if (newvalue == -1)
{
newvalue = gpGlobals->maxClients;
}
if (newvalue == MaxClients())
{
return;
}
/* Notify the rest of core */
SMGlobalClass *pBase = SMGlobalClass::head;
while (pBase)
{
pBase->OnSourceModMaxPlayersChanged(newvalue);
pBase = pBase->m_pGlobalClassNext;
}
/* Notify Extensions */
List<IClientListener *>::iterator iter;
IClientListener *pListener = NULL;
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
pListener = (*iter);
if (pListener->GetClientListenerVersion() >= 8)
{
pListener->OnMaxPlayersChanged(newvalue);
}
}
}
#if defined ORANGEBOX_BUILD
void CmdMaxplayersCallback(const CCommand &command)
{
#else
void CmdMaxplayersCallback()
{
#endif
g_Players.MaxPlayersChanged();
}
/*******************
*** PLAYER CODE ***
*******************/
@@ -1182,7 +1339,8 @@ CPlayer::CPlayer()
m_bAdminCheckSignalled = false;
m_bIsInKickQueue = false;
m_LastPassword.clear();
m_LangId = LANGUAGE_ENGLISH;
m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
m_bFakeClient = false;
}
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
@@ -1250,6 +1408,7 @@ void CPlayer::Disconnect()
m_bAdminCheckSignalled = false;
m_UserId = -1;
m_bIsInKickQueue = false;
m_bFakeClient = false;
}
void CPlayer::SetName(const char *name)
@@ -1314,7 +1473,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)
@@ -1480,7 +1639,7 @@ void CPlayer::DoBasicAdminChecks()
}
}
/* Check IP address */
/* Check steam id */
if ((id = g_Admins.FindAdminByIdentity("steam", m_AuthID.c_str())) != INVALID_ADMIN_ID)
{
if (g_Players.CheckSetAdmin(client, this, id))
+22 -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
@@ -41,6 +41,7 @@
#include <sh_string.h>
#include <sh_list.h>
#include <sh_vector.h>
#include "ConVarManager.h"
using namespace SourceHook;
@@ -105,11 +106,13 @@ private:
int m_iIndex;
unsigned int m_LangId;
int m_UserId;
bool m_bFakeClient;
};
class PlayerManager :
public SMGlobalClass,
public IPlayerManager
public IPlayerManager,
public IConVarChangeListener
{
friend class CPlayer;
public:
@@ -120,6 +123,7 @@ public: //SMGlobalClass
void OnSourceModShutdown();
void OnSourceModLevelEnd();
ConfigResult OnSourceModConfigChanged(const char *key, const char *value, ConfigSource source, char *error, size_t maxlength);
void OnSourceModMaxPlayersChanged(int newvalue);
public:
CPlayer *GetPlayerByIndex(int client) const;
void RunAuthChecks();
@@ -152,6 +156,8 @@ public: //IPlayerManager
void RegisterCommandTargetProcessor(ICommandTargetProcessor *pHandler);
void UnregisterCommandTargetProcessor(ICommandTargetProcessor *pHandler);
void ProcessCommandTarget(cmd_target_info_t *info);
public: // IConVarChangeListener
void OnConVarChanged(ConVar *pConVar, const char *oldValue, float flOldValue);
public:
inline int MaxClients()
{
@@ -161,14 +167,20 @@ public:
{
return m_PlayerCount;
}
inline int ListenClient()
{
return m_ListenClient;
}
bool CheckSetAdmin(int index, CPlayer *pPlayer, AdminId id);
bool CheckSetAdminName(int index, CPlayer *pPlayer, AdminId id);
const char *GetPassInfoVar();
void RecheckAnyAdmins();
unsigned int GetReplyTo();
unsigned int SetReplyTo(unsigned int reply);
void MaxPlayersChanged(int newvalue = -1);
private:
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
void InvalidatePlayer(CPlayer *pPlayer);
private:
List<IClientListener *> m_hooks;
IForward *m_clconnect;
@@ -188,8 +200,16 @@ private:
unsigned int *m_AuthQueue;
String m_PassInfoVar;
bool m_QueryLang;
bool m_bIsListenServer;
int m_ListenClient;
};
#if defined ORANGEBOX_BUILD
void CmdMaxplayersCallback(const CCommand &command);
#else
void CmdMaxplayersCallback();
#endif
extern PlayerManager g_Players;
extern bool g_OnMapStarted;
extern const unsigned int *g_NumPlayersToAuth;
@@ -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
@@ -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
File diff suppressed because it is too large Load Diff
+26 -91
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,6 @@
#include <sh_vector.h>
#include <sh_string.h>
#include "sm_globals.h"
#include "vm/sp_vm_basecontext.h"
#include "PluginInfoDatabase.h"
#include "sm_trie.h"
#include "sourcemod.h"
@@ -53,6 +52,9 @@
#else
#include "convar_sm.h"
#endif
#include "ITranslator.h"
#include "NativeOwner.h"
#include "ShareSys.h"
using namespace SourceHook;
@@ -106,27 +108,6 @@ using namespace SourceHook;
* 7. Once all plugins are deemed to be loaded, OnPluginStart() is called
*/
#define SM_CONTEXTVAR_MYSELF 0
struct ContextPair
{
ContextPair() : base(NULL), ctx(NULL), co(NULL)
{
};
BaseContext *base;
sp_context_t *ctx;
ICompilation *co;
IVirtualMachine *vm;
};
struct FakeNative
{
IPluginContext *ctx;
IPluginFunction *call;
String name;
SPVM_NATIVE_FUNC func;
};
enum LoadRes
{
LoadRes_Successful,
@@ -143,18 +124,10 @@ struct AutoConfig
};
class CPlugin;
struct WeakNative
{
WeakNative(CPlugin *plugin, uint32_t index)
{
pl = plugin;
idx = index;
}
CPlugin *pl;
uint32_t idx;
};
class CPlugin : public IPlugin
class CPlugin :
public IPlugin,
public CNativeOwner
{
friend class CPluginManager;
friend class CFunction;
@@ -165,17 +138,19 @@ public:
PluginType GetType();
SourcePawn::IPluginContext *GetBaseContext();
sp_context_t *GetContext();
const sm_plugininfo_t *GetPublicInfo();
void *GetPluginStructure();
const char *GetFilename();
bool IsDebugging();
PluginStatus GetStatus();
const sm_plugininfo_t *GetPublicInfo();
bool SetPauseState(bool paused);
unsigned int GetSerial();
const sp_plugin_t *GetPluginStructure();
IdentityToken_t *GetIdentity();
unsigned int CalcMemUsage();
bool SetProperty(const char *prop, void *ptr);
bool GetProperty(const char *prop, void **ptr, bool remove=false);
void DropEverything();
SourcePawn::IPluginRuntime *GetRuntime();
public:
/**
* Creates a plugin object with default values.
@@ -186,16 +161,6 @@ public:
*/
static CPlugin *CreatePlugin(const char *file, char *error, size_t maxlength);
public:
/**
* Starts the initial compilation of a plugin.
* Returns false if another compilation exists or there is a current context set.
*/
ICompilation *StartMyCompile(IVirtualMachine *vm);
/**
* Finalizes a compilation. If error buffer is NULL, the error is saved locally.
*/
bool FinishMyCompile(char *error, size_t maxlength);
void CancelMyCompile();
/**
* Sets an error state on the plugin
@@ -233,30 +198,15 @@ public:
*/
void Call_OnAllPluginsLoaded();
/**
* Toggles debug mode in the plugin
*/
bool ToggleDebugMode(bool debug, char *error, size_t maxlength);
/**
* Returns true if a plugin is usable.
*/
bool IsRunnable();
/**
* Adds a language file index to the plugin's list.
* Get languages info.
*/
void AddLangFile(unsigned int index);
/**
* Get language file count for this plugin.
*/
size_t GetLangFileCount();
/**
* Get language file index based on the vector index.
*/
unsigned int GetLangFileByIndex(unsigned int index);
IPhraseCollection *GetPhrases();
public:
/**
* Returns the modification time during last plugin load.
@@ -275,6 +225,7 @@ public:
Handle_t GetMyHandle();
bool AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
void AddConfig(bool autoCreate, const char *cfg, const char *folder);
unsigned int GetConfigCount();
AutoConfig *GetConfig(unsigned int i);
@@ -283,28 +234,23 @@ public:
m_Libraries.push_back(name);
}
void LibraryActions(bool dropping);
void SyncMaxClients(int max_clients);
protected:
void UpdateInfo();
bool UpdateInfo();
void SetTimeStamp(time_t t);
void DependencyDropped(CPlugin *pOwner);
private:
ContextPair m_ctx;
PluginType m_type;
char m_filename[PLATFORM_MAX_PATH];
PluginStatus m_status;
unsigned int m_serial;
sm_plugininfo_t m_info;
sp_plugin_t *m_plugin;
char m_errormsg[256];
time_t m_LastAccess;
IdentityToken_t *m_ident;
Handle_t m_handle;
bool m_WasRunning;
CVector<unsigned int> m_PhraseFiles;
List<CPlugin *> m_dependents;
List<CPlugin *> m_dependsOn;
List<FakeNative *> m_fakeNatives;
List<WeakNative> m_WeakNatives;
IPhraseCollection *m_pPhrases;
List<String> m_RequiredLibs;
List<String> m_Libraries;
Trie *m_pProps;
@@ -312,6 +258,11 @@ private:
bool m_LibraryMissing;
CVector<AutoConfig *> m_configs;
bool m_bGotAllLoaded;
int m_FileVersion;
char m_DateTime[256];
IPluginRuntime *m_pRuntime;
IPluginContext *m_pContext;
sp_pubvar_t *m_MaxClientsVar;
};
class CPluginManager :
@@ -358,6 +309,7 @@ public: //IPluginManager
public: //SMGlobalClass
void OnSourceModAllInitialized();
void OnSourceModShutdown();
void OnSourceModMaxPlayersChanged(int newvalue);
public: //IHandleTypeDispatch
void OnHandleDestroy(HandleType_t type, void *object);
bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize);
@@ -390,11 +342,6 @@ public:
*/
bool IsLateLoadTime() const;
/**
* Adds natives from core into the native pool.
*/
void RegisterNativesFromCore(sp_nativeinfo_t *natives);
/**
* Converts a Handle to an IPlugin if possible.
*/
@@ -410,10 +357,7 @@ public:
/**
* Internal version of FindPluginByContext()
*/
inline CPlugin *GetPluginByCtx(const sp_context_t *ctx)
{
return reinterpret_cast<CPlugin *>(ctx->user[SM_CONTEXTVAR_MYSELF]);
}
CPlugin *GetPluginByCtx(const sp_context_t *ctx);
/**
* Gets status text for a status code
@@ -449,6 +393,8 @@ public:
void UnloadAll();
CPlugin *FindPluginByConsoleArg(const char *arg);
void SyncMaxClients(int max_clients);
private:
LoadRes _LoadPlugin(CPlugin **pPlugin, const char *path, bool debug, PluginType type, char error[], size_t maxlength);
@@ -469,11 +415,6 @@ private:
*/
bool RunSecondPass(CPlugin *pPlugin, char *error, size_t maxlength);
/**
* Adds any globally registered natives to a plugin
*/
void AddCoreNativesToPlugin(CPlugin *pPlugin);
/**
* Runs an extension pass on a plugin.
*/
@@ -495,11 +436,7 @@ public:
{
return m_MyIdent;
}
public:
bool AddFakeNative(IPluginFunction *pFunction, const char *name, SPVM_FAKENATIVE_FUNC func);
SPVM_NATIVE_FUNC FindCoreNative(const char *name);
private:
void AddFakeNativesToPlugin(CPlugin *pPlugin);
void TryRefreshDependencies(CPlugin *pOther);
private:
List<IPluginsListener *> m_listeners;
@@ -509,11 +446,9 @@ private:
Trie *m_LoadLookup;
bool m_AllPluginsLoaded;
IdentityToken_t *m_MyIdent;
Trie *m_pCoreNatives;
/* Dynamic native stuff */
List<FakeNative *> m_Natives;
Trie *m_pNativeLookup;
bool m_LoadingLocked;
};
+1 -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
+1 -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
+529
View File
@@ -0,0 +1,529 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "ShareSys.h"
#include "HandleSys.h"
#include "ExtensionSys.h"
#include "LibrarySys.h"
#include "PluginSys.h"
#include "sm_stringutil.h"
ShareSystem g_ShareSys;
static unsigned int g_mark_serial = 0;
ShareSystem::ShareSystem()
{
m_IdentRoot.ident = 0;
m_TypeRoot = 0;
m_IfaceType = 0;
m_CoreType = 0;
}
IdentityToken_t *ShareSystem::CreateCoreIdentity()
{
if (!m_CoreType)
{
m_CoreType = CreateIdentType("CORE");
}
return CreateIdentity(m_CoreType, this);
}
void ShareSystem::Initialize()
{
TypeAccess sec;
g_HandleSys.InitAccessDefaults(&sec, NULL);
sec.ident = GetIdentRoot();
m_TypeRoot = g_HandleSys.CreateType("Identity", this, 0, &sec, NULL, NULL, NULL);
m_IfaceType = g_HandleSys.CreateType("Interface", this, 0, NULL, NULL, GetIdentRoot(), NULL);
/* Initialize our static identity handle */
m_IdentRoot.ident = g_HandleSys.CreateHandle(m_TypeRoot, NULL, NULL, GetIdentRoot(), NULL);
/* Add the Handle System and others... they are too innocent and pure to do it themselves */
AddInterface(NULL, &g_HandleSys);
AddInterface(NULL, &g_LibSys);
}
void ShareSystem::OnSourceModShutdown()
{
if (m_CoreType)
{
g_HandleSys.RemoveType(m_CoreType, GetIdentRoot());
}
g_HandleSys.RemoveType(m_IfaceType, GetIdentRoot());
g_HandleSys.RemoveType(m_TypeRoot, GetIdentRoot());
}
IdentityType_t ShareSystem::FindIdentType(const char *name)
{
HandleType_t type;
if (g_HandleSys.FindHandleType(name, &type))
{
if (g_HandleSys.TypeCheck(type, m_TypeRoot))
{
return type;
}
}
return 0;
}
IdentityType_t ShareSystem::CreateIdentType(const char *name)
{
if (!m_TypeRoot)
{
return 0;
}
return g_HandleSys.CreateType(name, this, m_TypeRoot, NULL, NULL, GetIdentRoot(), NULL);
}
void ShareSystem::OnHandleDestroy(HandleType_t type, void *object)
{
/* THIS WILL NEVER BE CALLED FOR ANYTHING WITH THE IDENTITY TYPE */
}
IdentityToken_t *ShareSystem::CreateIdentity(IdentityType_t type, void *ptr)
{
if (!m_TypeRoot)
{
return 0;
}
/* :TODO: Cache? */
IdentityToken_t *pToken = new IdentityToken_t;
HandleSecurity sec;
sec.pOwner = sec.pIdentity = GetIdentRoot();
pToken->ident = g_HandleSys.CreateHandleInt(type, NULL, &sec, NULL, NULL, true);
pToken->ptr = ptr;
pToken->type = type;
return pToken;
}
bool ShareSystem::AddInterface(IExtension *myself, SMInterface *iface)
{
if (!iface)
{
return false;
}
IfaceInfo info;
info.owner = myself;
info.iface = iface;
m_Interfaces.push_back(info);
return true;
}
bool ShareSystem::RequestInterface(const char *iface_name,
unsigned int iface_vers,
IExtension *myself,
SMInterface **pIface)
{
/* See if the interface exists */
List<IfaceInfo>::iterator iter;
SMInterface *iface;
IExtension *iface_owner;
bool found = false;
for (iter=m_Interfaces.begin(); iter!=m_Interfaces.end(); iter++)
{
IfaceInfo &info = (*iter);
iface = info.iface;
if (strcmp(iface->GetInterfaceName(), iface_name) == 0)
{
if (iface->GetInterfaceVersion() == iface_vers
|| iface->IsVersionCompatible(iface_vers))
{
iface_owner = info.owner;
found = true;
break;
}
}
}
if (!found)
{
return false;
}
/* Add a dependency node */
if (iface_owner)
{
IfaceInfo info;
info.iface = iface;
info.owner = iface_owner;
g_Extensions.BindDependency(myself, &info);
}
if (pIface)
{
*pIface = iface;
}
return true;
}
void ShareSystem::AddNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
CNativeOwner *pOwner;
pOwner = g_Extensions.GetNativeOwner(myself);
pOwner->AddNatives(natives);
}
void ShareSystem::DestroyIdentity(IdentityToken_t *identity)
{
HandleSecurity sec;
sec.pOwner = GetIdentRoot();
sec.pIdentity = GetIdentRoot();
g_HandleSys.FreeHandle(identity->ident, &sec);
delete identity;
}
void ShareSystem::DestroyIdentType(IdentityType_t type)
{
g_HandleSys.RemoveType(type, GetIdentRoot());
}
void ShareSystem::RemoveInterfaces(IExtension *pExtension)
{
List<IfaceInfo>::iterator iter = m_Interfaces.begin();
while (iter != m_Interfaces.end())
{
if ((*iter).owner == pExtension)
{
iter = m_Interfaces.erase(iter);
}
else
{
iter++;
}
}
}
void ShareSystem::AddDependency(IExtension *myself, const char *filename, bool require, bool autoload)
{
g_Extensions.AddDependency(myself, filename, require, autoload);
}
void ShareSystem::RegisterLibrary(IExtension *myself, const char *name)
{
g_Extensions.AddLibrary(myself, name);
}
void ShareSystem::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
unsigned int i;
NativeEntry *pEntry;
CNativeOwner *pOwner;
pOwner = g_Extensions.GetNativeOwner(myself);
for (i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((pEntry = FindNative(natives[i].name)) == NULL)
{
continue;
}
if (pEntry->owner != g_pCoreNatives)
{
continue;
}
if (pEntry->replacement.owner != NULL)
{
continue;
}
/* Now it's safe to add the override */
pEntry->replacement.func = natives[i].func;
pEntry->replacement.owner = pOwner;
pOwner->AddReplacedNative(pEntry);
}
}
NativeEntry *ShareSystem::FindNative(const char *name)
{
NativeEntry **ppEntry;
if ((ppEntry = m_NtvCache.retrieve(name)) == NULL)
{
return NULL;
}
return *ppEntry;
}
void ShareSystem::BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly)
{
NativeEntry *pEntry;
sp_native_t *native;
uint32_t i, native_count;
IPluginContext *pContext;
pContext = pPlugin->GetBaseContext();
/* Generate a new serial ID, mark our dependencies with it. */
g_mark_serial++;
pPlugin->PropogateMarkSerial(g_mark_serial);
native_count = pContext->GetNativesNum();
for (i = 0; i < native_count; i++)
{
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
continue;
}
/* If we're bound, check if there is a replacement available.
* If not, this native is totally finalized.
*/
if (native->status == SP_NATIVE_BOUND)
{
pEntry = (NativeEntry *)native->user;
assert(pEntry != NULL);
if (pEntry->replacement.owner == NULL
|| (pEntry->replacement.owner != NULL
&& pEntry->replacement.func == native->pfn))
{
continue;
}
}
/* Otherwise, the native must be in our cache. */
else if ((pEntry = FindNative(native->name)) == NULL)
{
continue;
}
if (bCoreOnly && pEntry->owner != g_pCoreNatives)
{
continue;
}
BindNativeToPlugin(pPlugin, native, i, pEntry);
}
}
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, NativeEntry *pEntry)
{
uint32_t i;
sp_native_t *native;
IPluginContext *pContext;
pContext = pPlugin->GetBaseContext();
if (pContext->FindNativeByName(pEntry->name, &i) != SP_ERROR_NONE)
{
return;
}
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
return;
}
if (native->status == SP_NATIVE_BOUND)
{
return;
}
BindNativeToPlugin(pPlugin, native, i, pEntry);
}
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin,
sp_native_t *native,
uint32_t index,
NativeEntry *pEntry)
{
/* Mark as bound... we do the rest next. */
native->status = SP_NATIVE_BOUND;
native->user = pEntry;
/* See if a replacement is available. */
if (pEntry->replacement.owner != NULL)
{
/* Perform a replacement bind. */
native->pfn = pEntry->replacement.func;
pEntry->replacement.owner->AddWeakRef(WeakNative(pPlugin, index, pEntry));
}
else
{
/* Perform a normal bind. */
native->pfn = pEntry->func;
/* We don't bother with dependency crap if the owner is Core. */
if (pEntry->owner != g_pCoreNatives)
{
/* The native is optional, this is a special case */
if ((native->flags & SP_NTVFLAG_OPTIONAL) == SP_NTVFLAG_OPTIONAL)
{
/* Only add if there is a valid owner. */
if (pEntry->owner != NULL)
{
pEntry->owner->AddWeakRef(WeakNative(pPlugin, index));
}
else
{
native->status = SP_NATIVE_UNBOUND;
}
}
/* Otherwise, we're a strong dependent and not a weak one */
else
{
/* See if this has already been marked as a dependent.
* If it has, it means this relationship has already occurred,
* and there is no reason to do it again.
*/
if (pEntry->owner != pPlugin
&& pEntry->owner->GetMarkSerial() != g_mark_serial)
{
/* This has not been marked as a dependency yet */
//pPlugin->AddDependency(pEntry->owner);
pEntry->owner->AddDependent(pPlugin);
pEntry->owner->SetMarkSerial(g_mark_serial);
}
}
}
}
}
NativeEntry *ShareSystem::AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv)
{
NativeEntry *pEntry;
if ((pEntry = FindNative(ntv->name)) == NULL)
{
pEntry = new NativeEntry;
pEntry->owner = pOwner;
pEntry->name = ntv->name;
pEntry->func = ntv->func;
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
pEntry->fake = NULL;
m_NtvCache.insert(ntv->name, pEntry);
return pEntry;
}
if (pEntry->owner != NULL)
{
return NULL;
}
pEntry->owner = pOwner;
pEntry->func = ntv->func;
pEntry->name = ntv->name;
return pEntry;
}
void ShareSystem::ClearNativeFromCache(CNativeOwner *pOwner, const char *name)
{
NativeEntry *pEntry;
if ((pEntry = FindNative(name)) == NULL)
{
return;
}
if (pEntry->owner != pOwner)
{
return;
}
if (pEntry->fake != NULL)
{
g_pSourcePawn2->DestroyFakeNative(pEntry->func);
delete pEntry->fake;
pEntry->fake = NULL;
}
pEntry->func = NULL;
pEntry->name = NULL;
pEntry->owner = NULL;
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
}
NativeEntry *ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func)
{
FakeNative *pFake;
NativeEntry *pEntry;
SPVM_NATIVE_FUNC gate;
if ((pEntry = FindNative(name)) != NULL && pEntry->owner != NULL)
{
return NULL;
}
pFake = new FakeNative;
if ((gate = g_pSourcePawn2->CreateFakeNative(func, pFake)) == NULL)
{
delete pFake;
return NULL;
}
if (pEntry == NULL)
{
pEntry = new NativeEntry;
m_NtvCache.insert(name, pEntry);
}
pFake->call = pFunc;
pFake->ctx = pFunc->GetParentContext();
strncopy(pFake->name, name, sizeof(pFake->name));
pEntry->fake = pFake;
pEntry->func = gate;
pEntry->name = pFake->name;
pEntry->owner = g_PluginSys.GetPluginByCtx(pFake->ctx->GetContext());
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
return pEntry;
}
+42 -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,6 +35,7 @@
#include <IShareSys.h>
#include <IHandleSys.h>
#include <sh_list.h>
#include <sm_trie_tpl.h>
#include "sm_globals.h"
#include "sourcemod.h"
@@ -60,11 +61,38 @@ struct IfaceInfo
IExtension *owner;
};
class CNativeOwner;
class CPlugin;
struct NativeEntry;
struct ReplaceNative
{
CNativeOwner *owner;
SPVM_NATIVE_FUNC func;
};
struct FakeNative
{
char name[64];
IPluginContext *ctx;
IPluginFunction *call;
};
struct NativeEntry
{
CNativeOwner *owner;
SPVM_NATIVE_FUNC func;
const char *name;
ReplaceNative replacement;
FakeNative *fake;
};
class ShareSystem :
public IShareSys,
public SMGlobalClass,
public IHandleTypeDispatch
{
friend class CNativeOwner;
public:
ShareSystem();
public: //IShareSys
@@ -96,12 +124,25 @@ public:
{
return &m_IdentRoot;
}
public:
void BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly);
void BindNativeToPlugin(CPlugin *pPlugin, NativeEntry *pEntry);
NativeEntry *AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
private:
NativeEntry *AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv);
void ClearNativeFromCache(CNativeOwner *pOwner, const char *name);
NativeEntry *FindNative(const char *name);
void BindNativeToPlugin(CPlugin *pPlugin,
sp_native_t *ntv,
uint32_t index,
NativeEntry *pEntry);
private:
List<IfaceInfo> m_Interfaces;
HandleType_t m_TypeRoot;
IdentityToken_t m_IdentRoot;
HandleType_t m_IfaceType;
IdentityType_t m_CoreType;
KTrie<NativeEntry *> m_NtvCache;
};
extern ShareSystem g_ShareSys;
+1 -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
+1 -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
+1 -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
+1 -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
+1 -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
+1 -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
+179 -91
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
@@ -38,9 +38,11 @@
#include "sm_stringutil.h"
#include "sourcemod.h"
#include "PlayerManager.h"
#include "PhraseCollection.h"
#include "ShareSys.h"
Translator g_Translator;
CPhraseFile *g_pCorePhrases = NULL;
IPhraseCollection *g_pCorePhrases = NULL;
unsigned int g_pCorePhraseID = 0;
struct trans_t
@@ -101,7 +103,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()
@@ -150,6 +152,45 @@ void CPhraseFile::ReparseFile()
g_Logger.LogError("[SM] Fatal error encountered parsing translation file \"%s\"", m_File.c_str());
g_Logger.LogError("[SM] Error (line %d, column %d): %s", states.line, states.col, msg);
}
const char *code;
for (unsigned int i = 1; i < m_LangCount; i++)
{
if (!m_pTranslator->GetLanguageInfo(i, &code, NULL))
{
continue;
}
g_SourceMod.BuildPath(Path_SM,
path,
PLATFORM_MAX_PATH,
"translations/%s/%s",
code,
m_File.c_str());
/* Speculatively load these. */
if (!g_LibSys.PathExists(path))
{
continue;
}
if ((err=textparsers->ParseFile_SMC(path, this, &states)) != SMCError_Okay)
{
const char *msg = textparsers->GetSMCErrorString(err);
if (!msg)
{
msg = m_ParseError.c_str();
}
g_Logger.LogError("[SM] Fatal error encountered parsing translation file \"%s/%s\"",
code,
m_File.c_str());
g_Logger.LogError("[SM] Error (line %d, column %d): %s",
states.line,
states.col,
msg);
}
}
}
void CPhraseFile::ReadSMC_ParseStart()
@@ -176,21 +217,21 @@ SMCResult CPhraseFile::ReadSMC_NewSection(const SMCStates *states, const char *n
m_ParseState = PPS_InPhrase;
recognized = true;
phrase_t *pPhrase;
m_CurPhrase = m_pMemory->CreateMem(sizeof(phrase_t), (void **)&pPhrase);
void *value;
if (sm_trie_retrieve(m_pPhraseLookup, name, &value))
{
m_CurPhrase = reinterpret_cast<int>(value);
}
else
{
phrase_t *pPhrase;
m_CurPhrase = m_pMemory->CreateMem(sizeof(phrase_t), (void **)&pPhrase);
sm_trie_insert(m_pPhraseLookup, name, reinterpret_cast<void *>(m_CurPhrase));
/* Create the reverse lookup */
if (!sm_trie_insert(m_pPhraseLookup, name, reinterpret_cast<void *>(m_CurPhrase)))
{
ParseWarning("Skipping duplicate phrase \"%s\" on line %d.", name, states->line);
/* :IDEA: prevent memory waste by seeking backwards in memtable? */
m_CurPhrase = -1;
}
else
{
/* Initialize new phrase */
trans_t *pTrans;
pPhrase->fmt_count = 0;
pPhrase->fmt_list = -1;
@@ -200,13 +241,14 @@ SMCResult CPhraseFile::ReadSMC_NewSection(const SMCStates *states, const char *n
pPhrase->translations = 0;
pPhrase->fmt_bytes = 0;
for (unsigned int i=0; i<m_LangCount; i++)
{
pTrans[i].stridx = -1;
}
m_LastPhraseString.assign(name);
}
m_LastPhraseString.assign(name);
}
else if (m_ParseState == PPS_InPhrase)
{
@@ -231,15 +273,12 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key
}
phrase_t *pPhrase = (phrase_t *)m_pMemory->GetAddress(m_CurPhrase);
if (key[0] == '#' && strcmp(key, "#format") == 0)
{
if (pPhrase->fmt_list != -1)
{
ParseWarning("Ignoring duplicated #format property on line %d", states->line);
return SMCResult_Continue;
}
/* Duplicate format keys get silently ignored. */
if (key[0] == '#'
&& strcmp(key, "#format") == 0
&& pPhrase->fmt_list == -1)
{
if (pPhrase->translations > 0)
{
ParseWarning("#format property should come before translations on line %d, ignoring", states->line);
@@ -448,7 +487,7 @@ SMCResult CPhraseFile::ReadSMC_KeyValue(const SMCStates *states, const char *key
else
{
size_t len = strlen(key);
if (len != 2)
if (len < 2 || len > 3)
{
ParseWarning("Ignoring translation to invalid language \"%s\" on line %d.", key, states->line);
return SMCResult_Continue;
@@ -663,7 +702,7 @@ const char *CPhraseFile::GetFilename()
** MAIN TRANSLATOR CODE **
**************************/
Translator::Translator() : m_ServerLang(LANGUAGE_ENGLISH)
Translator::Translator() : m_ServerLang(SOURCEMOD_LANGUAGE_ENGLISH)
{
m_pStringTab = new BaseStringTable(2048);
m_pLCodeLookup = sm_trie_create();
@@ -727,11 +766,15 @@ void Translator::OnSourceModAllInitialized()
{
AddLanguage("en", "English");
unsigned int id;
g_pCorePhrases = CreatePhraseCollection();
g_pCorePhrases->AddPhraseFile("core.phrases");
id = FindOrAddPhraseFile("core.phrases.txt");
g_pCorePhraseID = id;
g_pCorePhrases = GetFileByIndex(id);
g_ShareSys.AddInterface(NULL, this);
}
void Translator::OnSourceModShutdown()
{
g_pCorePhrases->Destroy();
}
bool Translator::GetLanguageByCode(const char *code, unsigned int *index)
@@ -842,7 +885,7 @@ void Translator::RebuildLanguageDatabase(const char *lang_header_file)
g_Logger.LogError("Server language was set to bad language \"%s\" -- reverting to English", m_InitialLang);
strncopy(m_InitialLang, "en", sizeof(m_InitialLang));
m_ServerLang = LANGUAGE_ENGLISH;
m_ServerLang = SOURCEMOD_LANGUAGE_ENGLISH;
}
m_ServerLang = reinterpret_cast<unsigned int>(serverLang);
@@ -893,7 +936,7 @@ SMCResult Translator::ReadSMC_KeyValue(const SMCStates *states, const char *key,
{
size_t len = strlen(key);
if (len != 2)
if (len < 2 || len > 3)
{
g_Logger.LogError("[SM] Warning encountered parsing languages.cfg file.");
g_Logger.LogError("[SM] Invalid language code \"%s\" is being ignored.", key);
@@ -914,9 +957,7 @@ bool Translator::AddLanguage(const char *langcode, const char *description)
Language *pLanguage = new Language;
unsigned int idx = m_Languages.size();
pLanguage->m_code2[0] = langcode[0];
pLanguage->m_code2[1] = langcode[1];
pLanguage->m_code2[2] = langcode[2];
UTIL_Format(pLanguage->m_code2, sizeof(pLanguage->m_code2), "%s", langcode);
pLanguage->m_FullName = m_pStringTab->AddString(description);
sm_trie_insert(m_pLCodeLookup, langcode, reinterpret_cast<void *>(idx));
@@ -936,61 +977,6 @@ CPhraseFile *Translator::GetFileByIndex(unsigned int index)
return m_Files[index];
}
size_t Translator::Translate(char *buffer, size_t maxlength, void **params, const Translation *pTrans)
{
void *new_params[MAX_TRANSLATE_PARAMS];
/* Rewrite the parameter order */
for (unsigned int i=0; i<pTrans->fmt_count; i++)
{
new_params[i] = params[pTrans->fmt_order[i]];
}
return gnprintf(buffer, maxlength, pTrans->szPhrase, new_params);
}
TransError Translator::CoreTransEx(CPhraseFile *pFile,
int client,
char *buffer,
size_t maxlength,
const char *phrase,
void **params,
size_t *outlen)
{
Translation trans;
TransError err;
/* Using server lang temporarily until client lang stuff is implemented */
if ((err = pFile->GetTranslation(phrase, m_ServerLang, &trans)) != Trans_Okay)
{
return err;
}
size_t len = Translate(buffer, maxlength, params, &trans);
if (outlen)
{
*outlen = len;
}
return Trans_Okay;
}
TransError Translator::CoreTrans(int client,
char *buffer,
size_t maxlength,
const char *phrase,
void **params,
size_t *outlen)
{
if (!g_pCorePhrases)
{
return Trans_BadPhraseFile;
}
return CoreTransEx(g_pCorePhrases, client, buffer, maxlength, phrase, params, outlen);
}
unsigned int Translator::GetServerLanguage()
{
return m_ServerLang;
@@ -1021,3 +1007,105 @@ bool Translator::GetLanguageInfo(unsigned int number, const char **code, const c
return true;
}
const char *Translator::GetInterfaceName()
{
return SMINTERFACE_TRANSLATOR_NAME;
}
unsigned int Translator::GetInterfaceVersion()
{
return SMINTERFACE_TRANSLATOR_VERSION;
}
IPhraseCollection *Translator::CreatePhraseCollection()
{
return new CPhraseCollection();
}
int Translator::SetGlobalTarget(int index)
{
return g_SourceMod.SetGlobalTarget(index);
}
int Translator::GetGlobalTarget() const
{
return g_SourceMod.GetGlobalTarget();
}
bool CoreTranslate(char *buffer,
size_t maxlength,
const char *format,
unsigned int numparams,
size_t *pOutLength,
...)
{
va_list ap;
unsigned int i;
const char *fail_phrase;
void *params[MAX_TRANSLATE_PARAMS];
if (numparams > MAX_TRANSLATE_PARAMS)
{
assert(false);
return false;
}
va_start(ap, pOutLength);
for (i = 0; i < numparams; i++)
{
params[i] = va_arg(ap, void *);
}
va_end(ap);
if (!g_pCorePhrases->FormatString(buffer,
maxlength,
format,
params,
numparams,
pOutLength,
&fail_phrase))
{
if (fail_phrase != NULL)
{
g_Logger.LogError("[SM] Could not find core phrase: %s", fail_phrase);
}
else
{
g_Logger.LogError("[SM] Unknown fatal error while translating a core phrase.");
}
return false;
}
return true;
}
bool Translator::FormatString(char *buffer,
size_t maxlength,
const char *format,
IPhraseCollection *pPhrases,
void **params,
unsigned int numparams,
size_t *pOutLength,
const char **pFailPhrase)
{
unsigned int arg;
arg = 0;
if (!gnprintf(buffer, maxlength, format, pPhrases, params, numparams, arg, pOutLength, pFailPhrase))
{
return false;
}
if (arg != numparams)
{
if (pFailPhrase != NULL)
{
*pFailPhrase = NULL;
}
return false;
}
return true;
}
+40 -38
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
@@ -38,6 +38,7 @@
#include "sm_globals.h"
#include "sm_memtable.h"
#include "ITextParsers.h"
#include <ITranslator.h>
#define MAX_TRANSLATE_PARAMS 32
#define CORELANG_ENGLISH 0
@@ -56,29 +57,13 @@ enum PhraseParseState
struct Language
{
char m_code2[3];
char m_code2[4];
int m_FullName;
};
struct Translation
{
const char *szPhrase; /**< Translated phrase. */
unsigned int fmt_count; /**< Number of format parameters. */
int *fmt_order; /**< Format phrase order. */
};
#define LANGUAGE_ENGLISH 0
enum TransError
{
Trans_Okay = 0,
Trans_BadLanguage = 1,
Trans_BadPhrase = 2,
Trans_BadPhraseLanguage = 3,
Trans_BadPhraseFile = 4,
};
class CPhraseFile : public ITextListener_SMC
class CPhraseFile :
public ITextListener_SMC,
public IPhraseFile
{
public:
CPhraseFile(Translator *pTranslator, const char *file);
@@ -112,7 +97,8 @@ private:
class Translator :
public ITextListener_SMC,
public SMGlobalClass
public SMGlobalClass,
public ITranslator
{
public:
Translator();
@@ -125,6 +111,7 @@ public: // SMGlobalClass
size_t maxlength);
void OnSourceModAllInitialized();
void OnSourceModLevelChange(const char *mapName);
void OnSourceModShutdown();
public: // ITextListener_SMC
void ReadSMC_ParseStart();
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
@@ -138,23 +125,30 @@ public:
bool GetLanguageInfo(unsigned int number, const char **code, const char **name);
bool GetLanguageByCode(const char *code, unsigned int *index);
bool GetLanguageByName(const char *name, unsigned int *index);
size_t Translate(char *buffer, size_t maxlength, void **params, const Translation *pTrans);
CPhraseFile *GetFileByIndex(unsigned int index);
TransError CoreTransEx(CPhraseFile *pFile,
int client,
char *buffer,
size_t maxlength,
const char *phrase,
void **params,
size_t *outlen=NULL);
TransError CoreTrans(int client,
char *buffer,
size_t maxlength,
const char *phrase,
void **params,
size_t *outlen=NULL);
public: //ITranslator
unsigned int GetServerLanguage();
unsigned int GetClientLanguage(int client);
const char *GetInterfaceName();
unsigned int GetInterfaceVersion();
IPhraseCollection *CreatePhraseCollection();
int SetGlobalTarget(int index);
int GetGlobalTarget() const;
size_t FormatString(
char *buffer,
size_t maxlength,
SourcePawn::IPluginContext *pContext,
const cell_t *params,
unsigned int param);
bool FormatString(
char *buffer,
size_t maxlength,
const char *format,
IPhraseCollection *pPhrases,
void **params,
unsigned int numparams,
size_t *pOutLength,
const char **pFailPhrase);
private:
bool AddLanguage(const char *langcode, const char *description);
private:
@@ -165,10 +159,18 @@ private:
bool m_InLanguageSection;
String m_CustomError;
unsigned int m_ServerLang;
char m_InitialLang[3];
char m_InitialLang[4];
};
extern CPhraseFile *g_pCorePhrases;
/* Nice little wrapper to handle error logging and whatnot */
bool CoreTranslate(char *buffer,
size_t maxlength,
const char *format,
unsigned int numparams,
size_t *pOutLength,
...);
extern IPhraseCollection *g_pCorePhrases;
extern unsigned int g_pCorePhraseID;
extern Translator g_Translator;
+1 -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
+1 -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
+1 -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
+1 -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
+63 -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
@@ -35,15 +35,75 @@
#include "MenuStyle_Valve.h"
#include "MenuStyle_Radio.h"
#include "PlayerManager.h"
#include "CoreConfig.h"
#include <sm_queue.h>
#include "ThreadSupport.h"
float g_LastMenuTime = 0.0f;
float g_LastAuthCheck = 0.0f;
static IMutex *frame_mutex;
static Queue<FrameAction> *frame_queue;
static Queue<FrameAction> *frame_actions;
static float g_LastMenuTime = 0.0f;
static float g_LastAuthCheck = 0.0f;
bool g_PendingInternalPush = false;
class FrameActionInit : public SMGlobalClass
{
public:
void OnSourceModAllInitialized()
{
frame_queue = new Queue<FrameAction>();
frame_actions = new Queue<FrameAction>();
frame_mutex = g_pThreader->MakeMutex();
}
void OnSourceModShutdown()
{
delete frame_queue;
delete frame_actions;
frame_mutex->DestroyThis();
}
} s_FrameActionInit;
void AddFrameAction(const FrameAction & action)
{
frame_mutex->Lock();
frame_queue->push(action);
frame_mutex->Unlock();
}
void RunFrameHooks(bool simulating)
{
/* It's okay if this check races. */
if (frame_queue->size())
{
Queue<FrameAction> *temp;
/* Very quick lock to move queue/actions back and forth */
frame_mutex->Lock();
temp = frame_queue;
frame_queue = frame_actions;
frame_actions = temp;
frame_mutex->Unlock();
/* The server will now be adding to the other queue, so we can process events. */
while (!frame_actions->empty())
{
FrameAction &item = frame_actions->first();
frame_actions->pop();
item.action(item.data);
}
}
/* 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;
+12 -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,17 @@
#ifndef _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
#define _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
typedef void (*FRAMEACTION)(void *data);
struct FrameAction
{
void *data;
FRAMEACTION action;
};
extern bool g_PendingInternalPush;
void AddFrameAction(const FrameAction & action);
void RunFrameHooks(bool simulating);
#endif //_INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
+476
View File
@@ -0,0 +1,476 @@
// MD5.CC - source code for the C++/object oriented translation and
// modification of MD5.
// Translation and modification (c) 1995 by Mordechai T. Abzug
// This translation/ modification is provided "as is," without express or
// implied warranty of any kind.
// The translator/ modifier does not claim (1) that MD5 will do what you think
// it does; (2) that this translation/ modification is accurate; or (3) that
// this software is "merchantible." (Language for this disclaimer partially
// copied from the disclaimer below).
/* based on:
MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
MDDRIVER.C - test driver for MD2, MD4 and MD5
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include "md5.h"
#include <assert.h>
#include <string.h>
// MD5 simple initialization method
MD5::MD5(){
init();
}
// MD5 block update operation. Continues an MD5 message-digest
// operation, processing another message block, and updating the
// context.
void MD5::update (uint1 *input, uint4 input_length) {
uint4 input_index, buffer_index;
uint4 buffer_space; // how much space is left in buffer
if (finalized){ // so we can't update!
/*cerr << "MD5::update: Can't update a finalized digest!" << endl;*/
return;
}
// Compute number of bytes mod 64
buffer_index = (unsigned int)((count[0] >> 3) & 0x3F);
// Update number of bits
if ( (count[0] += ((uint4) input_length << 3))<((uint4) input_length << 3) )
count[1]++;
count[1] += ((uint4)input_length >> 29);
buffer_space = 64 - buffer_index; // how much space is left in buffer
// Transform as many times as possible.
if (input_length >= buffer_space) { // ie. we have enough to fill the buffer
// fill the rest of the buffer and transform
memcpy (buffer + buffer_index, input, buffer_space);
transform (buffer);
// now, transform each 64-byte piece of the input, bypassing the buffer
for (input_index = buffer_space; input_index + 63 < input_length;
input_index += 64)
transform (input+input_index);
buffer_index = 0; // so we can buffer remaining
}
else
input_index=0; // so we can buffer the whole input
// and here we do the buffering:
memcpy(buffer+buffer_index, input+input_index, input_length-input_index);
}
// MD5 update for files.
// Like above, except that it works on files (and uses above as a primitive.)
void MD5::update(FILE *file){
unsigned char buffer[1024];
int len;
while ((len=fread(buffer, 1, 1024, file)))
update(buffer, len);
fclose (file);
}
// MD5 finalization. Ends an MD5 message-digest operation, writing the
// the message digest and zeroizing the context.
void MD5::finalize (){
unsigned char bits[8];
unsigned int index, padLen;
static uint1 PADDING[64]={
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
if (finalized){
/* cerr << "MD5::finalize: Already finalized this digest!" << endl;*/
return;
}
// Save number of bits
encode (bits, count, 8);
// Pad out to 56 mod 64.
index = (uint4) ((count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
update (PADDING, padLen);
// Append length (before padding)
update (bits, 8);
// Store state in digest
encode (digest, state, 16);
// Zeroize sensitive information
memset (buffer, 0, sizeof(*buffer));
finalized=1;
}
MD5::MD5(FILE *file){
init(); // must be called be all constructors
update(file);
finalize ();
}
unsigned char *MD5::raw_digest(){
uint1 *s = new uint1[16];
if (!finalized){
/* cerr << "MD5::raw_digest: Can't get digest if you haven't "<<
"finalized the digest!" <<endl;*/
return ( (unsigned char*) "");
}
memcpy(s, digest, 16);
return s;
}
unsigned char *MD5::raw_digest(unsigned char buffer[16])
{
if (!finalized)
{
return ( (unsigned char*) "");
}
memcpy(buffer, digest, 16);
return buffer;
}
char *MD5::hex_digest(){
int i;
char *s= new char[33];
assert(finalized);
for (i=0; i<16; i++)
sprintf(s+i*2, "%02x", digest[i]);
s[32]='\0';
return s;
}
char *MD5::hex_digest(char buffer[33]){
int i;
assert(finalized);
for (i=0; i<16; i++)
sprintf(buffer+i*2, "%02x", digest[i]);
buffer[32]='\0';
return buffer;
}
// PRIVATE METHODS:
void MD5::init(){
finalized=0; // we just started!
// Nothing counted, so count=0
count[0] = 0;
count[1] = 0;
// Load magic initialization constants.
state[0] = 0x67452301;
state[1] = 0xefcdab89;
state[2] = 0x98badcfe;
state[3] = 0x10325476;
}
// Constants for MD5Transform routine.
// Although we could use C++ style constants, defines are actually better,
// since they let us easily evade scope clashes.
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
// MD5 basic transformation. Transforms state based on block.
void MD5::transform (uint1 block[64]){
uint4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
decode (x, block, 64);
assert(!finalized); // not just a user error, since the method is private
/* Round 1 */
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
/* Round 2 */
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
/* Round 3 */
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
/* Round 4 */
II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
// Zeroize sensitive information.
memset ( (uint1 *) x, 0, sizeof(x));
}
// Encodes input (UINT4) into output (unsigned char). Assumes len is
// a multiple of 4.
void MD5::encode (uint1 *output, uint4 *input, uint4 len) {
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (uint1) (input[i] & 0xff);
output[j+1] = (uint1) ((input[i] >> 8) & 0xff);
output[j+2] = (uint1) ((input[i] >> 16) & 0xff);
output[j+3] = (uint1) ((input[i] >> 24) & 0xff);
}
}
// Decodes input (unsigned char) into output (UINT4). Assumes len is
// a multiple of 4.
void MD5::decode (uint4 *output, uint1 *input, uint4 len){
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((uint4)input[j]) | (((uint4)input[j+1]) << 8) |
(((uint4)input[j+2]) << 16) | (((uint4)input[j+3]) << 24);
}
// Note: Replace "for loop" with standard memcpy if possible.
void MD5::memcpy (uint1 *output, uint1 *input, uint4 len){
unsigned int i;
for (i = 0; i < len; i++)
output[i] = input[i];
}
// Note: Replace "for loop" with standard memset if possible.
void MD5::memset (uint1 *output, uint1 value, uint4 len){
unsigned int i;
for (i = 0; i < len; i++)
output[i] = value;
}
// ROTATE_LEFT rotates x left n bits.
inline unsigned int MD5::rotate_left (uint4 x, uint4 n){
return (x << n) | (x >> (32-n)) ;
}
// F, G, H and I are basic MD5 functions.
inline unsigned int MD5::F (uint4 x, uint4 y, uint4 z){
return (x & y) | (~x & z);
}
inline unsigned int MD5::G (uint4 x, uint4 y, uint4 z){
return (x & z) | (y & ~z);
}
inline unsigned int MD5::H (uint4 x, uint4 y, uint4 z){
return x ^ y ^ z;
}
inline unsigned int MD5::I (uint4 x, uint4 y, uint4 z){
return y ^ (x | ~z);
}
// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
// Rotation is separate from addition to prevent recomputation.
inline void MD5::FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac){
a += F(b, c, d) + x + ac;
a = rotate_left (a, s) +b;
}
inline void MD5::GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac){
a += G(b, c, d) + x + ac;
a = rotate_left (a, s) +b;
}
inline void MD5::HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac){
a += H(b, c, d) + x + ac;
a = rotate_left (a, s) +b;
}
inline void MD5::II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac){
a += I(b, c, d) + x + ac;
a = rotate_left (a, s) +b;
}
+106
View File
@@ -0,0 +1,106 @@
// MD5.CC - source code for the C++/object oriented translation and
// modification of MD5.
// Translation and modification (c) 1995 by Mordechai T. Abzug
// This translation/ modification is provided "as is," without express or
// implied warranty of any kind.
// The translator/ modifier does not claim (1) that MD5 will do what you think
// it does; (2) that this translation/ modification is accurate; or (3) that
// this software is "merchantible." (Language for this disclaimer partially
// copied from the disclaimer below).
/* based on:
MD5.H - header file for MD5C.C
MDDRIVER.C - test driver for MD2, MD4 and MD5
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#include <stdio.h>
//#include <fstream.h>
//#include <iostream.h>
class MD5 {
public:
// methods for controlled operation:
MD5 (); // simple initializer
void update (unsigned char *input, unsigned int input_length);
void update (FILE *file);
void finalize ();
// constructors for special circumstances. All these constructors finalize
// the MD5 context.
MD5 (unsigned char *string); // digest string, finalize
MD5 (FILE *file); // digest file, close, finalize
// methods to acquire finalized result
unsigned char *raw_digest (); // digest as a 16-byte binary array
unsigned char *raw_digest(unsigned char buffer[16]);
char * hex_digest (); // digest as a 33-byte ascii-hex string
char * hex_digest (char buffer[33]); //same as above, passing buffer
private:
// first, some types:
typedef unsigned int uint4; // assumes integer is 4 words long
typedef unsigned short int uint2; // assumes short integer is 2 words long
typedef unsigned char uint1; // assumes char is 1 word long
// next, the private data:
uint4 state[4];
uint4 count[2]; // number of *bits*, mod 2^64
uint1 buffer[64]; // input buffer
uint1 digest[16];
uint1 finalized;
// last, the private methods, mostly static:
void init (); // called by all constructors
void transform (uint1 *buffer); // does the real update work. Note
// that length is implied to be 64.
static void encode (uint1 *dest, uint4 *src, uint4 length);
static void decode (uint4 *dest, uint1 *src, uint4 length);
static void memcpy (uint1 *dest, uint1 *src, uint4 length);
static void memset (uint1 *start, uint1 val, uint4 length);
static inline uint4 rotate_left (uint4 x, uint4 n);
static inline uint4 F (uint4 x, uint4 y, uint4 z);
static inline uint4 G (uint4 x, uint4 y, uint4 z);
static inline uint4 H (uint4 x, uint4 y, uint4 z);
static inline uint4 I (uint4 x, uint4 y, uint4 z);
static inline void FF (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void GG (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void HH (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
static inline void II (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x,
uint4 s, uint4 ac);
};
+9 -9
View File
@@ -5,35 +5,35 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sourcemod_mm", "sourcemod_m
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CrazyDebug|Win32 = CrazyDebug|Win32
CrazyDebug - Episode 1|Win32 = CrazyDebug - Episode 1|Win32
CrazyDebug - Old Metamod|Win32 = CrazyDebug - Old Metamod|Win32
CrazyDebug - Orange Box|Win32 = CrazyDebug - Orange Box|Win32
Debug - Episode 1|Win32 = Debug - Episode 1|Win32
Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
Debug - Orange Box|Win32 = Debug - Orange Box|Win32
Debug|Win32 = Debug|Win32
Release - Episode 1|Win32 = Release - Episode 1|Win32
Release - Old Metamod|Win32 = Release - Old Metamod|Win32
Release - Orange Box|Win32 = Release - Orange Box|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug|Win32.ActiveCfg = CrazyDebug|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug|Win32.Build.0 = CrazyDebug|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.ActiveCfg = CrazyDebug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Episode 1|Win32.Build.0 = CrazyDebug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Old Metamod|Win32.ActiveCfg = CrazyDebug - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Old Metamod|Win32.Build.0 = CrazyDebug - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Orange Box|Win32.ActiveCfg = CrazyDebug - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.CrazyDebug - Orange Box|Win32.Build.0 = CrazyDebug - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Old Metamod|Win32.Build.0 = Debug - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug|Win32.ActiveCfg = CrazyDebug|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Debug|Win32.Build.0 = CrazyDebug|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Old Metamod|Win32.Build.0 = Release - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release|Win32.ActiveCfg = Debug - Old Metamod|Win32
{E39527CD-7CAB-4420-97CC-DA1B93B260BC}.Release|Win32.Build.0 = Debug - Old Metamod|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
File diff suppressed because it is too large Load Diff

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