Compare commits

...
195 Commits
Author SHA1 Message Date
Nicholas Hastings f008349cbc Updated versioning for 1.4.7 release. 2013-02-06 20:40:45 -05:00
Nicholas Hastings c978f8620e Updated changelog. 2013-02-06 20:39:27 -05:00
Nicholas Hastings ec9a4ab9c5 Updated more CS:S gamedata. 2013-02-06 17:43:02 -05:00
Nicholas Hastings de40e8990f Updated core to compile for new ep2v lib names (bug 5524). 2013-02-05 23:32:56 -05:00
Nicholas Hastings ae07dc524d Updated CS:S gamedata. 2013-02-05 17:20:00 -05:00
Nicholas Hastings 31426fb8d0 Fixed VARINT & UNSIGNED flags being read from dt instead of member in SendProp arrays (bug 5591, r=prodigysim). 2013-02-04 07:42:38 -05:00
Michael Busby f538a51ef4 Fix GameRules_SetPropVector writing data to unexpected addresses instead of to the proxy entity (bug 5592, r=psychonic). 2013-01-27 14:59:14 -08:00
Nicholas Hastings 55ee8af1e6 Updated more TF2 gamedata. 2012-12-20 18:24:47 -05:00
Nicholas Hastings 85ed2e01a4 Updated TF2 gamedata. 2012-12-19 07:55:03 -05:00
Peace-Maker 9eddf38b92 Fixed Sort_Random not including first value in array sorting functions (bug 4292, r=psychonic). 2013-01-23 12:51:19 -05:00
Nicholas Hastings 4ca976f883 Fixed gamedata offsets for CSPromod, GESource, and Synergy. 2013-01-06 09:35:22 -05:00
Nicholas Hastings ba9db46290 Updated gamedata offsets for CSPromod, GESource, and Synergy. 2012-12-31 18:15:25 -05:00
Nicholas Hastings b58fe300ba Removed SE_CSS references that snuck in with merge from central. 2012-12-20 18:42:15 -05:00
Nicholas Hastings 4eb3754afc Added support for new SPROP_VARINT sendprops. 2012-12-18 17:58:45 -05:00
Nicholas Hastings ae6ae0e3ea Ported GetEntProp's unsigned prop support to GameRules_GetProp. 2012-12-18 17:53:45 -05:00
Nicholas Hastings e903810d34 Updated DOD:S and HL2DM gamedata. 2012-12-20 17:58:43 -05:00
Nicholas Hastings b73fd01490 Validate entity in GameRules_GetPropEnt and in CS_DropWeapon safety checks. 2012-12-17 14:34:44 -05:00
Nicholas Hastings af0d46fcc1 Fixed regressions in 3d66ab8565c1:
* Fixed crash when prop/data ent is invalid.
* Restored GetEntPropEnt/GetEntDataEnt2 functionality when logical ent support is not available.
2012-12-17 14:33:57 -05:00
Nicholas Hastings 773216d517 Validate entity in GetEntPropEnt, GetEntDataEnt2 (r=me). 2012-12-16 19:52:31 -05:00
Powerlord ccfdcfb727 Updated TFHoliday enum (bug 5526, r=psychonic). 2012-12-15 14:40:51 -05:00
Ryan Stecker 8bf7f1a00f Fixed VoteMenuToAll stock adding bots to list (bug 5253, r=asherkin). 2012-12-14 15:18:30 -05:00
GoD-Tony 5e99870df0 Added PlayerRunCmd gamedata for The Hidden: Source (bug 5534, r=psychonic). 2012-12-14 15:07:47 -05:00
FlaminSarge 6f8d002404 Added new values to TFCond(ition) enum (bug 5537, r=asherkin). 2012-12-14 15:01:28 -05:00
Nicholas Hastings 3a94a3268a Updated CSPromod gamedata. 2012-12-10 23:35:57 -05:00
Kyle Sanderson 8355efaca4 Added a sanity check on handle index in EntityToBCompatRef (bug 5539, r=psychonic). 2012-12-01 13:41:00 -05:00
Drifter 2f388cfdb4 AutoExecConfig now logs an error when it cannot create cfg (bug 5465, r=asherkin). 2012-11-24 09:53:44 -05:00
Nicholas Hastings 272473ed02 Updated more L4D2 gamedata. 2012-11-21 08:30:08 -05:00
Nicholas Hastings 6e95680838 Updated L4D2 gamedata. 2012-11-20 20:55:28 -05:00
Nicholas Hastings 18e089e9d0 Fixed typo in game.nucleardawn.txt. 2012-11-08 12:56:19 -05:00
Nicholas Hastings 185e5fe6db Updated ZPS gamedata (bug 5536). 2012-11-02 13:39:33 -04:00
Nicholas Hastings 2b84454e77 Updated Nuclear Dawn gamedata. 2012-10-31 09:58:13 -04:00
Nicholas Hastings bb66d660b9 Updated ambuilder script for ep2v lib name changes (bug 5524). 2012-10-27 11:33:32 -04:00
Nicholas Hastings 3867d70d53 Updated last piece of gamedata for today's TF2 update. 2012-10-26 22:59:20 -04:00
Nicholas Hastings 144c1a3a13 Updated more ep2v gamedata. 2012-10-26 22:02:46 -04:00
Nicholas Hastings c2197a4422 Fixing ep2v build against sdk update. 2012-10-26 21:45:53 -04:00
Nicholas Hastings c3c51ff3a3 Updated TF2 extension gamedata. 2012-10-26 20:06:50 -04:00
Nicholas Hastings a2d3e1bee5 Updated PVKII gamedata. 2012-10-24 13:55:07 -04:00
Nicholas Hastings 6fa750bffe Merge. 2012-10-14 18:32:44 -04:00
Nicholas Hastings 83841cc218 Updated NMRiH gamedata (bug 5482). 2012-10-14 18:25:59 -04:00
Asher Baker 5c7e6c79c8 Updated plugin blacklist. 2012-10-12 02:25:53 +01:00
Asher Baker b20ff4075a Updated plugin blacklist. 2012-09-22 12:59:16 +01:00
Drifter f860ef10e6 Updated CS:S gamedata for CStrike extension. 2012-09-11 18:48:10 -04:00
Nicholas Hastings e357a5d650 Updated CS:S SDKTools gamedata. 2012-09-11 18:47:44 -04:00
Asher Baker c3bded70c5 Check the debug stringbase when loading plugins, lest it be null and cause crashes down the line (bug 5478, r=dvander). 2012-09-08 17:31:31 +01:00
Nicholas Hastings c11f2569ce Updated TF2 gamedata. 2012-09-06 18:46:38 -04:00
Nicholas Hastings c56d550333 Merge. 2012-09-06 17:43:19 -04:00
Nicholas Hastings 4e96ffb438 Updated ep2v gamedata. 2012-09-06 17:42:57 -04:00
Asher Baker 6b4b5eb0b1 Bumping version. 2012-09-04 12:56:31 +01:00
Asher Baker 74847c5b4f Added tag sourcemod-1.4.6 for changeset 56a9ba4cd1e2 2012-09-04 12:54:31 +01:00
Asher Baker 116fbe9a7a Updated versioning for 1.4.6 release. 2012-09-04 12:46:12 +01:00
Asher Baker 79f412c55c Updated changelog. 2012-09-04 12:45:37 +01:00
Asher Baker d839b83b6b Fixed extraneous errors related to accessing nested props (bug 5446, r=me). 2012-09-04 11:41:35 +01:00
Nicholas Hastings 9bcc3de922 Bumping version. 2012-09-03 23:07:23 -04:00
Nicholas Hastings 30ebb670f4 Added tag sourcemod-1.4.5 for changeset 9560adae2a72 2012-09-03 23:06:27 -04:00
Nicholas Hastings b702099530 Merge. 2012-09-03 21:21:07 -04:00
Nicholas Hastings dd0339e05b Updated versioning for 1.4.5 release. 2012-09-03 21:20:44 -04:00
Nicholas Hastings 88ee039ea6 Updated changelog. 2012-09-03 21:20:29 -04:00
Asher Baker 9b965ddfe5 Merge 2012-09-03 20:29:02 +01:00
Asher Baker 6e4dcc9041 Error on access to nested datamap props (bug 5446, r=psychonic). 2012-09-03 20:26:39 +01:00
Nicholas Hastings 71925cd3b2 Updated non-CS:S ep2v gamedata for IServer lookup (bug 5450). 2012-09-03 14:39:26 -04:00
Nicholas Hastings 82160205e5 Fixed typo causing IServer lookup to still fail (bug 5450). 2012-09-03 14:37:45 -04:00
Asher Baker 8307f8fd9b Fixed resolution of GetProfilerTime on non-Windows platforms (r=me). 2012-08-29 16:35:10 +01:00
Nicholas Hastings a62b783c0e riggering build. 2012-08-28 17:49:57 -04:00
Kyle Sanderson 2f86fe58aa Fixed crash in EntProp natives (bug 5297, r=psychonic). 2012-08-28 16:22:33 -04:00
Nicholas Hastings 20d9b28df5 Updated SDKCall SetSignature to use same hidden-symbols engine list as core (bug 5440, r=me). 2012-08-27 19:31:44 -04:00
Nicholas Hastings 4c3fe1a1e7 Updated GMod gamedata (bug 5408). 2012-08-27 18:59:00 -04:00
Nicholas Hastings e95f0f333e Compatibility shim to fix IServer lookup on CS:S (bug 5450, r=asherkin). 2012-08-27 17:52:15 -04:00
Kyle Sanderson 129395c896 Fixed minor memory leaks in cstrike ext (bug 5456, r=psychonic). 2012-08-27 00:57:25 -04:00
Anthony Iacono f2eccadff3 Fixed OnClientConnect blocking not actually functioning (bug 5461, r=psychonic). 2012-08-26 23:33:04 -04:00
Nicholas Hastings 4eafdc2a1e Really fixed issues for today's TF2 engine update (bug 5450). 2012-08-24 01:38:01 -04:00
Nicholas Hastings e4fd32609a Updated gamedata for today's TF2 engine update. 2012-08-24 00:53:26 -04:00
Nicholas Hastings 3f43fca3a9 Fixed GuessSDKVersion output on CS:S with MM:S 1.9+ (r=asherkin). 2012-08-23 13:55:48 -04:00
Nicholas Hastings 0d6b93c5a0 Updated SDKTools IServer finding on Windows for Ep2v and CSS (bug 5450, r=me). 2012-08-23 07:47:44 -04:00
Asher Baker bf4bce8250 Updated cstrike gamedata. 2012-08-22 23:27:16 +01:00
Powerlord 6942614ef9 Updated TFHoliday enum (bug 5436, r=asherkin). 2012-08-21 00:44:44 -04:00
Nicholas Hastings f6c496717c Merge. 2012-08-20 21:56:45 -04:00
Nicholas Hastings 9c69e9e66a Added compatibility shim for MM:S 1.9.0+ (bug 5370, r=asherkin). 2012-08-20 21:56:18 -04:00
Asher Baker b5b5d7e239 Force build. 2012-08-16 02:10:14 +01:00
Nicholas Hastings 6acf264636 Updated HL2DM and DODS gamedata for today's game update. 2012-08-15 23:35:53 +01:00
Nicholas Hastings 52ecfd8b0a Updated tf2 weapon and dmg custom defines, added new round state. 2012-08-15 23:35:53 +01:00
Nicholas Hastings 5b6cb0707c Updated gamedata for latest TF2 update. 2012-08-15 23:35:53 +01:00
Nicholas Hastings a29027a4a3 Updated TF2 ext MakeBleed and Regenerate natives for latest TF2 update. 2012-08-15 23:35:53 +01:00
Asher Baker 94e471192d Added system to block malware or illegal plugins (bug 5289, r=dvander). 2012-08-09 01:54:43 +01:00
Nicholas Hastings 691b9d128e Updated defines in tf2_stocks.inc. 2012-08-03 07:56:31 -04:00
Ryan Stecker c9631c19ac Updated TF2 gamedata. 2012-08-02 20:11:02 -04:00
Nicholas Hastings 893b52a1e9 Updated Dino D-Day gamedata (bug 5410). 2012-08-01 22:23:03 -04:00
Nicholas Hastings 527b98661a Updated ZPS gamedata. 2012-07-26 14:09:34 -04:00
Nicholas Hastings 823b0f9702 Triggering build for bug 5391. 2012-07-21 20:43:22 -04:00
Nicholas Hastings bcdc2c3933 Updated DoD:S and HL2:DM gamedata. 2012-07-20 15:43:15 -04:00
Nicholas Hastings bf84e29c4d Updated Nuclear Dawn gamedata. 2012-07-19 20:13:47 -04:00
Nicholas Hastings 4b5c62bd2f Bumping version. 2012-07-03 20:34:50 -04:00
Nicholas Hastings 1dd00127a5 Added tag sourcemod-1.4.4 for changeset 29186166cc99 2012-07-03 20:33:45 -04:00
Nicholas Hastings 8c0a53cfdb Updating versioning for 1.4.4 release. 2012-07-03 18:30:05 -04:00
Nicholas Hastings 5d485df4b8 Updating changelog. 2012-07-03 18:29:39 -04:00
Powerlord 0656857960 Updated TFHoliday enum for latest TF2 updates (bug 5364, r=psychonic). 2012-07-03 18:03:06 -04:00
Nicholas Hastings af69434738 Fixed clientprefs prefab menu double free crash (bug 5374, r=asherkin). 2012-07-03 07:51:12 -04:00
Nicholas Hastings d713c52524 Updated CS:S gamedata. 2012-07-02 23:27:22 -04:00
Brian Simon ef59237dad Fixed NULL ninvoke ptr in sample ext when SMEXT_ENABLE_NINVOKE defined (bug 5340, r=psychonic). 2012-07-01 12:05:21 -04:00
Nicholas Hastings 049f99a658 Updated GMod gamedata. 2012-06-30 09:08:06 -04:00
Nicholas Hastings ffe50ed9f1 Added new TF2 weapon and custom dmg defines. 2012-06-28 11:27:31 -04:00
Nicholas Hastings f2266b45a3 Updated EmitSentence native for sdk change on ep2v. 2012-06-28 11:29:07 -04:00
Nicholas Hastings c5f57cb3e4 Updated TF2, DOD:S, and HL2:DM gamedata. 2012-06-27 23:24:38 -04:00
Nicholas Hastings 21a645e1c6 Another build fix. 2012-06-27 23:17:44 -04:00
Nicholas Hastings e4505b981b Build fix. 2012-06-27 23:14:26 -04:00
Nicholas Hastings 30c9d56e3f Updated Core and SDK Tools for ep2v EmitSound sdk change. 2012-06-27 23:08:54 -04:00
Nicholas Hastings e29cf999a9 Triggering a build. 2012-06-27 22:19:04 -04:00
Nicholas Hastings df9ae818db Updated TF2 gamedata. 2012-06-27 21:41:04 -04:00
Nicholas Hastings f725ee4fb4 Updated Nuclear Dawn gamedata. 2012-06-20 21:00:53 -04:00
Nicholas Hastings ce51189e9a Re-adding -dev tag and bumping version. 2012-06-09 21:45:20 -04:00
Nicholas Hastings 84ffb3de43 Added tag sourcemod-1.4.3 for changeset 608f4c94872e 2012-06-09 21:43:58 -04:00
Nicholas Hastings cc5d87578f Updated changelog and versioning for version 1.4.3. 2012-06-09 20:23:32 -04:00
Asher Baker 123a5c6f66 Worked around possible admin detection issues on newer engines (bug 5327, r=psychonic). 2012-06-09 20:00:55 -04:00
Asher Baker 9e20e01ee4 Lowered default think time to 20ms (bug 4733, r=psychonic). 2012-06-08 20:31:42 -04:00
Asher Baker c275bcdb96 Fixed CStrike extension shutdown crash (bug 5328, r=psychonic). 2012-06-08 20:29:06 -04:00
Nicholas Hastings 0036fe29cd Updated TF2 gamedata. 2012-05-31 22:47:08 -04:00
Nicholas Hastings 6e6655f577 Fixed compile error on gcc. 2012-05-31 07:43:11 -04:00
Nicholas Hastings 66220ba56a Merge. 2012-05-31 07:35:05 -04:00
Nicholas Hastings d0e54cafe7 Fixed crash when passed bad ref in ReferenceToEntity (bug 5330, r=asherkin). 2012-05-31 07:32:07 -04:00
Tony 20bdc2b435 Added GetGameTickCount native (bug 5209, r=psychonic). 2012-05-30 14:14:54 +01:00
Asher Baker ad2650b0aa Fixed intermittent crashes in clientprefs (bug 4660, r=psychonic). 2012-05-29 17:43:33 +01:00
Asher Baker 4ac8430608 Fixed erroneous const-qualification of name param of GetAdminUsername (bug 5267, r=psychonic). 2012-05-28 00:47:55 +01:00
Asher Baker c6405bfb63 Merge. 2012-05-27 01:56:15 +01:00
Ryan Stecker cdbaac15a1 Exposed extensions list to clients (bug 5221, r=asherkin). 2012-05-27 01:44:02 +01:00
Tony d2cf4e3364 Adding missing SetMenuNoVoteButton native declaration (bug 4522, r=asherkin). 2012-05-27 01:40:53 +01:00
Asher Baker bce587edca Fixed possible crash when reloading a plugin with an invalid binary (bug 5288, r=psychonic). 2012-05-27 01:39:05 +01:00
Asher Baker f55a11b8cf Fixed intermittent crash when looking for an invalid signature (bug 5301, r=fyren). 2012-05-27 01:37:23 +01:00
Asher Baker 71f73ddc3a Fixed error when reloading dependant plugins using aliased natives (bug 5302, r=psychonic). 2012-05-27 01:34:46 +01:00
FlaminSarge 693c0cf41b Updated TF2 condition defines (bug 5259, r=psychonic). 2012-05-26 19:17:49 -04:00
FlaminSarge ce77a86808 Fixed client console vote output missing newlines (bug 5205, r=psychonic). 2012-05-26 18:25:28 -04:00
FlaminSarge a8242fd7e3 Fixed client console vote progress not displaying in some cases (bug 5290, r=psychonic). 2012-05-26 16:25:05 -04:00
Nicholas Hastings cfe8757570 Log functions now respect sv_logecho (bug 5135, r=asherkin). 2012-05-24 16:10:01 +01:00
Asher Baker 896d949a82 Made clientprefs attempt to reconnect to the database on map change (bug 4745, r=dvander). 2012-05-24 16:07:10 +01:00
Asher Baker 391807c8ce Updated the location of the blue crab (bug 4959, r=pred). 2012-05-24 16:04:51 +01:00
Asher Baker 39539757cf Fixed typo in logic bridge (bug 5287, r=psychonic). 2012-05-24 15:59:34 +01:00
Asher Baker 479b1e8225 Fixed Float negation operator (bug 5292, r=psychonic). 2012-05-24 15:57:55 +01:00
Nicholas Hastings 956259b336 Updated CS:S gamedata for today's update. 2012-05-22 17:32:04 -04:00
Nicholas Hastings e6b7b79127 Fixed tier0 error and broken SourceTV detection on L4D1 (bug 5216, r=asherkin). 2012-04-28 13:53:33 -04:00
Nicholas Hastings a1f6c94f1e Updated Garry's Mod gamedata. 2012-04-28 13:47:35 -04:00
Asher Baker 5f312fb76e Fixed client serials not being unique on Windows (bug 5285, r=psychonic). 2012-04-26 17:03:44 +01:00
Asher Baker b231caae50 Updated TF2 RemoveDisguise gamedata. 2012-04-18 21:16:01 -04:00
Paul Clothier 5596e65f6d Fixed IServer in SDKTools on Windows. 2012-04-17 22:27:03 -04:00
Nicholas Hastings fc7f7efc4b Fixed tempents gamedata on GMod. 2012-04-18 07:17:18 -04:00
Ryan Stecker 8a73628451 Updated more TF2 gamedata. 2012-04-18 07:12:19 -04:00
Ryan Stecker 1928cb7e33 Updated Windows ep2v tempent gamedata. 2012-04-18 00:16:34 -04:00
Nicholas Hastings 67b7df2a4e Always trust Wazz. 2012-04-17 22:12:44 -04:00
Nicholas Hastings fd5033120a Fixed tempent gamedata on Windows. Fixed cstrike gamedata. 2012-04-17 22:07:25 -04:00
Nicholas Hastings 080ee88b17 Updated more ep2v gamedata. 2012-04-17 21:17:32 -04:00
Paul Clothier 7951515ff3 Updated ep2v and TF2 gamedata. 2012-04-17 21:17:09 -04:00
Nicholas Hastings d1568472c6 Re-adding -dev tag and bumping version. 2012-04-13 22:41:49 -04:00
Nicholas Hastings 227e2e1b0c Added tag sourcemod-1.4.2 for changeset 0026e1394254 2012-04-13 22:40:32 -04:00
Nicholas Hastings 7b0bbbd463 Removing -dev tags from version. 2012-04-13 20:37:24 -04:00
Nicholas Hastings b1a904c7a5 Updated changelog for version 1.4.2. 2012-04-13 20:35:57 -04:00
David Anderson 7a124f2aa2 Fix bug in lower-casing API guarantee (r=fyren). 2012-04-13 16:50:44 -07:00
FlaminSarge b002adc509 Fixed potential player lag issue when "drugged" (bug 5217, r=asherkin). 2012-04-14 00:15:50 +01:00
FlaminSarge 2e34f2e67c Fixed sm_drug not toggling correctly (bug 5218, r=psychonic). 2012-04-14 00:12:56 +01:00
Ryan Stecker 315a5c642e Fixed return value of VoteMenuToAll (bug 5254, r=asherkin). 2012-04-14 00:07:39 +01:00
Drifter 3697bc3866 Fixed crash with StoreToAddress if memory wasn't writable (bug 5252, r=asherkin). 2012-04-14 00:00:25 +01:00
Scott Ehlert a63ea2a68d Fixed build scripts for OS X 10.7 build slave. 2012-03-21 21:35:07 -05:00
Scott Ehlert e299092ff5 Removed hardcoded SDK path for curl on OS X. 2012-03-21 22:04:05 -05:00
Reuben Morais f0b69facb3 Removed hardcoded SDK path on OS X (bug 5032, r=ds). 2012-03-21 21:27:26 -05:00
Reuben Morais ab8563f0d4 Followup, re-added check for invalid HL2SDK paths (bug 5023, r=ds). 2012-03-21 21:25:34 -05:00
Michael Busby 1d666b09e2 Fixed StoreToAddress always writing 32 bits and throwing an error (bug 5248, r=asherkin). 2012-03-11 18:07:24 -05:00
Nicholas Hastings 8fcd0478a1 Added better cross-engine support for finding Valve commandline (bug 5216, r=asherkin). 2012-03-04 15:19:58 -05:00
Nicholas Hastings 3c50ed1cf2 Added new TFHoliday_Christmas to TFHoliday enum (bug 5194, r=asherkin). 2011-12-16 09:43:05 -05:00
Nicholas Hastings 3a28a09f15 Added new TF2 weapon defines (r=me). 2011-12-16 00:24:03 -05:00
Nicholas Hastings 8e8f284cc3 Updated linux CS:S ClanTagOffset gamedata. 2011-12-08 14:52:20 -05:00
Nicholas Hastings fa4e61b877 Bump to 1.4.2-dev. 2011-12-07 22:47:31 -05:00
Nicholas Hastings a39d94ffe9 Added tag sourcemod-1.4.1 for changeset f74e1dea2ef2 2011-12-07 21:12:31 -05:00
Nicholas Hastings 4326c3d431 Bump stuff for release build. 2011-12-07 21:11:35 -05:00
Nicholas Hastings dc5aca5f20 Added gamedata support for No More Room in Hell (bug 5162). 2011-12-07 20:17:34 -05:00
Brian Simon 9182d92d86 Increased ServerCommandEx's internal buffer (bug 5169, r=asherkin). 2011-12-07 12:13:52 -05:00
Nicholas Hastings 8dc95a114c Backed out changeset: 294fded6a0d0 (bug 4902, bug 5068). 2011-12-07 11:58:09 -05:00
Nicholas Hastings caf22b7233 Added gamedata support for Adreneline Gamer 2 (bug 5186). 2011-12-07 11:54:53 -05:00
Nicholas Hastings 465bebb170 Fixed typo in basebans ban reason (bug 5188, r=me). 2011-12-06 14:42:30 -05:00
Nicholas Hastings f3006a478f Removed GLIBC_2.7 dependency from spcomp (r=fyren). 2011-12-06 14:29:32 -05:00
Nicholas Hastings 9887f9da48 Updated gamedata for Garry's Mod. 2011-12-02 10:04:28 -05:00
Nicholas Hastings cfe11be9c9 Updated gamedata for HL2MP and DOD:S. 2011-11-29 18:09:51 -05:00
Nicholas Hastings 4118905620 Fixed CS:S gamedata. 2011-11-07 18:23:56 -05:00
Nicholas Hastings 3b7b0d27cb Updated gamedata for today's CS:S update. If wrong, blame gdc! 2011-11-07 18:01:49 -05:00
Nicholas Hastings 9a1713a9f8 Updated TF2_OnIsHolidayActive ret behavior to match doc (bug 5155, r=fyren). 2011-11-04 10:01:33 -04:00
Nicholas Hastings 2995531ca6 Fixed a few minor spacing things in sp incs to not fool API parser. 2011-11-04 10:01:33 -04:00
Nicholas Hastings 46e10e10a0 Fixed sp MaxClients not being updated on map changes after load (bug 5160, r=fyren). 2011-11-04 10:01:28 -04:00
Nicholas Hastings 8fadaff281 Fixed TFHoliday enum (bug 5155, r=asherkin). 2011-11-03 10:03:01 -04:00
Nicholas Hastings fccc1ebb50 Fixed ff trigger printing in triggerer's language to all (bug 5161, r=asherkin). 2011-11-03 09:59:14 -04:00
Nicholas Hastings 03b183e492 Added new TF2 deathflag and dmg custom defines (bug 5157, r=asherkin). 2011-11-03 09:06:59 -04:00
Nicholas Hastings 0e37d2c1bf Registered basecomm as lib to allow requiring it (bug 5156, r=asherkin). 2011-11-03 09:06:22 -04:00
otstrel f7daefc76e Fixed "not connected" error in reserved slots plugin (bug 5158, r=psychonic). 2011-11-03 09:05:40 -04:00
Nicholas Hastings 071b013f5e Preemptive gamedata update for tonight's TF2 update. 2011-11-02 18:24:12 -04:00
Fyren e69d16ff71 Bump to 1.4.1-dev. 2011-10-28 19:50:55 -07:00
Fyren 1f599c8771 Added tag sourcemod-1.4.0 for changeset ddd707c3454c 2011-10-28 19:49:17 -07:00
Fyren 9389a0f138 Bump stuff for release build. 2011-10-28 18:24:01 -07:00
Nicholas Hastings 997687c3ab Updated changelog. 2011-10-28 21:18:51 -04:00
Nicholas Hastings fe05b6c2d0 Updated Dino D-Day gamedata for today's update. 2011-10-28 20:27:44 -04:00
Nicholas Hastings 097ca03761 Added missing EYE def to halflife.inc, updated EYE def# (bug 5151, r=asherkn). 2011-10-28 19:09:40 -04:00
Nicholas Hastings f182cd1d6a TF2 ext fixes for TF2 holiday system changes (bug 5150, r=asherkin). 2011-10-28 19:07:40 -04:00
103 changed files with 2693 additions and 619 deletions
+7
View File
@@ -3,3 +3,10 @@ e6ef5ecdf8d75740ca2685a709bf321f8873bc3b sourcemod-1.1.0
e877885fac80be71822641f7a9122cebc9812521 sourcemod-1.1.1
b3ffa8a4511c4eadaf533fc790aa6b14f7f0c6ea sourcemod-1.1.2
3a73bbf60f34befa9b66be03fa5974b394bb3411 sourcemod-1.2.0
ddd707c3454c382db5db9d28148cd19227f44759 sourcemod-1.4.0
f74e1dea2ef2c5a12b5238badc0e877106804191 sourcemod-1.4.1
0026e1394254c392244c7b140e3075974ab5a6db sourcemod-1.4.2
608f4c94872e3624404a1d105284163bc57fadf7 sourcemod-1.4.3
29186166cc99e73c61995a0bd0450fc6c36466bc sourcemod-1.4.4
9560adae2a7263e6e076d5bc2e1c2838c27d686a sourcemod-1.4.5
56a9ba4cd1e2ca8a583f7e150af058ce5d41ca33 sourcemod-1.4.6
+19 -6
View File
@@ -79,8 +79,9 @@ class SM:
oldhead = head
head, tail = os.path.split(head)
if i.startswith('HL2SDK'):
(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
self.sdkInfo[sdk] = info
if head != None and head != oldhead:
(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
self.sdkInfo[sdk] = info
elif head == None or head == oldhead:
raise Exception('Could not find a valid path for {0}'.format(i))
AMBuild.cache.CacheVariable(i, path)
@@ -119,6 +120,9 @@ class SM:
self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 3) or \
(self.vendor == 'clang' and cxx.majorVersion >= 3):
self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
self.compiler.AddToListVar('CDEFINES', 'GNUC')
if self.vendor == 'gcc':
@@ -183,8 +187,6 @@ class SM:
if self.vendor == 'clang':
self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
elif AMBuild.target['platform'] == 'darwin':
self.compiler.AddToListVar('CFLAGS', ['-isysroot',
'/Developer/SDKs/MacOSX10.5.sdk'])
self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
@@ -266,7 +268,15 @@ class SM:
else:
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
if sdk in ['ep2v', 'l4d', 'l4d2']:
if sdk == 'ep2v':
for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib_srv.so', 'libtier0_srv.so']:
link = os.path.join(workFolder, i)
target = os.path.join(staticLibs, i)
try:
os.lstat(link)
except:
job.AddCommand(SymlinkCommand(link, target))
elif sdk in ['l4d', 'l4d2']:
for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.so', 'libtier0.so']:
link = os.path.join(workFolder, i)
target = os.path.join(staticLibs, i)
@@ -352,7 +362,10 @@ class SM:
if not noLink:
if AMBuild.target['platform'] == 'linux':
compiler['POSTLINKFLAGS'][0:0] = ['-lm']
if sdk in ['ep2v', 'l4d', 'l4d2']:
if sdk == 'ep2v':
compiler['POSTLINKFLAGS'][0:0] = ['libtier0_srv.so']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib_srv.so']
elif sdk in ['l4d', 'l4d2']:
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.so']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
else:
+293
View File
@@ -1,5 +1,298 @@
SourceMod Changelog
SourceMod 1.4.7 [2013-02-06]
URL: http://wiki.alliedmods.net/SourceMod_1.4.7_Release_Notes
User Changes:
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM).
- Updated gamedata for Left 4 Dead 2, Nuclear Dawn, No More Room in Hell, Zombie Panic Source, CSPromod, GoldenEye Source, Synergy, The Hidden, and PVKII.
- Added system to block malware or illegal plugins (bug 5289).
- Fixed a potential crash when a bad entity index is passed to certain functions (bug 5539) (KyleS).
- Added an error message for when auto plugin configs fail to be created due to write error (bug 5465) (Drifter).
- Fixed an issue where a malformed plugin could cause crashes (bug 5478).
Developer Changes:
- Added new values to the TFCond TF2 conditions enum (bug 5537) (FlaminSarge).
- Updated TFHoliday TF2 holidays enum (bug 5526) (Powerlord).
- Fixed regression in SourceMod 1.3.0 causing GetEntPropEnt, GetEntDataEnt2, and GameRules_GetPropEnt to possibly return stale (incorrect) entity indexes in place of -1.
- Added support for < 32-bit unsigned sign extension to GameRules_GetProp lookup (already in GetEntProp since SM 1.4.0).
- Fixed < 32-bit unsigned sign extension in GetEntProp not being applied for array prop elements (bug 5591).
- Fixed value size auto-detection in GetEntProp and GameRules_GetProp for ep2v's new SPROP_VARINT sendprops.
- Fixed Sort_Random sort type not including first value in array sorting functions (bug 4292) (Peace-Maker).
- Fixed GameRules_SetPropVector writing data to unexpected addresses instead of to the gamerules proxy entity (bug 5592) (ProdigySim).
- Fixed VoteMenuToAll stock adding bots to list (bug 5253 (VoiDeD).
----------------------------------------------------------
SourceMod 1.4.6 [2012-09-04]
URL: http://wiki.alliedmods.net/SourceMod_1.4.6_Release_Notes
User Changes:
- Fixed extraneous errors resulting from a bug in 1.4.5.
----------------------------------------------------------
SourceMod 1.4.5 [2012-09-03]
URL: http://wiki.alliedmods.net/SourceMod_1.4.5_Release_Notes
User Changes:
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Updated Nuclear Dawn, Dino D-Day, and Zombie Panic gamedata.
- Added compatibility for running on Metamod:Source 1.9.0.
- Fixed very minor memory leaks in CStrike extension (bug 5456) (KyleS).
- Fixed crash from plugins accessing netprops too early (bug 5297) (KyleS).
- Fixed crash from plugins trying to access nested datadesc members (bug 5446).
Developer Changes:
- Added new TF2 weapon and custom dmg defines.
- Added new TF2 TFHoliday value (bug 5436) (Powerlord).
- Fixed IClientListener::InterceptClientConnect not being able to properly block connections (bug 5461) (PimpinJuice).
- Fixed PrepSDKCall_SetSignature native not working with symbol names on L4D2 linux (bug 5440).
- Fixed resolution of GetProfilerTime native on non-Windows platforms.
-----------------------------
SourceMod 1.4.4 [2012-07-03]
URL: http://wiki.alliedmods.net/SourceMod_1.4.4_Release_Notes
User Changes:
- Updated support for latest Source 2009 engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Updated Nuclear Dawn gamedata.
- Fixed a crash that could occur when selecting an option on a clientprefs prefab menu (bug 5374).
Developer Changes:
- Added new TF2 weapon and custom dmg defines.
- Added new TF2 TFHoliday value (bug 5364) (Powerlord).
- Updated sample extension to properly fill ninvoke with INativeInvoker ptr (bug 5340) (Afronanny).
-----------------------------
SourceMod 1.4.3 [2012-06-09]
URL: http://wiki.alliedmods.net/SourceMod_1.4.3_Release_Notes
User Changes:
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Made clientprefs attempt to reconnect to the database on map change (bug 4745).
- Log functions now respect sv_logecho (bug 5135).
- Fixed client console vote output (bug 5290, bug 5205) (FlaminSarge).
- Fixed error when reloading dependant plugins using aliased natives (bug 5302).
- Fixed intermittent crash when looking for an invalid signature (bug 5301).
- Fixed possible crash when reloading a plugin with an invalid binary (bug 5288).
- Exposed extensions list to clients (bug 5221) (VoiDeD).
- Fixed intermittent crashes in clientprefs (bug 4660).
- Fixed crash when passing an invalid entity reference to ReferenceToEntity (bug 5330).
- Fixed cstrike extension crash on shutdown (bug 5328).
- Lowered threading API think time to 20ms, making threaded MySQL queries complete faster (bug 4733).
Developer Changes:
- Fixed client serials not being unique on Windows (bug 5285).
- Fixed broken SourceTV detection on L4D1 (bug 5216).
- Fixed Float negation operator (bug 5292).
- Updated TF2 condition defines (bug 5259) (FlaminSarge).
- Adding missing SetMenuNoVoteButton native declaration (bug 4522) (GoD-Tony).
- Fixed erroneous const-qualification of name param of GetAdminUsername (bug 5267).
- Added GetGameTickCount native (bug 5209) (GoD-Tony).
-----------------------------
SourceMod 1.4.2 [2011-04-13]
URL: http://wiki.alliedmods.net/SourceMod_1.4.2_Release_Notes
User Changes:
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Fixed regression in SourceMod 1.4.0 causing SM to cause load errors on The Ship (bug 5216).
- Fixed toggling and player lag issues with sm_drug command (bugs 5217, 5218) (FlaminSarge).
Developer Changes:
- Updated TF2-specific defines and enums (bug 5194).
- Fixed StoreToAddress always writing 32 bits and throwing an error (bug 5248) (ProdigySim).
- Fixed crash with StoreToAddress if memory wasn't writable (bug 5252) (Dr!fter).
- Fixed return value of VoteMenuToAll (bug 5254) (VoiDeD).
- Fixed bug in command lower-casing API guarantee
-----------------------------
SourceMod 1.4.1 [2011-12-07]
URL: http://wiki.alliedmods.net/SourceMod_1.4.1_Release_Notes
User Changes:
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Added gamedata for Adrenaline Gamer 2 and No More Room in Hell.
- Fixed "not connected" error in reserve slots plugin (bug 5158) (ostrel).
- Fixed ff trigger output printing to all in triggerer's language (rather than viewer's language) (bug 5161).
- Fixed typo in one of basebans ban reasons (bug 5188).
- Fixed formatting error in Swedish "Vote Count" phrase (bug 5174).
Developer Changes:
- Fixed sp MaxClients not being updated on map changes after load (bug 5160).
- Removed GLIBC_2.7 dependency from spcomp.
- Increased buffer for sm_rcon command to fit larger responses (bug 5169).
- BaseComm now properly registers a library allowing it to be required by other plugins (bug 5156).
- Fixed TFHoliday enum values (bug 5155).
- Updated TF2_OnIsHolidayActive ret behavior to match doc (bug 5155).
- Added new TF2 deathflag and dmg custom defines (bug 5157).
-----------------------------
SourceMod 1.4.0 [2011-10-28]
URL: http://wiki.alliedmods.net/SourceMod_1.4.0_Release_Notes
User Changes:
- Added support for Max OS X (bug 4392).
- Added support for Bloody Good Time (bug 4780).
- Added support for E.Y.E Divine Cybermancy (bug 5035).
- Added gamedata for Nuclear Dawn.
- Added gamedata for International Online Soccer: Source (bug 5019).
- Added gamedata for Half-Life 2 Capture the Flag (bug 5114).
- Updated mapchooser and other base plugins with Nuclear Dawn specific fixes (bug 5117).
- Fixed ServerLang value not being read properly on startup (bug 4675).
- Added support for aliases in languages.cfg (bug 4858).
- Added output display to sm_rcon command (bug 5018).
- Flood protection bypass access can now be overridden with command name sm_flood_access (bug 4584).
- Added a reset argument to sm cvars command to revset cvar values to default (bug 5043).
- Fixed incorrect language identifiers for Chinese (both Trad. and Simplified) and Brazilian Portuguese not matching cl_language values (bug 5067).
- Added translation support for Bulgarian (bg).
- Fixed incorrect number of slots being hidden for reserve with sm_hideslots on Source 2009 with SourceTV or replay (bug 5094).
- sm_hideslots changes now take effect immediately instead of waiting until a client joins or leaves (bug 5094).
- Fixed sv_visiblemaxplayers getting stuck at previous max clients in some cases with reserves and SourceTV or replay (bug 5094).
- Removed error logging if an optional extension is not found (bug 5112).
- Fixed bots with semicolon in name being unkickable (bug 5120).
- Changed strings in ice-related funcommands to be translatable (bug 4540).
- Changed Bintools extension to use a single build for every engine (bug 4548).
Developer Changes:
- Provided native interface for basecomm (bug 2594).
- Client language detection is too late. (bug 3714) (Tony A. "GoD-Tony").
- Added ServerCommandEx native to execute server command and retrieve output (bug 3873).
- Added ability to update clientprefs cookies values on clients not currently connected (bug 3882) (databomb).
- Added library "matchmaking_ds" support to gamedata lookups (bug 4158).
- Rooted menu handles to callbacks (bug 4353).
- Fixed corner cases with ExplodeString (bug 4629). (Michael "LumiStance").
- Fixed return omission with else-after-return (bug 4852).
- Added OnConditionAdded and OnConditionRemoved forwards to TF2 extension (bug 4851).
- Added new natives and forward to the cstrike extension (bug 4732, bug 4985) (Dr!fter).
- Added WaitingForPlayers forwards to the TF2 extension (bug 4704) (CrimsonGT).
- Updated and added more TF2 condition, weapon, and damagecustom defines (multiple bug#s).
- Fixed TF2_RemoveCondition not always removing conditions (bug 4981).
- Fixed MaxClients not being updated correctly in some places with SourceTV or replay active (bug 4986).
- Fixed some vars not being marked for init on first compile pass (bug 4643).
- Increased symbol name limit to 63 characters (bug 4564) (javalia).
- Fixed crash when dynamic arrays run out of memory (bug 4632).
- Fixed a crash that could happen from looking up out-of-bounds edict or entity indexes (bug 5080).
- Fixed client serials not getting cleared on disconnect (bug 5121).
- Added error on declaring arrays that the compiler is too buggy to handle (bug 4977).
- Removed reliance on gamedata for multiple SDKTools functions in ep2 and later (bug 4899).
- Added InvalidateClient and ReconnectClient natives to SDKTools (bug 4931) (Brian "Afronanny" Simon).
- Added ability to lookup and set values on the gamerules class (bug 4983.
- BaseComm now uses AddCommandListener for chat hooks (bug 4991).
- Fixed shutdown bug in SDKTools (bug 5063).
- Fixed MM-enabled extensions continuing to load after failing MM attach (bug 5042).
- Added GetDistGainFromSoundLevel native to SDKTools (bug 5066) (javalia).
- Added CheckAccess native to check an AdminId's command access (bug 5083).
- Fixed GetEntProp not sign-extending unsigned values less than 32 bits (bug 5105).
- Fixed crashing when calling CreateEntityByName or CreateFakeClient when no map is running (now errors) (bug 5119).
- Fixed erring in kick function (e. bad translation) causing client to become unkickable until disconnect (bug 5120).
- Fixed KickClientEx not immediately kicking client if client was in kick queue (bug 5120).
- Added IsClientSourceTV and IsClientReplay natives (bug 5124).
- Added support for getting and setting individual array elements with Get/Set EntProp functions (bug 4160).
- Added support for threaded query handles to SQL_GetInsertId and SQL_GetAffectedRows (bug 4699) (Nephyrin).
- Added a GetGameRules function to ISDKTools for extensions to easily get the GameRules class pointer (bug 4707).
- Added GetMessageName to IUserMessages (bug 4573) (Zach "theY4Kman" Kanzler)
- Added HintTextMsg to IGameHelpers (bug 4950).
- Added ProcessTargetString simple filter API (bug 4404).
- Moved much functionality from core bins to logic bin (bug 4406, bug 4402).
- Fixed bogus asserts in sp compiler (bug 4486, bug 4487).
- Greatly improved sp compiler performance (~5x overall speedup) (bug 3820, bug 4493, bug 4495).
- Changed entity output detours to use CDetour (bug 4416).
- Enhanced nominations API (bug 4677) (CrimsonGT).
- Added Linux support for profiling natives (bug 4927).
- Added a new ValveCallType that allows for arbitrary |this| parameters, as well as associated features in gamedata and for reading/writing memory (bug 3520) (Downtown1).
- Updated TF2 extension to handle Valve's changes to the "holiday" system (bug 5150).
-----------------------------
SourceMod 1.3.8 [2011-06-23]
URL: http://wiki.alliedmods.net/SourceMod_1.3.8_Release_Notes
User Changes:
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Updated support for various games, including Garry's Mod, Zombie Panic, and Dino D-Day.
- Added gamedata for Eternal Silence.
- Fixed libgcc_s.so.1 load error present on some systems (bug 4876).
- Handle leak notices now print to error log (in addition fatal log) (bug 4929).
- Translator now properly falls back on bad server language (bug 4861).
- Fixed invalid client errors from bad MaxClients value when SourceTV is late-loaded (bug 4881).
- Fixed crash on plugin unload when two commands exist with same name, different casing (bug 4698).
Developer Changes:
- Updated TF2 condition defines (bug 4916).
- Fixed var names and docs for TF2_MakeBleed native (bug 4928).
- Removed compiler double include check (bug 4863).
- Fixed plugin compile errors when using GetEntityClassname (bug 4798).
---------------------------
SourceMod 1.3.7 [2011-04-15]
URL: http://wiki.alliedmods.net/SourceMod_1.3.7_Release_Notes
User Changes:
- Updated support for latest OrangeBox engine changes (CS:S, DoD:S, TF2, HL2DM, GMod).
- Updated support for various games, including Zombie Panic, CS ProMod, Empires, and GoldenEye: Source.
- Added gamedata for Dino D-Day.
- Fix precedence of voice mute flag versus specific client overrides (bug 4826).
- Fix mistaken unhooking of voice hooks (bug 4804).
- Fixed graphical glitches with funcommands effects in L4D1 (bug 3486).
- Fixed bug in nominations that could cause "Unknown command" error (bug 4797).
- Removed tv_enable hook to fix rare max client count issue (bug 4791).
- Added missing unhooking of ClientConnect in PlayerManager (bug 4749).
- Fixed sm_rtv printing "unknown command" (bug 4730).
- Fixed voting crash when client console, chat, and SourceTV are enabled (bug 4676).
- Fixed CDetour crash in TF2 extension when last plugin using forward is unloaded (bug 4713).
Developer Changes:
- SetEntProp now marks edict state as changed (bug 4855).
- Added GetEntityClassname stock (bug 4798).
- Fix compiler hanging when #including a directory (bug 4822).
- Added GetEntityFlags and SetEntityFlags natives for better cross-engine compatibility. (bug 4809).
- Fixed ClientPrefs natives not being marked optional when REQUIRE_EXTENSIONS not defined (bug 4839).
- Changed some instances of LogMessage to LogAction (bug 4649).
- Added some new language natives (bug 4613).
- Fixed SetTeamScore not updating score on client (bug 2736).
- Raised MAXPLAYERS from 64 to 65 (bug 4490).
- Added and updated many TF2-specific defines in tf2.inc and tf2_stocks.inc.
- Fixed TF2_GetPlayerConditionFlags no longer necessarily returning all set flags (bug 4726).
- Fixed profiler flush not clearing, added 'report' and 'clear' (bug 4674).
- Fixed GetPlayerDecalFile crash on L4D and L4D2 (bug 4729).
- Fixed TF2_OnGetHoliday detour no longer firing under all circumstances (bug 4700).
- Added TF2_IsPlayerInDuel native to TF2 extension (bug 4695).
----------------------------
SourceMod 1.3.6 [2010-10-31]
+10
View File
@@ -107,4 +107,14 @@
* Currently this will log details about the gamedata updating process.
*/
"DebugSpew" "no"
/**
* Enables or disables whether SourceMod blocks known or potentially malicious plugins from loading.
* It is STRONGLY advised that this is left enabled, there have been cases in the past with plugins that
* allow anyone to delete files on the server, gain full rcon control, etc.
*
* "yes" - Block malware or illegal plugins from loading (default)
* "no" - Warn about malware or illegal plugins loading
*/
"BlockBadPlugins" "yes"
}
+5
View File
@@ -664,6 +664,11 @@ cell_t ConsoleDetours::InternalDispatch(int client, const CCommand& args)
char name[255];
const char *realname = args.Arg(0);
size_t len = strlen(realname);
// Disallow command strings that are too long, for now.
if (len >= sizeof(name) - 1)
return Pl_Continue;
for (size_t i = 0; i < len; i++)
{
if (realname[i] >= 'A' && realname[i] <= 'Z')
+5
View File
@@ -452,6 +452,11 @@ bool SM_ExecuteConfig(CPlugin *pl, AutoConfig *cfg, bool can_create)
can_create = false;
fclose(fp);
}
else
{
g_Logger.LogError("Failed to auto generate config for %s, make sure the directory has write permission.", pl->GetFilename());
return can_create;
}
}
}
+89
View File
@@ -37,6 +37,7 @@
#include "sourcemm_api.h"
#include "sm_srvcmds.h"
#include "sm_stringutil.h"
#include "PlayerManager.h"
CExtensionManager g_Extensions;
IdentityType_t g_ExtType;
@@ -1284,6 +1285,94 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
g_RootMenu.DrawGenericOption("unload", "Unload an extension");
}
void CExtensionManager::ListExtensionsToClient(CPlayer *player, const CCommand &args)
{
char buffer[256];
int numExtensions = m_Libs.size();
edict_t *edict = player->GetEdict();
unsigned int id = 0;
unsigned int start = 0;
if (!numExtensions)
{
ClientConsolePrint(edict, "[SM] No extensions found.");
return;
}
if (args.ArgC() > 2)
{
start = atoi(args.Arg(2));
}
CExtension *ext;
SourceHook::List<CExtension *>::iterator iter;
for (iter = m_Libs.begin();
iter != m_Libs.end();
iter++)
{
ext = (*iter);
char error[255];
if (!ext->IsRunning(error, sizeof(error)))
{
continue;
}
id++;
if (id < start)
{
continue;
}
if (id - start > 10)
{
break;
}
IExtensionInterface *api = ext->GetAPI();
const char *name = api->GetExtensionName();
const char *version = api->GetExtensionVerString();
const char *author = api->GetExtensionAuthor();
const char *description = api->GetExtensionDescription();
size_t len = UTIL_Format(buffer, sizeof(buffer), " \"%s\"", name);
if (version != NULL && IS_STR_FILLED(version))
{
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, " (%s)", version);
}
if (author != NULL && IS_STR_FILLED(author))
{
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, " by %s", author);
}
if (description != NULL && IS_STR_FILLED(description))
{
len += UTIL_Format(&buffer[len], sizeof(buffer)-len, ": %s", description);
}
ClientConsolePrint(edict, "%s", buffer);
}
while (iter != m_Libs.end())
{
char error[255];
if ((*iter)->IsRunning(error, sizeof(error)))
{
break;
}
}
if (iter != m_Libs.end())
{
ClientConsolePrint(edict, "To see more, type \"sm exts %d\"", id);
}
}
CExtension *CExtensionManager::GetExtensionFromIdent(IdentityToken_t *ptr)
{
if (ptr->type == g_ExtType)
+4
View File
@@ -45,6 +45,8 @@
#include "PluginSys.h"
#include "NativeOwner.h"
class CPlayer;
using namespace SourceMod;
using namespace SourceHook;
@@ -175,6 +177,8 @@ public:
bool LibraryExists(const char *library);
void CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
void AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface);
public:
void ListExtensionsToClient(CPlayer *player, const CCommand &args);
public:
CExtension *GetExtensionFromIdent(IdentityToken_t *ptr);
void Shutdown();
+160 -6
View File
@@ -38,7 +38,31 @@
#include <IGameConfigs.h>
#include <compat_wrappers.h>
#include <Logger.h>
#include "LibrarySys.h"
#include "logic_bridge.h"
#include <tier0/mem.h>
typedef ICommandLine *(*FakeGetCommandLine)();
#if defined _WIN32
#define TIER0_NAME "tier0.dll"
#define VSTDLIB_NAME "vstdlib.dll"
#elif defined __APPLE__
#define TIER0_NAME "libtier0.dylib"
#define VSTDLIB_NAME "libvstdlib.dylib"
#elif defined __linux__
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
#define TIER0_NAME "libtier0_srv.so"
#define VSTDLIB_NAME "libvstdlib_srv.so"
#elif SOURCE_ENGINE >= SE_LEFT4DEAD
#define TIER0_NAME "libtier0.so"
#define VSTDLIB_NAME "libvstdlib.so"
#else
#define TIER0_NAME "tier0_i486.so"
#define VSTDLIB_NAME "vstdlib_i486.so"
#endif
#endif
CHalfLife2 g_HL2;
ConVar *sv_lan = NULL;
@@ -131,6 +155,12 @@ void CHalfLife2::OnSourceModAllInitialized()
}
void CHalfLife2::OnSourceModAllInitialized_Post()
{
InitLogicalEntData();
InitCommandLine();
}
void CHalfLife2::InitLogicalEntData()
{
char *addr = NULL;
@@ -196,6 +226,64 @@ void CHalfLife2::OnSourceModAllInitialized_Post()
}
}
void CHalfLife2::InitCommandLine()
{
char path[PLATFORM_MAX_PATH];
char error[256];
g_SourceMod.BuildPath(Path_Game, path, sizeof(path), "../bin/" TIER0_NAME);
if (!g_LibSys.IsPathFile(path))
{
g_Logger.LogError("Could not find path for: " TIER0_NAME);
return;
}
ILibrary *lib = g_LibSys.OpenLibrary(path, error, sizeof(error));
m_pGetCommandLine = lib->GetSymbolAddress("CommandLine_Tier0");
/* '_Tier0' dropped on Alien Swarm version */
if (m_pGetCommandLine == NULL)
{
m_pGetCommandLine = lib->GetSymbolAddress("CommandLine");
}
if (m_pGetCommandLine == NULL)
{
/* We probably have a Ship engine. */
lib->CloseLibrary();
g_SourceMod.BuildPath(Path_Game, path, sizeof(path), "../bin/" VSTDLIB_NAME);
if (!g_LibSys.IsPathFile(path))
{
g_Logger.LogError("Could not find path for: " VSTDLIB_NAME);
return;
}
if ((lib = g_LibSys.OpenLibrary(path, error, sizeof(error))) == NULL)
{
g_Logger.LogError("Could not load %s: %s", path, error);
return;
}
m_pGetCommandLine = lib->GetSymbolAddress("CommandLine");
if (m_pGetCommandLine == NULL)
{
g_Logger.LogError("Could not locate any command line functionality");
}
lib->CloseLibrary();
}
}
ICommandLine *CHalfLife2::GetValveCommandLine()
{
if (!m_pGetCommandLine)
return NULL;
return ((FakeGetCommandLine)((FakeGetCommandLine *)m_pGetCommandLine))();
}
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool CHalfLife2::IsOriginalEngine()
{
@@ -245,8 +333,13 @@ bool UTIL_FindInSendTable(SendTable *pTable,
return false;
}
typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name)
typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name, bool *isNested)
{
if (isNested)
{
*isNested = false;
}
while (pMap)
{
for (int i=0; i<pMap->dataNumFields; i++)
@@ -261,10 +354,21 @@ typedescription_t *UTIL_FindInDataMap(datamap_t *pMap, const char *name)
}
if (pMap->dataDesc[i].td)
{
typedescription_t *_td;
if ((_td=UTIL_FindInDataMap(pMap->dataDesc[i].td, name)) != NULL)
if (isNested)
{
return _td;
*isNested = (UTIL_FindInDataMap(pMap->dataDesc[i].td, name, NULL) != NULL);
if (*isNested)
{
return NULL;
} else {
continue;
}
} else { // Use the old behaviour, we dont want to spring this on extensions - even if they're doing bad things.
typedescription_t *_td;
if ((_td=UTIL_FindInDataMap(pMap->dataDesc[i].td, name, NULL)) != NULL)
{
return _td;
}
}
}
}
@@ -357,6 +461,11 @@ SendProp *CHalfLife2::FindInSendTable(const char *classname, const char *offset)
}
typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset)
{
return this->FindInDataMap(pMap, offset, NULL);
}
typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset, bool *isNested)
{
typedescription_t *td = NULL;
DataMapTrie &val = m_Maps[pMap];
@@ -367,7 +476,7 @@ typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset
}
if (!sm_trie_retrieve(val.trie, offset, (void **)&td))
{
if ((td = UTIL_FindInDataMap(pMap, offset)) != NULL)
if ((td = UTIL_FindInDataMap(pMap, offset, isNested)) != NULL)
{
sm_trie_insert(val.trie, offset, td);
}
@@ -748,6 +857,11 @@ cell_t CHalfLife2::EntityToReference(CBaseEntity *pEntity)
CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
{
if ((unsigned)entRef == INVALID_EHANDLE_INDEX)
{
return NULL;
}
CEntInfo *pInfo = NULL;
if (entRef & (1<<31))
@@ -757,7 +871,7 @@ CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
CBaseHandle hndl(hndlValue);
pInfo = LookupEntity(hndl.GetEntryIndex());
if (pInfo->m_SerialNumber != hndl.GetSerialNumber())
if (!pInfo || pInfo->m_SerialNumber != hndl.GetSerialNumber())
{
return NULL;
}
@@ -882,6 +996,11 @@ cell_t CHalfLife2::EntityToBCompatRef(CBaseEntity *pEntity)
IServerUnknown *pUnknown = (IServerUnknown *)pEntity;
CBaseHandle hndl = pUnknown->GetRefEHandle();
if (hndl == INVALID_EHANDLE_INDEX)
{
return INVALID_EHANDLE_INDEX;
}
if (hndl.GetEntryIndex() >= MAX_EDICTS)
{
return (hndl.ToInt() | (1<<31));
@@ -920,3 +1039,38 @@ int CHalfLife2::GetSendPropOffset(SendProp *prop)
return prop->GetOffset();
}
const char *CHalfLife2::GetEntityClassname(edict_t * pEdict)
{
if (pEdict == NULL || pEdict->IsFree())
{
return NULL;
}
IServerUnknown *pUnk = pEdict->GetUnknown();
if (pUnk == NULL)
{
return NULL;
}
CBaseEntity * pEntity = pUnk->GetBaseEntity();
if (pEntity == NULL)
{
return NULL;
}
return GetEntityClassname(pEntity);
}
const char *CHalfLife2::GetEntityClassname(CBaseEntity *pEntity)
{
static int offset = -1;
if (offset == -1)
{
datamap_t *pMap = GetDataMap(pEntity);
typedescription_t *pDesc = FindInDataMap(pMap, "m_iClassname");
offset = GetTypeDescOffs(pDesc);
}
return *(const char **)(((unsigned char *)pEntity) + offset);
}
+9
View File
@@ -44,6 +44,7 @@
#include <server_class.h>
#include <datamap.h>
#include <ihandleentity.h>
#include <tier0/icommandline.h>
class CCommand;
@@ -114,6 +115,7 @@ public: //IGameHelpers
datamap_t *GetDataMap(CBaseEntity *pEntity);
ServerClass *FindServerClass(const char *classname);
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset);
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset, bool *isNested);
void SetEdictStateChanged(edict_t *pEdict, unsigned short offset);
bool TextMsg(int client, int dest, const char *msg);
bool HintTextMsg(int client, const char *msg);
@@ -136,6 +138,9 @@ public: //IGameHelpers
cell_t EntityToBCompatRef(CBaseEntity *pEntity);
void *GetGlobalEntityList();
int GetSendPropOffset(SendProp *prop);
ICommandLine *GetValveCommandLine();
const char *GetEntityClassname(edict_t *pEdict);
const char *GetEntityClassname(CBaseEntity *pEntity);
public:
void AddToFakeCliCmdQueue(int client, int userid, const char *cmd);
void ProcessFakeCliCmdQueue();
@@ -151,6 +156,9 @@ public:
#endif
private:
DataTableInfo *_FindServerClass(const char *classname);
private:
void InitLogicalEntData();
void InitCommandLine();
private:
Trie *m_pClasses;
List<DataTableInfo *> m_Tables;
@@ -163,6 +171,7 @@ private:
CStack<DelayedFakeCliCmd *> m_FreeCmds;
CStack<CachedCommandInfo> m_CommandStack;
Queue<DelayedKickInfo> m_DelayedKicks;
void *m_pGetCommandLine;
};
extern CHalfLife2 g_HL2;
+7 -1
View File
@@ -265,6 +265,8 @@ void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
return;
}
static ConVar *sv_logecho = icvar->FindVar("sv_logecho");
char buffer[3072];
UTIL_FormatArgs(buffer, sizeof(buffer), msg, ap);
@@ -275,7 +277,11 @@ void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
fprintf(fp, "L %s: %s\n", date, buffer);
g_SMAPI->ConPrintf("L %s: %s\n", date, buffer);
if (!sv_logecho || sv_logecho->GetBool())
{
g_SMAPI->ConPrintf("L %s: %s\n", date, buffer);
}
}
void Logger::LogToFileOnlyEx(FILE *fp, const char *msg, va_list ap)
+3
View File
@@ -331,6 +331,9 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
ATTN_NORM,
0,
PITCH_NORM,
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
0,
#endif
&pos);
}
}
+2 -2
View File
@@ -518,7 +518,7 @@ void VoteMenuHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int ite
m_Votes[item]++;
m_NumVotes++;
if (sm_vote_chat.GetBool() || sm_vote_console.GetBool())
if (sm_vote_chat.GetBool() || sm_vote_console.GetBool() || sm_vote_client_console.GetBool())
{
static char buffer[1024];
ItemDrawInfo dr;
@@ -560,7 +560,7 @@ void VoteMenuHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int ite
if (sm_vote_client_console.GetBool())
{
engine->ClientPrintf(pPlayer->GetEdict(), buffer);
ClientConsolePrint(pPlayer->GetEdict(), buffer);
}
}
}
+24 -5
View File
@@ -44,7 +44,6 @@
#include "HalfLife2.h"
#include <inetchannel.h>
#include <iclient.h>
#include <tier0/icommandline.h>
#include <IGameConfigs.h>
#include "ExtensionSys.h"
#include <sourcemod_version.h>
@@ -244,7 +243,8 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
// clientMax will not necessarily be correct here (such as on late SourceTV enable)
m_maxClients = gpGlobals->maxClients;
m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && CommandLine()->FindParm("-nohltv") == 0);
ICommandLine *commandLine = g_HL2.GetValveCommandLine();
m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && (!commandLine || commandLine->FindParm("-nohltv") == 0));
m_bIsReplayActive = false;
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
m_bIsReplayActive = (replay_enable && replay_enable->GetBool());
@@ -263,10 +263,10 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
memset(m_AuthQueue, 0, sizeof(unsigned int) * (ABSOLUTE_PLAYER_LIMIT + 1));
g_NumPlayersToAuth = &m_AuthQueue[0];
g_PluginSys.SyncMaxClients(m_maxClients);
}
g_PluginSys.SyncMaxClients(m_maxClients);
g_OnMapStarted = true;
g_Extensions.CallOnCoreMapStart(pEdictList, edictCount, m_maxClients);
@@ -451,7 +451,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
pListener = (*iter);
if (!pListener->InterceptClientConnect(client, reject, maxrejectlen))
{
return false;
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
}
@@ -745,6 +745,11 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
g_PluginSys.ListPluginsToClient(pPlayer, args);
RETURN_META(MRES_SUPERCEDE);
}
else if (args.ArgC() > 1 && strcmp(args.Arg(1), "exts") == 0)
{
g_Extensions.ListExtensionsToClient(pPlayer, args);
RETURN_META(MRES_SUPERCEDE);
}
else if (args.ArgC() > 1 && strcmp(args.Arg(1), "credits") == 0)
{
ClientConsolePrint(pEntity,
@@ -854,6 +859,20 @@ void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
const char *new_name = info ? info->GetName() : engine->GetClientConVarValue(client, "name");
const char *old_name = pPlayer->m_Name.c_str();
#if SOURCE_ENGINE >= SE_LEFT4DEAD
const char *networkid_force;
if ((networkid_force = engine->GetClientConVarValue(client, "networkid_force")) && networkid_force[0] != '\0')
{
unsigned long long *steamId = (unsigned long long *)engine->GetClientSteamID(pEntity);
unsigned int accountId = steamId ? (*steamId & 0xFFFFFFFF) : 0;
g_Logger.LogMessage("\"%s<%d><STEAM_1:%d:%d><>\" has bad networkid (id \"%s\") (ip \"%s\")",
new_name, pPlayer->GetUserId(), accountId & 1, accountId >> 1, networkid_force, pPlayer->GetIPAddress());
pPlayer->Kick("NetworkID spoofing detected.");
RETURN_META(MRES_IGNORED);
}
#endif
if (strcmp(old_name, new_name) != 0)
{
AdminId id = g_Admins.FindAdminByIdentity("name", new_name);
+1 -1
View File
@@ -56,7 +56,7 @@ union serial_t
uint32_t value;
struct
{
uint8_t index;
uint32_t index : 8;
uint32_t serial : 24;
} bits;
};
+83 -8
View File
@@ -789,6 +789,8 @@ CPluginManager::CPluginManager()
m_AllPluginsLoaded = false;
m_MyIdent = NULL;
m_LoadingLocked = false;
m_bBlockBadPlugins = true;
}
CPluginManager::~CPluginManager()
@@ -1005,11 +1007,14 @@ LoadRes CPluginManager::_LoadPlugin(CPlugin **_plugin, const char *path, bool de
pPlugin->m_pRuntime = g_pSourcePawn2->LoadPlugin(co, fullpath, &err);
if (pPlugin->m_pRuntime == NULL)
{
UTIL_Format(error,
maxlength,
"Unable to load plugin (error %d: %s)",
err,
g_pSourcePawn2->GetErrorString(err));
if (error)
{
UTIL_Format(error,
maxlength,
"Unable to load plugin (error %d: %s)",
err,
g_pSourcePawn2->GetErrorString(err));
}
pPlugin->m_status = Plugin_BadLoad;
}
else
@@ -1020,7 +1025,45 @@ LoadRes CPluginManager::_LoadPlugin(CPlugin **_plugin, const char *path, bool de
}
else
{
UTIL_Format(error, maxlength, "%s", pPlugin->m_errormsg);
if (error)
{
UTIL_Format(error, maxlength, "%s", pPlugin->m_errormsg);
}
}
}
}
if (pPlugin->GetStatus() == Plugin_Created)
{
unsigned char *pCodeHash = pPlugin->m_pRuntime->GetCodeHash();
char codeHashBuf[40];
UTIL_Format(codeHashBuf, 40, "plugin_");
for (int i = 0; i < 16; i++)
UTIL_Format(codeHashBuf + 7 + (i * 2), 3, "%02x", pCodeHash[i]);
const char *bulletinUrl = g_pGameConf->GetKeyValue(codeHashBuf);
if (bulletinUrl != NULL)
{
if (m_bBlockBadPlugins)
{
if (error)
{
if (bulletinUrl[0] != '\0')
{
UTIL_Format(error, maxlength, "Known malware detected and blocked. See %s for more info", bulletinUrl);
} else {
UTIL_Format(error, maxlength, "Possible malware or illegal plugin detected and blocked");
}
}
pPlugin->m_status = Plugin_BadLoad;
} else {
if (bulletinUrl[0] != '\0')
{
g_Logger.LogMessage("%s: Known malware detected. See %s for more info, blocking disabled in core.cfg", pPlugin->GetFilename(), bulletinUrl);
} else {
g_Logger.LogMessage("%s: Possible malware or illegal plugin detected, blocking disabled in core.cfg", pPlugin->GetFilename());
}
}
}
}
@@ -1123,7 +1166,7 @@ void CPluginManager::LoadAutoPlugin(const char *plugin)
if ((res=_LoadPlugin(&pl, plugin, false, PluginType_MapUpdated, error, sizeof(error))) == LoadRes_Failure)
{
g_Logger.LogError("[SM] Failed to load plugin \"%s\": %s", plugin, error);
g_Logger.LogError("[SM] Failed to load plugin \"%s\": %s.", plugin, error);
pl->SetErrorState(
pl->GetStatus() <= Plugin_Created ? Plugin_BadLoad : pl->GetStatus(),
"%s",
@@ -1504,7 +1547,9 @@ void CPluginManager::TryRefreshDependencies(CPlugin *pPlugin)
{
break;
}
if (native->status == SP_NATIVE_UNBOUND && !(native->flags & SP_NTVFLAG_OPTIONAL))
if (native->status == SP_NATIVE_UNBOUND
&& native->name[0] != '@'
&& !(native->flags & SP_NTVFLAG_OPTIONAL))
{
pPlugin->SetErrorState(Plugin_Error, "Native not found: %s", native->name);
return;
@@ -1881,6 +1926,27 @@ void CPluginManager::OnSourceModShutdown()
g_ShareSys.DestroyIdentity(m_MyIdent);
}
ConfigResult CPluginManager::OnSourceModConfigChanged(const char *key,
const char *value,
ConfigSource source,
char *error,
size_t maxlength)
{
if (strcmp(key, "BlockBadPlugins") == 0) {
if (strcasecmp(value, "yes") == 0)
{
m_bBlockBadPlugins = true;
} else if (strcasecmp(value, "no") == 0) {
m_bBlockBadPlugins = false;
} else {
UTIL_Format(error, maxlength, "Invalid value: must be \"yes\" or \"no\"");
return ConfigResult_Reject;
}
return ConfigResult_Accept;
}
return ConfigResult_Ignore;
}
void CPluginManager::OnHandleDestroy(HandleType_t type, void *object)
{
/* We don't care about the internal object, actually */
@@ -2261,6 +2327,15 @@ void CPluginManager::OnRootConsoleCommand(const char *cmdname, const CCommand &c
{
g_RootMenu.ConsolePrint(" Timestamp: %s", pl->m_DateTime);
}
unsigned char *pCodeHash = pl->m_pRuntime->GetCodeHash();
unsigned char *pDataHash = pl->m_pRuntime->GetDataHash();
char combinedHash[33];
for (int i = 0; i < 16; i++)
UTIL_Format(combinedHash + (i * 2), 3, "%02x", pCodeHash[i] ^ pDataHash[i]);
g_RootMenu.ConsolePrint(" Hash: %s", combinedHash);
}
else
{
+5
View File
@@ -57,6 +57,7 @@
#include "convar_sm.h"
#endif
#include "ITranslator.h"
#include "IGameConfigs.h"
#include "NativeOwner.h"
#include "ShareSys.h"
@@ -326,6 +327,7 @@ public: //IPluginManager
public: //SMGlobalClass
void OnSourceModAllInitialized();
void OnSourceModShutdown();
ConfigResult OnSourceModConfigChanged(const char *key, const char *value, ConfigSource source, char *error, size_t maxlength);
void OnSourceModMaxPlayersChanged(int newvalue);
public: //IHandleTypeDispatch
void OnHandleDestroy(HandleType_t type, void *object);
@@ -470,6 +472,9 @@ private:
List<FakeNative *> m_Natives;
bool m_LoadingLocked;
// Config
bool m_bBlockBadPlugins;
};
extern CPluginManager g_PluginSys;
+1 -1
View File
@@ -116,7 +116,7 @@ void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t l
}
ptr = reinterpret_cast<char *>(lib.baseAddress);
end = ptr + lib.memorySize;
end = ptr + lib.memorySize - 1;
while (ptr < end)
{
+1 -1
View File
@@ -62,7 +62,7 @@ IGameHelpers *gamehelpers;
static void AddCorePhraseFile(const char *filename)
{
g_pCorePhrases->AddPhraseFile("antiflood.phrases");
g_pCorePhrases->AddPhraseFile(filename);
}
static IGameConfig *GetCoreGameConfig()
+1 -1
View File
@@ -179,7 +179,7 @@ static cell_t GetProfilerTime(IPluginContext *pContext, const cell_t *params)
#else
int64_t start_us = int64_t(prof->start.tv_sec) * 1000000 + prof->start.tv_usec;
int64_t stop_us = int64_t(prof->end.tv_sec) * 1000000 + prof->end.tv_usec;
fTime = double((stop_us - start_us) / 1000) / 1000.0;
fTime = double(stop_us - start_us) / 1000000.0;
#endif
return sp_ftoc(fTime);
+2 -2
View File
@@ -94,7 +94,7 @@ void sort_random(cell_t *array, cell_t size)
for (int i = size-1; i > 0; i--)
{
int n = (rand() % i) + 1;
int n = rand() % (i + 1);
if (array[i] != array[n])
{
@@ -435,7 +435,7 @@ void sort_adt_random(CellArray *cArray)
for (int i = arraysize-1; i > 0; i--)
{
int n = (rand() % i) + 1;
int n = rand() % (i + 1);
cArray->swap(i, n);
}
+1 -1
View File
@@ -34,7 +34,7 @@
#include "BaseWorker.h"
#define DEFAULT_THINK_TIME_MS 50
#define DEFAULT_THINK_TIME_MS 20
class ThreadWorker : public BaseWorker, public IThread
{
+7
View File
@@ -43,6 +43,7 @@
#include "Logger.h"
#include "ExtensionSys.h"
#include <sm_trie_tpl.h>
#include <sh_memory.h>
#if defined PLATFORM_WINDOWS
#include <windows.h>
@@ -729,11 +730,17 @@ static cell_t StoreToAddress(IPluginContext *pContext, const cell_t *params)
switch(size)
{
case NumberType_Int8:
SourceHook::SetMemAccess(addr, sizeof(uint8_t), SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
*reinterpret_cast<uint8_t*>(addr) = data;
break;
case NumberType_Int16:
SourceHook::SetMemAccess(addr, sizeof(uint16_t), SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
*reinterpret_cast<uint16_t*>(addr) = data;
break;
case NumberType_Int32:
SourceHook::SetMemAccess(addr, sizeof(uint32_t), SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
*reinterpret_cast<uint32_t*>(addr) = data;
break;
default:
pContext->ThrowNativeError("Invalid number types %d", size);
}
+69 -86
View File
@@ -325,7 +325,7 @@ static cell_t GetEdictClassname(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Invalid edict (%d - %d)", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
const char *cls = pEdict->GetClassName();
const char *cls = g_HL2.GetEntityClassname(pEdict);
if (!cls || cls[0] == '\0')
{
@@ -620,9 +620,12 @@ static cell_t GetEntDataEnt2(IPluginContext *pContext, const cell_t *params)
}
CBaseHandle &hndl = *(CBaseHandle *)((uint8_t *)pEntity + offset);
CBaseEntity *pHandleEntity = g_HL2.ReferenceToEntity(hndl.GetEntryIndex());
int ref = g_HL2.IndexToReference(hndl.GetEntryIndex());
return g_HL2.ReferenceToBCompatRef(ref);
if (!pHandleEntity || hndl != reinterpret_cast<IHandleEntity *>(pHandleEntity)->GetRefEHandle())
return -1;
return g_HL2.EntityToBCompatRef(pHandleEntity);
}
/* THIS GUY IS DEPRECATED. */
@@ -812,9 +815,13 @@ static cell_t FindDataMapOffs(IPluginContext *pContext, const cell_t *params)
}
pContext->LocalToString(params[2], &offset);
if ((td=g_HL2.FindInDataMap(pMap, offset)) == NULL)
bool isNested = false;
if ((td=g_HL2.FindInDataMap(pMap, offset, &isNested)) == NULL)
{
return -1;
if (isNested)
return pContext->ThrowNativeError("Property \"%s\" is not safe to access for entity %d", offset, params[1]);
else
return -1;
}
if (params[0] == 4)
@@ -959,12 +966,22 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
{ \
return pContext->ThrowNativeError("Could not retrieve datamap"); \
} \
if ((td = g_HL2.FindInDataMap(pMap, prop)) == NULL) \
bool isNested = false; \
if ((td = g_HL2.FindInDataMap(pMap, prop, &isNested)) == NULL) \
{ \
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)", \
prop, \
params[1], \
class_name); \
const char *class_name = g_HL2.GetEntityClassname(pEntity); \
if (isNested) \
{ \
return pContext->ThrowNativeError("Property \"%s\" not safe to access (entity %d/%s)", \
prop, \
params[1], \
((class_name) ? class_name : "")); \
} else { \
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)", \
prop, \
params[1], \
((class_name) ? class_name : "")); \
} \
}
#define CHECK_SET_PROP_DATA_OFFSET() \
@@ -980,6 +997,7 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
#define FIND_PROP_SEND(type, type_name) \
sm_sendprop_info_t info;\
SendProp *pProp; \
IServerUnknown *pUnk = (IServerUnknown *)pEntity; \
IServerNetworkable *pNet = pUnk->GetNetworkable(); \
if (!pNet) \
@@ -988,16 +1006,18 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
} \
if (!g_HL2.FindSendPropInfo(pNet->GetServerClass()->GetName(), prop, &info)) \
{ \
const char *class_name = g_HL2.GetEntityClassname(pEntity); \
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)", \
prop, \
params[1], \
class_name); \
((class_name) ? class_name : "")); \
} \
\
offset = info.actual_offset; \
bit_count = info.prop->m_nBits; \
pProp = info.prop; \
bit_count = pProp->m_nBits; \
\
switch (info.prop->GetType()) \
switch (pProp->GetType()) \
{ \
case type: \
{ \
@@ -1011,7 +1031,6 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
} \
case DPT_DataTable: \
{ \
SendProp *pProp; \
FIND_PROP_SEND_IN_SENDTABLE(info, pProp, element, type, type_name); \
\
offset += pProp->GetOffset(); \
@@ -1022,13 +1041,13 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
{ \
return pContext->ThrowNativeError("SendProp %s type is not " type_name " (%d != %d)", \
prop, \
info.prop->GetType(), \
pProp->GetType(), \
type); \
} \
} \
#define FIND_PROP_SEND_IN_SENDTABLE(info, pProp, element, type, type_name) \
SendTable *pTable = info.prop->GetDataTable(); \
SendTable *pTable = pProp->GetDataTable(); \
if (!pTable) \
{ \
return pContext->ThrowNativeError("Error looking up DataTable for prop %s", \
@@ -1049,8 +1068,8 @@ static cell_t SetEntDataString(IPluginContext *pContext, const cell_t *params)
{ \
return pContext->ThrowNativeError("SendProp %s type is not " type_name " ([%d,%d] != %d)", \
prop, \
info.prop->GetType(), \
info.prop->m_nBits, \
pProp->GetType(), \
pProp->m_nBits, \
type); \
}
@@ -1082,7 +1101,6 @@ static cell_t GetEntPropArraySize(IPluginContext *pContext, const cell_t *params
{
CBaseEntity *pEntity;
char *prop;
const char *class_name;
edict_t *pEdict;
if (!IndexToAThings(params[1], &pEntity, &pEdict))
@@ -1090,11 +1108,6 @@ static cell_t GetEntPropArraySize(IPluginContext *pContext, const cell_t *params
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1119,10 +1132,11 @@ static cell_t GetEntPropArraySize(IPluginContext *pContext, const cell_t *params
}
if (!g_HL2.FindSendPropInfo(pNet->GetServerClass()->GetName(), prop, &info))
{
const char *class_name = g_HL2.GetEntityClassname(pEntity);
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)",
prop,
params[1],
class_name);
((class_name) ? class_name : ""));
}
if (info.prop->GetType() != DPT_DataTable)
@@ -1152,7 +1166,6 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
CBaseEntity *pEntity;
char *prop;
int offset;
const char *class_name;
edict_t *pEdict;
int bit_count;
bool is_unsigned = false;
@@ -1168,12 +1181,6 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
/* TODO: Find a way to lookup classname without having an edict - Is this a guaranteed prop? */
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1198,7 +1205,15 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
case Prop_Send:
{
FIND_PROP_SEND(DPT_Int, "integer");
is_unsigned = ((info.prop->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
}
#endif
break;
}
default:
@@ -1251,7 +1266,6 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
CBaseEntity *pEntity;
char *prop;
int offset;
const char *class_name;
edict_t *pEdict;
int bit_count;
@@ -1266,11 +1280,6 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1295,6 +1304,14 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
case Prop_Send:
{
FIND_PROP_SEND(DPT_Int, "integer");
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
}
#endif
break;
}
default:
@@ -1339,7 +1356,6 @@ static cell_t GetEntPropFloat(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1353,11 +1369,6 @@ static cell_t GetEntPropFloat(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1404,7 +1415,6 @@ static cell_t SetEntPropFloat(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1418,11 +1428,6 @@ static cell_t SetEntPropFloat(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1474,7 +1479,6 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1488,11 +1492,6 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1527,9 +1526,12 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
}
CBaseHandle &hndl = *(CBaseHandle *)((uint8_t *)pEntity + offset);
CBaseEntity *pHandleEntity = g_HL2.ReferenceToEntity(hndl.GetEntryIndex());
int ref = g_HL2.IndexToReference(hndl.GetEntryIndex());
return g_HL2.ReferenceToBCompatRef(ref);
if (!pHandleEntity || hndl != reinterpret_cast<IHandleEntity *>(pHandleEntity)->GetRefEHandle())
return -1;
return g_HL2.EntityToBCompatRef(pHandleEntity);
}
static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
@@ -1538,7 +1540,6 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1552,11 +1553,6 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1623,7 +1619,6 @@ static cell_t GetEntPropVector(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1637,11 +1632,6 @@ static cell_t GetEntPropVector(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1695,7 +1685,6 @@ static cell_t SetEntPropVector(IPluginContext *pContext, const cell_t *params)
char *prop;
int offset;
int bit_count;
const char *class_name;
edict_t *pEdict;
int element = 0;
@@ -1709,11 +1698,6 @@ static cell_t SetEntPropVector(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
switch (params[2])
@@ -1771,7 +1755,6 @@ static cell_t GetEntPropString(IPluginContext *pContext, const cell_t *params)
CBaseEntity *pEntity;
char *prop;
int offset;
const char *class_name;
edict_t *pEdict;
bool bIsStringIndex;
@@ -1786,11 +1769,6 @@ static cell_t GetEntPropString(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Entity %d (%d) is invalid", g_HL2.ReferenceToIndex(params[1]), params[1]);
}
if (!pEdict || (class_name = pEdict->GetClassName()) == NULL)
{
class_name = "";
}
pContext->LocalToString(params[3], &prop);
bIsStringIndex = false;
@@ -1849,10 +1827,11 @@ static cell_t GetEntPropString(IPluginContext *pContext, const cell_t *params)
}
if (!g_HL2.FindSendPropInfo(pNet->GetServerClass()->GetName(), prop, &info))
{
const char *class_name = g_HL2.GetEntityClassname(pEntity);
return pContext->ThrowNativeError("Property \"%s\" not found (entity %d/%s)",
prop,
params[1],
class_name);
((class_name) ? class_name : ""));
}
offset = info.actual_offset;
@@ -1923,9 +1902,13 @@ static cell_t SetEntPropString(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Unable to retrieve GetDataDescMap offset");
}
pContext->LocalToString(params[3], &prop);
if ((td=g_HL2.FindInDataMap(pMap, prop)) == NULL)
bool isNested = false;
if ((td=g_HL2.FindInDataMap(pMap, prop, &isNested)) == NULL)
{
return pContext->ThrowNativeError("Property \"%s\" not found for entity %d", prop, params[1]);
if (isNested)
return pContext->ThrowNativeError("Property \"%s\" is not safe to access for entity %d", prop, params[1]);
else
return pContext->ThrowNativeError("Property \"%s\" not found for entity %d", prop, params[1]);
}
if (td->fieldType != FIELD_CHARACTER)
{
+12 -1
View File
@@ -87,6 +87,11 @@ static cell_t GetGameTime(IPluginContext *pContext, const cell_t *params)
return sp_ftoc(gpGlobals->curtime);
}
static cell_t GetGameTickCount(IPluginContext *pContext, const cell_t *params)
{
return gpGlobals->tickcount;
}
static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params)
{
if (!g_SourceMod.IsMapRunning())
@@ -446,6 +451,10 @@ static cell_t smn_IsPlayerAlive(IPluginContext *pContext, const cell_t *params)
}
}
#ifndef SOURCE_ENGINE_CSS
#define SOURCE_ENGINE_CSS 13
#endif
static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
{
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
@@ -467,7 +476,8 @@ static cell_t GuessSDKVersion(IPluginContext *pContext, const cell_t *params)
case SOURCE_ENGINE_BLOODYGOODTIME:
return 32;
case SOURCE_ENGINE_EYE:
return 34;
return 33;
case SOURCE_ENGINE_CSS:
case SOURCE_ENGINE_ORANGEBOXVALVE:
return 35;
case SOURCE_ENGINE_LEFT4DEAD:
@@ -520,6 +530,7 @@ REGISTER_NATIVES(halflifeNatives)
{"GetGameDescription", GetGameDescription},
{"GetGameFolderName", GetGameFolderName},
{"GetGameTime", GetGameTime},
{"GetGameTickCount", GetGameTickCount},
{"GetRandomFloat", GetRandomFloat},
{"GetRandomInt", GetRandomInt},
{"IsDedicatedServer", IsDedicatedServer},
+1 -1
View File
@@ -396,7 +396,7 @@ void CookieManager::OnPluginDestroyed(IPlugin *plugin)
{
ItemDrawInfo draw;
const char *info = clientMenu->GetItemInfo(i, &draw);
AutoMenuData *data = (AutoMenuData *)strtol(info, NULL, 16);
AutoMenuData *data = (AutoMenuData *)strtoul(info, NULL, 16);
if (data->handler->forward != NULL)
{
+28 -2
View File
@@ -105,6 +105,7 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
sharesys->AddNatives(myself, g_ClientPrefNatives);
sharesys->RegisterLibrary(myself, "clientprefs");
identity = sharesys->CreateIdentity(sharesys->CreateIdentType("ClientPrefs"), this);
g_CookieManager.cookieDataLoadedForward = forwards->CreateForward("OnClientCookiesCached", ET_Ignore, 1, NULL, Param_Cell);
g_CookieType = handlesys->CreateType("Cookie",
@@ -124,7 +125,7 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
NULL);
IMenuStyle *style = menus->GetDefaultStyle();
g_CookieManager.clientMenu = style->CreateMenu(&g_Handler, NULL);
g_CookieManager.clientMenu = style->CreateMenu(&g_Handler, identity);
g_CookieManager.clientMenu->SetDefaultTitle("Client Settings:");
plsys->AddPluginsListener(&g_CookieManager);
@@ -191,10 +192,17 @@ void ClientPrefs::SDK_OnUnload()
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);
g_CookieManager.clientMenu->Destroy();
HandleSecurity sec = HandleSecurity(identity, identity);
HandleError err = handlesys->FreeHandle(g_CookieManager.clientMenu->GetHandle(), &sec);
if (HandleError_None != err)
{
g_pSM->LogError(myself, "Error %d when attempting to free client menu handle", err);
}
phrases->Destroy();
sharesys->DestroyIdentity( identity );
plsys->RemovePluginsListener(&g_CookieManager);
playerhelpers->RemoveClientListener(&g_CookieManager);
@@ -202,6 +210,19 @@ void ClientPrefs::SDK_OnUnload()
cookieMutex->DestroyThis();
}
void ClientPrefs::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
{
if (Database == NULL && !databaseLoading)
{
g_pSM->LogMessage(myself, "Attempting to reconnect to database...");
databaseLoading = true;
TQueryOp *op = new TQueryOp(Query_Connect, 0);
dbi->AddToThreadQueue(op, PrioQueue_High);
}
}
void ClientPrefs::DatabaseConnect()
{
char error[256];
@@ -457,6 +478,11 @@ bool Translate(char *buffer,
return true;
}
IdentityToken_t *ClientPrefs::GetIdentity() const
{
return identity;
}
const char *ClientPrefs::GetExtensionVerString()
{
return SM_FULL_VERSION;
+5
View File
@@ -87,6 +87,8 @@ public:
const char *GetExtensionVerString();
const char *GetExtensionDateString();
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
void DatabaseConnect();
bool AddQueryToQueue(TQueryOp *query);
@@ -138,6 +140,8 @@ public:
*/
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlength);
#endif
public:
IdentityToken_t *GetIdentity() const;
public:
IDBDriver *Driver;
IDatabase *Database;
@@ -150,6 +154,7 @@ public:
private:
SourceHook::List<TQueryOp *> cachedQueries;
IMutex *queryMutex;
IdentityToken_t *identity;
};
class CookieTypeHandler : public IHandleTypeDispatch
+10 -5
View File
@@ -40,7 +40,7 @@ void ClientMenuHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int i
const char *info = menu->GetItemInfo(item, &draw);
AutoMenuData *data = (AutoMenuData *)strtol(info, NULL, 16);
AutoMenuData *data = (AutoMenuData *)strtoul(info, NULL, 16);
if (data->handler->forward != NULL)
{
@@ -57,7 +57,7 @@ void ClientMenuHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int i
return;
}
IBaseMenu *submenu = menus->GetDefaultStyle()->CreateMenu(&g_AutoHandler, NULL);
IBaseMenu *submenu = menus->GetDefaultStyle()->CreateMenu(&g_AutoHandler, g_ClientPrefs.GetIdentity());
char message[256];
@@ -94,7 +94,7 @@ unsigned int ClientMenuHandler::OnMenuDisplayItem(IBaseMenu *menu,
const char *info = menu->GetItemInfo(item, &draw);
AutoMenuData *data = (AutoMenuData *)strtol(info, NULL, 16);
AutoMenuData *data = (AutoMenuData *)strtoul(info, NULL, 16);
if (data->handler->forward != NULL)
{
@@ -122,7 +122,7 @@ void AutoMenuHandler::OnMenuSelect(SourceMod::IBaseMenu *menu, int client, unsig
const char *info = menu->GetItemInfo(item, &draw);
AutoMenuData *data = (AutoMenuData *)strtol(info, NULL, 16);
AutoMenuData *data = (AutoMenuData *)strtoul(info, NULL, 16);
switch (data->type)
{
@@ -175,5 +175,10 @@ void AutoMenuHandler::OnMenuSelect(SourceMod::IBaseMenu *menu, int client, unsig
void AutoMenuHandler::OnMenuEnd(IBaseMenu *menu, MenuEndReason reason)
{
menu->Destroy(true);
HandleSecurity sec = HandleSecurity(g_ClientPrefs.GetIdentity(), g_ClientPrefs.GetIdentity());
HandleError err = handlesys->FreeHandle(menu->GetHandle(), &sec);
if (HandleError_None != err)
{
g_pSM->LogError(myself, "Error %d when attempting to free automenu handle", err);
}
}
+2
View File
@@ -47,4 +47,6 @@ void RegNatives::UnregisterAll()
{
(*iter)->Destroy();
}
m_List.clear();
}
+6 -6
View File
@@ -206,18 +206,18 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
}
//Psychonic is awesome for this
sm_sendprop_info_t *spi = new sm_sendprop_info_t;
sm_sendprop_info_t spi;
IServerUnknown *pUnk = (IServerUnknown *)pWeapon;
IServerNetworkable *pNet = pUnk->GetNetworkable();
if (!UTIL_FindDataTable(pNet->GetServerClass()->m_pTable, "DT_WeaponCSBase", spi, 0))
if (!UTIL_FindDataTable(pNet->GetServerClass()->m_pTable, "DT_WeaponCSBase", &spi, 0))
return pContext->ThrowNativeError("Entity index %d is not a weapon", params[2]);
if (!gamehelpers->FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity", spi))
if (!gamehelpers->FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity", &spi))
return pContext->ThrowNativeError("Invalid entity index %d for weapon", params[2]);
CBaseHandle &hndl = *(CBaseHandle *)((uint8_t *)pWeapon + spi->actual_offset);
if (params[1] != hndl.GetEntryIndex())
CBaseHandle &hndl = *(CBaseHandle *)((uint8_t *)pWeapon + spi.actual_offset);
if (params[1] != hndl.GetEntryIndex() || hndl != ((IServerEntity *)pEntity)->GetRefEHandle())
return pContext->ThrowNativeError("Weapon %d is not owned by client %d", params[2], params[1]);
if (params[4] == 1 && g_pCSWeaponDropDetoured)
@@ -312,7 +312,7 @@ static cell_t CS_GetTranslatedWeaponAlias(IPluginContext *pContext, const cell_t
pContext->LocalToString(params[2], &dest);
pContext->LocalToString(params[1], &weapon);
char *ret = new char[128];
char *ret = NULL;
unsigned char vstk[sizeof(char *)];
unsigned char *vptr = vstk;
-1
View File
@@ -20,7 +20,6 @@ def BuildCURL():
env = os.environ.copy()
env['CFLAGS'] = '-m32'
if AMBuild.target['platform'] == 'darwin':
env['CFLAGS'] += ' -isysroot /Developer/SDKs/MacOSX10.5.sdk'
env['LDFLAGS'] = '-mmacosx-version-min=10.5'
else:
env['CFLAGS'] += ' -D_GNU_SOURCE'
+50 -12
View File
@@ -89,15 +89,17 @@ enum PropFieldType
#define FIND_PROP_SEND(type, type_name) \
sm_sendprop_info_t info;\
SendProp *pProp; \
if (!gamehelpers->FindSendPropInfo(g_szGameRulesProxy, prop, &info)) \
{ \
return pContext->ThrowNativeError("Property \"%s\" not found on the gamerules proxy", prop); \
} \
\
offset = info.actual_offset; \
bit_count = info.prop->m_nBits; \
pProp = info.prop; \
bit_count = pProp->m_nBits; \
\
switch (info.prop->GetType()) \
switch (pProp->GetType()) \
{ \
case type: \
{ \
@@ -111,7 +113,6 @@ enum PropFieldType
} \
case DPT_DataTable: \
{ \
SendProp *pProp; \
FIND_PROP_SEND_IN_SENDTABLE(info, pProp, element, type, type_name); \
\
offset += pProp->GetOffset(); \
@@ -122,13 +123,13 @@ enum PropFieldType
{ \
return pContext->ThrowNativeError("SendProp %s type is not " type_name " (%d != %d)", \
prop, \
info.prop->GetType(), \
pProp->GetType(), \
type); \
} \
} \
#define FIND_PROP_SEND_IN_SENDTABLE(info, pProp, element, type, type_name) \
SendTable *pTable = info.prop->GetDataTable(); \
SendTable *pTable = pProp->GetDataTable(); \
if (!pTable) \
{ \
return pContext->ThrowNativeError("Error looking up DataTable for prop %s", \
@@ -149,8 +150,8 @@ enum PropFieldType
{ \
return pContext->ThrowNativeError("SendProp %s type is not " type_name " ([%d,%d] != %d)", \
prop, \
info.prop->GetType(), \
info.prop->m_nBits, \
pProp->GetType(), \
pProp->m_nBits, \
type); \
}
@@ -160,6 +161,7 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
int element = params[3];
int offset;
int bit_count;
bool is_unsigned;
if (!g_pGameRules || !g_szGameRulesProxy || !strcmp(g_szGameRulesProxy, ""))
return pContext->ThrowNativeError("Gamerules lookup failed.");
@@ -169,6 +171,15 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
int elementCount = 1;
FIND_PROP_SEND(DPT_Int, "integer");
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
}
#endif
if (bit_count < 1)
{
bit_count = params[2] * 8;
@@ -182,11 +193,25 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
}
else if (bit_count >= 9)
{
return *(int16_t *)((intptr_t)pGameRules + offset);
if (is_unsigned)
{
return *(uint16_t *)((intptr_t)pGameRules + offset);
}
else
{
return *(int16_t *)((intptr_t)pGameRules + offset);
}
}
else if (bit_count >= 2)
{
return *(int8_t *)((intptr_t)pGameRules + offset);
if (is_unsigned)
{
return *(uint8_t *)((intptr_t)pGameRules + offset);
}
else
{
return *(int8_t *)((intptr_t)pGameRules + offset);
}
}
else
{
@@ -218,6 +243,14 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
FIND_PROP_SEND(DPT_Int, "integer");
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (pProp->GetFlags() & SPROP_VARINT)
{
bit_count = sizeof(int) * 8;
}
#endif
void *pGameRules = *g_pGameRules;
if (bit_count < 1)
@@ -339,9 +372,14 @@ static cell_t GameRules_GetPropEnt(IPluginContext *pContext, const cell_t *param
void *pGameRules = *g_pGameRules;
CBaseHandle &hndl = *(CBaseHandle *)((intptr_t)pGameRules + offset);
CBaseEntity *pEntity = gamehelpers->ReferenceToEntity(hndl.GetEntryIndex());
int ref = gamehelpers->IndexToReference(hndl.GetEntryIndex());
return gamehelpers->ReferenceToBCompatRef(ref);
if (!pEntity || ((IServerEntity *)pEntity)->GetRefEHandle() != hndl)
{
return -1;
}
return gamehelpers->EntityToBCompatRef(pEntity);
}
static cell_t GameRules_SetPropEnt(IPluginContext *pContext, const cell_t *params)
@@ -470,7 +508,7 @@ static cell_t GameRules_SetPropVector(IPluginContext *pContext, const cell_t *pa
if (sendChange)
{
v = (Vector *)((intptr_t)g_pGameRules + offset);
v = (Vector *)((intptr_t)pProxy + offset);
v->x = sp_ctof(vec[0]);
v->y = sp_ctof(vec[1]);
v->z = sp_ctof(vec[2]);
+1 -1
View File
@@ -129,7 +129,7 @@ static cell_t PrepSDKCall_SetSignature(IPluginContext *pContext, const cell_t *p
{
return 0;
}
#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#if (SOURCE_ENGINE == SE_ORANGEBOXVALVE) || (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
s_call_addr = memutils->ResolveSymbol(handle, &sig[1]);
#else
s_call_addr = dlsym(handle, &sig[1]);
+12 -2
View File
@@ -125,6 +125,7 @@ void GetIServer()
int offset;
void *vfunc = NULL;
#if SOURCE_ENGINE != SE_ORANGEBOXVALVE
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
/* Get the CreateFakeClient function pointer */
if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClient)))
@@ -142,7 +143,8 @@ void GetIServer()
void **vtable = *reinterpret_cast<void ***>(enginePatch->GetThisPtr() + info.thisptroffs + info.vtbloffs);
vfunc = vtable[info.vtblindex];
}
#endif
#endif // defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
#endif // SOURCE_ENGINE != SE_ORANGEBOXVALVE
/* Get signature string for IVEngineServer::CreateFakeClient() */
sigstr = g_pGameConf->GetKeyValue("CreateFakeClient_Windows");
@@ -154,12 +156,20 @@ void GetIServer()
/* Convert signature string to signature bytes */
siglen = UTIL_StringToSignature(sigstr, sig, sizeof(sig));
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
vfunc = memutils->FindPattern(engine, sig, siglen);
if (!vfunc)
{
return;
}
#else
/* Check if we're on the expected function */
if (!UTIL_VerifySignature(vfunc, sig, siglen))
{
return;
}
#endif
/* Get the offset into CreateFakeClient */
if (!g_pGameConf->GetOffset("sv", &offset))
+5
View File
@@ -528,7 +528,12 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params)
CellRecipientFilter rf;
rf.SetToReliable(true);
rf.Initialize(player_list, total_players);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, 0, &pos);
#else
engsound->EmitSound(rf, params[1], CHAN_AUTO, sound_name, VOL_NORM, ATTN_NORM, 0, PITCH_NORM, &pos);
#endif
}
}
+128
View File
@@ -33,8 +33,13 @@
#include <IForwardSys.h>
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
SH_DECL_HOOK15_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
#else
SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 0, IRecipientFilter &, int, int, const char *, float, float, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
SH_DECL_HOOK14_void(IEngineSound, EmitSound, SH_NOATTRIB, 1, IRecipientFilter &, int, int, const char *, float, soundlevel_t, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
#endif
bool g_InSoundHook = false;
@@ -252,10 +257,17 @@ void SoundHooks::OnEmitAmbientSound(int entindex, const Vector &pos, const char
}
}
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity)
#else
void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
float flVolume, soundlevel_t iSoundlevel, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity)
#endif
{
SoundHookIter iter;
IPluginFunction *pFunc;
@@ -293,6 +305,15 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
{
CellRecipientFilter crf;
crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
RETURN_META_NEWPARAMS(
MRES_IGNORED,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, soundlevel_t,
int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound),
(crf, iEntIndex, iChannel, buffer, flVolume, iSoundlevel, iFlags, iPitch, iSpecialDSP, pOrigin,
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
);
#else
RETURN_META_NEWPARAMS(
MRES_IGNORED,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, soundlevel_t,
@@ -300,15 +321,23 @@ void SoundHooks::OnEmitSound(IRecipientFilter &filter, int iEntIndex, int iChann
(crf, iEntIndex, iChannel, buffer, flVolume, iSoundlevel, iFlags, iPitch, pOrigin,
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
);
#endif
}
}
}
}
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
float flVolume, float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity)
#else
void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChannel, const char *pSample,
float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity)
#endif
{
SoundHookIter iter;
IPluginFunction *pFunc;
@@ -347,6 +376,15 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
{
CellRecipientFilter crf;
crf.Initialize(players, size);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
RETURN_META_NEWPARAMS(
MRES_IGNORED,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, float,
int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>(&IEngineSound::EmitSound),
(crf, iEntIndex, iChannel, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)),
iFlags, iPitch, iSpecialDSP, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
);
#else
RETURN_META_NEWPARAMS(
MRES_IGNORED,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float, float,
@@ -354,6 +392,7 @@ void SoundHooks::OnEmitSound2(IRecipientFilter &filter, int iEntIndex, int iChan
(crf, iEntIndex, iChannel, buffer, flVolume, SNDLVL_TO_ATTN(static_cast<soundlevel_t>(sndlevel)),
iFlags, iPitch, pOrigin, pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity)
);
#endif
}
}
}
@@ -547,6 +586,48 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
player[0] = cl_array[i];
crf.Reset();
crf.Initialize(player, 1);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float,
soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
(&IEngineSound::EmitSound))
(crf,
player[0],
channel,
sample,
vol,
(soundlevel_t)level,
flags,
pitch,
0,
pOrigin,
pDir,
pOrigVec,
updatePos,
soundtime,
speakerentity);
}
else
{
engsound->EmitSound(crf,
player[0],
channel,
sample,
vol,
(soundlevel_t)level,
flags,
pitch,
0,
pOrigin,
pDir,
pOrigVec,
updatePos,
soundtime,
speakerentity);
}
#else
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
@@ -585,8 +666,51 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
soundtime,
speakerentity);
}
#endif
}
} else {
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
static_cast<void (IEngineSound::*)(IRecipientFilter &, int, int, const char*, float,
soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int)>
(&IEngineSound::EmitSound))
(crf,
entity,
channel,
sample,
vol,
(soundlevel_t)level,
flags,
pitch,
0,
pOrigin,
pDir,
pOrigVec,
updatePos,
soundtime,
speakerentity);
}
else
{
engsound->EmitSound(crf,
entity,
channel,
sample,
vol,
(soundlevel_t)level,
flags,
pitch,
0,
pOrigin,
pDir,
pOrigVec,
updatePos,
soundtime,
speakerentity);
}
#else
if (g_InSoundHook)
{
SH_CALL(enginesoundPatch,
@@ -625,6 +749,7 @@ static cell_t EmitSound(IPluginContext *pContext, const cell_t *params)
soundtime,
speakerentity);
}
#endif
}
return 1;
@@ -714,6 +839,9 @@ static cell_t EmitSentence(IPluginContext *pContext, const cell_t *params)
(soundlevel_t)level,
flags,
pitch,
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
0,
#endif
pOrigin,
pDir,
pOrigVec,
+11
View File
@@ -52,6 +52,16 @@ public:
bool RemoveHook(int type, IPluginFunction *pFunc);
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol,
soundlevel_t soundlevel, int fFlags, int pitch, float delay);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
soundlevel_t iSoundlevel, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity);
void OnEmitSound2(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
float flAttenuation, int iFlags, int iPitch, int iSpecialDSP, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity);
#else
void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
soundlevel_t iSoundlevel, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
@@ -60,6 +70,7 @@ public:
float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin,
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
float soundtime, int speakerentity);
#endif
private:
size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
void _IncRefCounter(int type);
+9 -9
View File
@@ -112,7 +112,7 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
playerhelpers->AddClientListener(this);
g_critForward = forwards->CreateForward("TF2_CalcIsAttackCritical", ET_Hook, 4, NULL, Param_Cell, Param_Cell, Param_String, Param_CellByRef);
g_getHolidayForward = forwards->CreateForward("TF2_OnGetHoliday", ET_Event, 1, NULL, Param_CellByRef);
g_isHolidayForward = forwards->CreateForward("TF2_OnIsHolidayActive", ET_Event, 2, NULL, Param_Cell, Param_CellByRef);
g_addCondForward = forwards->CreateForward("TF2_OnConditionAdded", ET_Ignore, 2, NULL, Param_Cell, Param_Cell);
g_removeCondForward = forwards->CreateForward("TF2_OnConditionRemoved", ET_Ignore, 2, NULL, Param_Cell, Param_Cell);
g_waitingPlayersStartForward = forwards->CreateForward("TF2_OnWaitingForPlayersStart", ET_Ignore, 0, NULL);
@@ -121,7 +121,7 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
g_pCVar = icvar;
m_CritDetoursEnabled = false;
m_GetHolidayDetourEnabled = false;
m_IsHolidayDetourEnabled = false;
m_CondChecksEnabled = false;
m_RulesDetoursEnabled = false;
@@ -168,7 +168,7 @@ void TF2Tools::SDK_OnUnload()
plsys->RemovePluginsListener(this);
forwards->ReleaseForward(g_critForward);
forwards->ReleaseForward(g_getHolidayForward);
forwards->ReleaseForward(g_isHolidayForward);
forwards->ReleaseForward(g_addCondForward);
forwards->ReleaseForward(g_removeCondForward);
forwards->ReleaseForward(g_waitingPlayersStartForward);
@@ -320,9 +320,9 @@ void TF2Tools::OnPluginLoaded(IPlugin *plugin)
m_CritDetoursEnabled = InitialiseCritDetours();
}
if (!m_GetHolidayDetourEnabled && g_getHolidayForward->GetFunctionCount())
if (!m_IsHolidayDetourEnabled && g_isHolidayForward->GetFunctionCount())
{
m_GetHolidayDetourEnabled = InitialiseGetHolidayDetour();
m_IsHolidayDetourEnabled = InitialiseIsHolidayDetour();
}
if (!m_CondChecksEnabled
@@ -347,10 +347,10 @@ void TF2Tools::OnPluginUnloaded(IPlugin *plugin)
RemoveCritDetours();
m_CritDetoursEnabled = false;
}
if (m_GetHolidayDetourEnabled && !g_getHolidayForward->GetFunctionCount())
if (m_IsHolidayDetourEnabled && !g_isHolidayForward->GetFunctionCount())
{
RemoveGetHolidayDetour();
m_GetHolidayDetourEnabled = false;
RemoveIsHolidayDetour();
m_IsHolidayDetourEnabled = false;
}
if (m_CondChecksEnabled)
{
@@ -451,6 +451,6 @@ TFClassType ClassnameToType(const char *classname)
/**
* A picture of a blue crab given to me as a gift and stored here for safe keeping
*
* http://www.democracycellproject.net/blog/archives/Clown%20car.jpg
* http://sourcemod.net/Clown%20car.jpg
*/
+1 -1
View File
@@ -118,7 +118,7 @@ public:
#endif
private:
bool m_CritDetoursEnabled;
bool m_GetHolidayDetourEnabled;
bool m_IsHolidayDetourEnabled;
bool m_CondChecksEnabled;
bool m_RulesDetoursEnabled;
};
+18 -17
View File
@@ -31,48 +31,49 @@
#include "holiday.h"
CDetour *getHolidayDetour = NULL;
CDetour *isHolidayDetour = NULL;
IForward *g_getHolidayForward = NULL;
IForward *g_isHolidayForward = NULL;
DETOUR_DECL_STATIC0(GetHoliday, int)
DETOUR_DECL_STATIC1(IsHolidayActive, bool, int, holiday)
{
int actualres = DETOUR_STATIC_CALL(GetHoliday)();
if (!g_getHolidayForward)
bool actualres = DETOUR_STATIC_CALL(IsHolidayActive)(holiday);
if (!g_isHolidayForward)
{
g_pSM->LogMessage(myself, "Invalid Forward");
return actualres;
}
cell_t result = 0;
int newres = actualres;
cell_t newres = actualres ? 1 : 0;
g_getHolidayForward->PushCellByRef(&newres);
g_getHolidayForward->Execute(&result);
g_isHolidayForward->PushCell(holiday);
g_isHolidayForward->PushCellByRef(&newres);
g_isHolidayForward->Execute(&result);
if (result == Pl_Changed)
if (result > Pl_Continue)
{
return newres;
return (newres == 0) ? false : true;
}
return actualres;
}
bool InitialiseGetHolidayDetour()
bool InitialiseIsHolidayDetour()
{
getHolidayDetour = DETOUR_CREATE_STATIC(GetHoliday, "GetHoliday");
isHolidayDetour = DETOUR_CREATE_STATIC(IsHolidayActive, "IsHolidayActive");
if (getHolidayDetour != NULL)
if (isHolidayDetour != NULL)
{
getHolidayDetour->EnableDetour();
isHolidayDetour->EnableDetour();
return true;
}
g_pSM->LogError(myself, "GetHoliday detour failed");
g_pSM->LogError(myself, "IsHolidayActive detour failed");
return false;
}
void RemoveGetHolidayDetour()
void RemoveIsHolidayDetour()
{
getHolidayDetour->Destroy();
isHolidayDetour->Destroy();
}
+3 -3
View File
@@ -37,9 +37,9 @@
#include <jit/x86/x86_macros.h>
#include "CDetour/detours.h"
bool InitialiseGetHolidayDetour();
void RemoveGetHolidayDetour();
bool InitialiseIsHolidayDetour();
void RemoveIsHolidayDetour();
extern IForward *g_getHolidayForward;
extern IForward *g_isHolidayForward;
#endif //_INCLUDE_SOURCEMOD_HOLIDAY_H_
+23 -6
View File
@@ -39,11 +39,11 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
// CTFPlayerShared::MakeBleed(CTFPlayer*, CTFWeaponBase*, float)
// CTFPlayerShared::MakeBleed(CTFPlayer*, CTFWeaponBase*, float, int=4)
if(!pWrapper)
{
REGISTER_NATIVE_ADDR("MakeBleed",
PassInfo pass[3]; \
PassInfo pass[4]; \
pass[0].flags = PASSFLAG_BYVAL; \
pass[0].size = sizeof(CBaseEntity *); \
pass[0].type = PassType_Basic; \
@@ -53,7 +53,10 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
pass[2].flags = PASSFLAG_BYVAL; \
pass[2].size = sizeof(float); \
pass[2].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 3))
pass[3].flags = PASSFLAG_BYVAL; \
pass[3].size = sizeof(int); \
pass[3].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 4))
}
CBaseEntity *pEntity;
@@ -80,6 +83,8 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
*(CBaseEntity **)vptr = NULL;
vptr += sizeof(CBaseEntity *);
*(float *)vptr = sp_ctof(params[3]);
vptr += sizeof(float);
*(int *)vptr = 4;
pWrapper->Execute(vstk, NULL);
@@ -449,12 +454,16 @@ cell_t TF2_Regenerate(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
//CTFPlayer::Regenerate()
//CTFPlayer::Regenerate( bool=true )
if (!pWrapper)
{
REGISTER_NATIVE_ADDR("Regenerate",
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, NULL, 0));
PassInfo pass[1]; \
pass[0].flags = PASSFLAG_BYVAL; \
pass[0].size = sizeof(bool); \
pass[0].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 1))
}
CBaseEntity *pEntity;
@@ -462,7 +471,15 @@ cell_t TF2_Regenerate(IPluginContext *pContext, const cell_t *params)
{
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
}
pWrapper->Execute(&pEntity, NULL);
unsigned char vstk[sizeof(void *) + sizeof(bool)];
unsigned char *vptr = vstk;
*(void **)vptr = (void *)pEntity;
vptr += sizeof(void *);
*(bool *)vptr = true;
pWrapper->Execute(vstk, NULL);
return 1;
}
+34
View File
@@ -0,0 +1,34 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
"#default"
{
"Keys"
{
"plugin_541de8d7f577398bad43b75f4ac80b84" "http://forums.alliedmods.net/showpost.php?p=1767388&postcount=7" /* LightRP (Sphex) - Version 1.2.5 */
"plugin_e10aab3464312dc0e484bda26b490b3f" "http://forums.alliedmods.net/showpost.php?p=1767388&postcount=7" /* LightRP (Sphex) - Version 1.2.7 */
"plugin_a7973ddc4e72aafd0312432568a1806b" "http://forums.alliedmods.net/showpost.php?p=1767388&postcount=7" /* LightRP (Sphex) - Version 1.2.8 */
"plugin_39ddd719f74b62e27e8e480871b9d3b6" "http://forums.alliedmods.net/showpost.php?p=1803875&postcount=1" /* Malicious plugin being uploaded to CS:GO servers */
"plugin_c82200dc10b39ad196fc805e4d4da807" "" /* [L4D] Survivor Upgrades Reloaded (Marcus101RR, Whosat & Jerrith) - Version 1.5.0 */
"plugin_4225ffe2fd15d10a730466909a64bd01" "" /* [L4D2] Survivor Upgrades Reloaded (Marcus101RR, Whosat & Jerrith) - Version 1.5.0 */
"plugin_862ae600f417a26e6b6d3ab5d702c5e7" "" /* [L4D] Survivor Upgrades Reloaded (Marcus101RR, Whosat & Jerrith) - Version 1.5.0 - Hotfix */
"plugin_cdb8b711ff0166791e761d6324b30b4c" "" /* [L4D2] Survivor Upgrades Reloaded (Marcus101RR, Whosat & Jerrith) - Version 1.5.0 - Hotfix */
"plugin_fd89ca333467cffe722072a52e7bc752" "" /* L4D SuperVersus (DDRKhat) - Version 1.6.5 - Marcus101RR version */
"plugin_33c1c93eaff16f385ef245cb4af80f1a" "" /* Survivor Health & Armor System (Marcus101RR) - Version 1.4.8 */
"plugin_895eb68cb2dd5235e29b93452e14e52b" "" /* [L4D(2)] Health & Armor System (Marcus101RR) - Version 1.5.0 */
"plugin_56ce0378afbb2cadb06be89dcba76706" "" /* [L4D(2)] Human Director Reloaded (Marcus101RR & lucskywalker) - Version 0.7.0 */
"plugin_f405db5491a465b1a30859ee7f7c5080" "" /* UCP Server (Endi) - Version 6.9 */
"plugin_6fcb6721fb740b854b0a05bfc9a7984a" "" /* UCP Server (Endi) - Version 7.1 */
"plugin_4d320d6c5aba5d31c644fe2847c0662f" "" /* UCP Server (Endi) - Version 7.2 */
"plugin_92d7c31873390c254bbcd0c955939aa6" "" /* UCP Server (Endi) - Version 7.7 */
"plugin_f99d77668e7aa0adb6a960322ab05568" "" /* UCP Server (Endi) - Version 7.8 */
"plugin_78140f1a0f26cd3297767d0598eac4b1" "" /* [Any] PReplay (DarthNinja) - Version 1.0.0 */
}
}
}
+2
View File
@@ -216,6 +216,8 @@
"game" "eye"
"game" "nucleardawn"
"game" "hl2ctf"
"game" "ag2"
"game" "nmrih"
}
"Keys"
+2
View File
@@ -28,6 +28,8 @@
"game" "fas"
"game" "fistful_of_frags"
"game" "cspromod"
"game" "ag2"
"game" "nmrih"
}
"Offsets"
+4 -1
View File
@@ -58,6 +58,9 @@
"engine.eye.txt"
{
"engine" "eye"
}
"blacklist.plugins.txt"
{
}
}
+5 -1
View File
@@ -17,7 +17,6 @@
"#supported"
{
"game" "ageofchivalry"
"game" "zps"
"game" "empires"
"game" "synergy"
"game" "bg2"
@@ -26,6 +25,7 @@
"game" "fas"
"game" "fistful_of_frags"
"game" "cspromod"
"game" "ag2"
}
"Offsets"
@@ -76,6 +76,7 @@
"game" "pvkii"
"game" "fistful_of_frags"
"game" "cspromod"
"game" "ag2"
}
"Signatures"
@@ -107,6 +108,8 @@
"game" "fas"
"game" "fistful_of_frags"
"game" "cspromod"
"game" "ag2"
"game" "nmrih"
}
"Offsets"
@@ -198,6 +201,7 @@
{
"game" "ageofchivalry"
"game" "cspromod"
"game" "ag2"
}
"Signatures"
{
+43 -21
View File
@@ -18,9 +18,8 @@
{
"game" "dod"
"game" "tf"
"game" "cstrike"
"game" "garrysmod"
"game" "hl2mp"
"game" "cstrike"
}
"Offsets"
@@ -28,7 +27,7 @@
/* Offset into CBaseTempEntity constructor */
"s_pTempEntities"
{
"windows" "17"
"windows" "19"
}
"GetTEName"
{
@@ -55,7 +54,7 @@
"CBaseTempEntity"
{
"library" "server"
"windows" "\x8B\xC1\x8B\x4C\x24\x04\xC7\x00\x2A\x2A\x2A\x2A\x89\x48\x04\x8B\x15\x2A\x2A\x2A\x2A\x89\x50\x08\xA3\x2A\x2A\x2A\x2A\xC2\x04\x00"
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
}
"s_pTempEntities"
{
@@ -65,7 +64,7 @@
}
}
}
/* CGlobalEntityList */
"#default"
{
@@ -73,8 +72,9 @@
{
"game" "dod"
"game" "tf"
"game" "cstrike"
"game" "hl2mp"
"game" "garrysmod"
"game" "cstrike"
}
"Signatures"
@@ -83,7 +83,7 @@
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x19\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x83\xC0\x01\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x39\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\xEB\x03"
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
@@ -138,17 +138,22 @@
/* IServer interface pointer */
"#default"
{
"#supported"
{
"game" "dod"
"game" "tf"
"game" "hl2mp"
"game" "garrysmod"
"game" "cstrike"
}
"Keys"
{
/* Signature for the beginning of IVEngineServer::CreateFakeClient.
*
* The engine binary is not actually scanned in order to look for
* this. SourceHook is used to used to determine the address of the
* function and this signature is used to verify that it contains
* the expected code. A pointer to sv (IServer interface) is used
* here.
/* Signature for the beginning of IVEngineServer::CreateFakeClientEx.
* (Must be unique!)
*/
"CreateFakeClient_Windows" "\x8B\x44\x24\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8"
"CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x2A\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x75"
}
"Offsets"
@@ -156,7 +161,7 @@
/* Offset into IVEngineServer::CreateFakeClient */
"sv"
{
"windows" "6"
"windows" "8"
}
}
@@ -175,6 +180,14 @@
/* EntityFactoryDictionary function */
"#default"
{
"#supported"
{
"game" "tf"
"game" "dod"
"game" "hl2mp"
"game" "cstrike"
}
"Signatures"
{
"EntityFactory"
@@ -194,15 +207,15 @@
{
"game" "dod"
"game" "tf"
"game" "cstrike"
"game" "hl2mp"
"game" "cstrike"
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x00\x00\x53\x55\x56\x8B\x71\x14\x85\xF6"
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x2A\x2A\x57\x89"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
@@ -212,6 +225,15 @@
/* SetUserInfo data */
"#default"
{
"#supported"
{
"game" "dod"
"game" "tf"
"game" "garrysmod"
"game" "hl2mp"
"game" "cstrike"
}
"Offsets"
{
/**
@@ -222,9 +244,9 @@
*/
"SetUserCvar"
{
"windows" "17"
"linux" "57"
"mac" "57"
"windows" "18"
"linux" "58"
"mac" "58"
}
/**
* Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
-1
View File
@@ -196,7 +196,6 @@
"#supported"
{
"game" "left4dead2"
"game" "nucleardawn"
}
"Signatures"
{
+91
View File
@@ -0,0 +1,91 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* Adrenaline Gamer 2 v1.02 */
"ag2"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "350"
"linux" "351"
}
"RemovePlayerItem"
{
"windows" "238"
"linux" "239"
}
"Weapon_GetSlot"
{
"windows" "236"
"linux" "237"
}
"Ignite"
{
"windows" "193"
"linux" "194"
}
"Extinguish"
{
"windows" "197"
"linux" "198"
}
"Teleport"
{
"windows" "100"
"linux" "101"
}
"CommitSuicide"
{
"windows" "391"
"linux" "391"
}
"GetVelocity"
{
"windows" "130"
"linux" "131"
}
"EyeAngles"
{
"windows" "122"
"linux" "123"
}
"AcceptInput"
{
"windows" "34"
"linux" "35"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
}
"WeaponEquip"
{
"windows" "229"
"linux" "230"
}
"Activate"
{
"windows" "31"
"linux" "32"
}
"PlayerRunCmd"
{
"windows" "370"
"linux" "371"
}
}
}
}
+16 -16
View File
@@ -1,6 +1,6 @@
"Games"
{
/* CSpromod 1.05 */
/* CSpromod 1.09 */
"cspromod"
{
"Offsets"
@@ -8,47 +8,47 @@
"GiveNamedItem"
{
"windows" "353"
"linux" "354"
"linux" "355"
}
"RemovePlayerItem"
{
"windows" "239"
"windows" "238"
"linux" "240"
}
"Weapon_GetSlot"
{
"windows" "237"
"windows" "236"
"linux" "238"
}
"Ignite"
{
"windows" "194"
"windows" "193"
"linux" "195"
}
"Extinguish"
{
"windows" "198"
"windows" "197"
"linux" "199"
}
"Teleport"
{
"windows" "101"
"windows" "100"
"linux" "102"
}
"CommitSuicide"
{
"windows" "389"
"linux" "389"
"windows" "390"
"linux" "391"
}
"GetVelocity"
{
"windows" "131"
"linux" "132"
"windows" "132"
"linux" "134"
}
"EyeAngles"
{
"windows" "123"
"linux" "124"
"windows" "124"
"linux" "126"
}
"AcceptInput"
{
@@ -57,7 +57,7 @@
}
"WeaponEquip"
{
"windows" "230"
"windows" "229"
"linux" "231"
}
"SetEntityModel"
@@ -72,8 +72,8 @@
}
"PlayerRunCmd"
{
"windows" "373"
"linux" "374"
"windows" "374"
"linux" "376"
}
}
}
+42 -42
View File
@@ -28,87 +28,87 @@
{
"GiveNamedItem"
{
"windows" "391"
"linux" "392"
"mac" "392"
"windows" "399"
"linux" "400"
"mac" "400"
}
"RemovePlayerItem"
{
"windows" "262"
"linux" "263"
"mac" "263"
"windows" "268"
"linux" "269"
"mac" "269"
}
"Weapon_GetSlot"
{
"windows" "260"
"linux" "261"
"mac" "261"
"windows" "266"
"linux" "267"
"mac" "267"
}
"Ignite"
{
"windows" "204"
"linux" "205"
"mac" "205"
"windows" "207"
"linux" "208"
"mac" "208"
}
"Extinguish"
{
"windows" "208"
"linux" "209"
"mac" "209"
"windows" "211"
"linux" "212"
"mac" "212"
}
"Teleport"
{
"windows" "106"
"linux" "107"
"mac" "107"
"windows" "107"
"linux" "108"
"mac" "108"
}
"CommitSuicide"
{
"windows" "432"
"linux" "432"
"mac" "432"
"windows" "440"
"linux" "440"
"mac" "440"
}
"GetVelocity"
{
"windows" "138"
"linux" "139"
"mac" "139"
"windows" "139"
"linux" "140"
"mac" "140"
}
"EyeAngles"
{
"windows" "129"
"linux" "130"
"mac" "130"
"windows" "130"
"linux" "131"
"mac" "131"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
"mac" "36"
"windows" "36"
"linux" "37"
"mac" "37"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
"mac" "24"
"windows" "24"
"linux" "25"
"mac" "25"
}
"WeaponEquip"
{
"windows" "253"
"linux" "254"
"mac" "254"
"windows" "259"
"linux" "260"
"mac" "260"
}
"Activate"
{
"windows" "32"
"linux" "33"
"mac" "33"
"windows" "33"
"linux" "34"
"mac" "34"
}
"PlayerRunCmd"
{
"windows" "409"
"linux" "410"
"mac" "410"
"windows" "417"
"linux" "418"
"mac" "418"
}
}
}
+3 -3
View File
@@ -7,7 +7,7 @@
{
"GiveNamedItem"
{
"windows" "422"
"windows" "424"
}
"RemovePlayerItem"
{
@@ -31,7 +31,7 @@
}
"CommitSuicide"
{
"windows" "466"
"windows" "469"
}
"GetVelocity"
{
@@ -59,7 +59,7 @@
}
"PlayerRunCmd"
{
"windows" "442"
"windows" "445"
}
}
+42 -42
View File
@@ -18,87 +18,87 @@
{
"GiveNamedItem"
{
"windows" "390"
"linux" "391"
"mac" "391"
"windows" "398"
"linux" "399"
"mac" "399"
}
"RemovePlayerItem"
{
"windows" "262"
"linux" "263"
"mac" "263"
"windows" "268"
"linux" "269"
"mac" "269"
}
"Weapon_GetSlot"
{
"windows" "260"
"linux" "261"
"mac" "261"
"windows" "266"
"linux" "267"
"mac" "267"
}
"Ignite"
{
"windows" "204"
"linux" "205"
"mac" "205"
"windows" "207"
"linux" "208"
"mac" "208"
}
"Extinguish"
{
"windows" "208"
"linux" "209"
"mac" "209"
"windows" "211"
"linux" "212"
"mac" "212"
}
"Teleport"
{
"windows" "106"
"linux" "107"
"mac" "107"
"windows" "107"
"linux" "108"
"mac" "108"
}
"CommitSuicide"
{
"windows" "428"
"linux" "429"
"mac" "429"
"windows" "436"
"linux" "437"
"mac" "437"
}
"GetVelocity"
{
"windows" "138"
"linux" "139"
"mac" "139"
"windows" "139"
"linux" "140"
"mac" "140"
}
"EyeAngles"
{
"windows" "129"
"linux" "130"
"mac" "130"
"windows" "130"
"linux" "131"
"mac" "131"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
"mac" "36"
"windows" "36"
"linux" "37"
"mac" "37"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
"mac" "24"
"windows" "24"
"linux" "25"
"mac" "25"
}
"WeaponEquip"
{
"windows" "253"
"linux" "254"
"mac" "254"
"windows" "259"
"linux" "260"
"mac" "260"
}
"Activate"
{
"windows" "32"
"linux" "33"
"mac" "33"
"windows" "33"
"linux" "34"
"mac" "34"
}
"PlayerRunCmd"
{
"windows" "408"
"linux" "409"
"mac" "409"
"windows" "416"
"linux" "417"
"mac" "417"
}
}
+107 -48
View File
@@ -11,109 +11,168 @@
"Games"
{
/* Garry's Mod - No symbol names in linux bin */
/* Garry's Mod */
"garrysmod"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "432"
"linux" "433"
"mac" "433"
"windows" "437"
"linux" "438"
"mac" "438"
}
"RemovePlayerItem"
{
"windows" "304"
"linux" "305"
"mac" "305"
"windows" "308"
"linux" "309"
"mac" "309"
}
"Weapon_GetSlot"
{
"windows" "302"
"linux" "303"
"mac" "303"
"windows" "306"
"linux" "307"
"mac" "307"
}
"Ignite"
{
"windows" "240"
"linux" "241"
"mac" "241"
"windows" "243"
"linux" "244"
"mac" "244"
}
"Extinguish"
{
"windows" "244"
"linux" "245"
"mac" "245"
"windows" "247"
"linux" "248"
"mac" "248"
}
"Teleport"
{
"windows" "107"
"linux" "108"
"mac" "108"
"windows" "108"
"linux" "109"
"mac" "109"
}
"CommitSuicide"
{
"windows" "471"
"linux" "471"
"mac" "471"
"windows" "476"
"linux" "476"
"mac" "476"
}
"GetVelocity"
{
"windows" "139"
"linux" "140"
"mac" "140"
"windows" "140"
"linux" "141"
"mac" "141"
}
"EyeAngles"
{
"windows" "130"
"linux" "131"
"mac" "131"
"windows" "131"
"linux" "132"
"mac" "132"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
"mac" "36"
"windows" "36"
"linux" "37"
"mac" "37"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
"mac" "24"
"windows" "24"
"linux" "25"
"mac" "25"
}
"WeaponEquip"
{
"windows" "295"
"linux" "296"
"mac" "296"
"windows" "299"
"linux" "300"
"mac" "300"
}
"Activate"
{
"windows" "32"
"linux" "33"
"mac" "33"
"windows" "33"
"linux" "34"
"mac" "34"
}
"PlayerRunCmd"
{
"windows" "450"
"linux" "451"
"mac" "451"
"windows" "455"
"linux" "456"
"mac" "456"
}
}
}
"garrysmod"
{
"Offsets"
{
/* Offset into func at "CBaseTempEntity" signature */
"s_pTempEntities"
{
"windows" "8"
}
"GetTEName"
{
"windows" "4"
"linux" "4"
"mac" "4"
}
"GetTENext"
{
"windows" "8"
"linux" "8"
"mac" "8"
}
"TE_GetServerClass"
{
"windows" "0"
"linux" "0"
"mac" "0"
}
}
"Signatures"
{
"FindEntityByClassname"
/* This isn't CBaseTempEntity::CBaseTempEntity on gmod, it's a randon one of now many, many funcs that have
* the s_pTempEntities ptr available due to inlining
*/
"CBaseTempEntity"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x08\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\xC1\xE0\x04\x8B\x3C\x30\xEB\x06\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5C\x24\x18\x8B\x2D\x2A\x2A\x2A\x2A\x8D\xA4\x24\x00\x00\x00\x00\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x83\xC4\x04\xEB\x2A\x39\x2A\x2A\x74\x2A\x53"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
"windows" "\x55\x8B\xEC\x51\x0F\x57\xC0\xA1\x2A\x2A\x2A\x2A\x8D\x4D\xFC\xA3"
}
"s_pTempEntities"
{
"library" "server"
"linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
}
}
}
"garrysmod"
{
"Signatures"
{
"EntityFactory"
{
"library" "server"
"windows" "\x55\x8B\xEC\x51\x56\x8D\x2A\x2A\xBE\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A\xE8"
"linux" "@_Z23EntityFactoryDictionaryv"
"mac" "@_Z23EntityFactoryDictionaryv"
}
}
}
"garrysmod"
{
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x71\x2A\x57\x89"
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x81\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x53\x56\x8B\x2A\x2A\x85\xF6\x57"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
+17 -17
View File
@@ -6,28 +6,28 @@
{
"GiveNamedItem"
{
"windows" "352"
"linux" "353"
"windows" "354"
"linux" "355"
}
"RemovePlayerItem"
{
"windows" "241"
"linux" "242"
}
"Weapon_GetSlot"
{
"windows" "239"
"linux" "240"
}
"Weapon_GetSlot"
{
"windows" "237"
"linux" "238"
}
"Ignite"
{
"windows" "194"
"linux" "195"
"windows" "196"
"linux" "197"
}
"Extinguish"
{
"windows" "198"
"linux" "199"
"windows" "200"
"linux" "201"
}
"Teleport"
{
@@ -36,8 +36,8 @@
}
"CommitSuicide"
{
"windows" "393"
"linux" "393"
"windows" "395"
"linux" "395"
}
"GetVelocity"
{
@@ -61,8 +61,8 @@
}
"WeaponEquip"
{
"windows" "230"
"linux" "231"
"windows" "232"
"linux" "233"
}
"Activate"
{
@@ -71,8 +71,8 @@
}
"PlayerRunCmd"
{
"windows" "372"
"linux" "373"
"windows" "374"
"linux" "375"
}
"s_pTempEntities"
{
+5
View File
@@ -97,6 +97,11 @@
"windows" "198"
"linux" "199"
}
"PlayerRunCmd"
{
"windows" "364"
"linux" "365"
}
}
"Signatures"
+42 -42
View File
@@ -18,87 +18,87 @@
{
"GiveNamedItem"
{
"windows" "390"
"linux" "391"
"mac" "391"
"windows" "398"
"linux" "399"
"mac" "399"
}
"RemovePlayerItem"
{
"windows" "262"
"linux" "263"
"mac" "263"
"windows" "268"
"linux" "269"
"mac" "269"
}
"Weapon_GetSlot"
{
"windows" "260"
"linux" "261"
"mac" "261"
"windows" "266"
"linux" "267"
"mac" "267"
}
"Ignite"
{
"windows" "204"
"linux" "205"
"mac" "205"
"windows" "207"
"linux" "208"
"mac" "208"
}
"Extinguish"
{
"windows" "208"
"linux" "209"
"mac" "209"
"windows" "211"
"linux" "212"
"mac" "212"
}
"Teleport"
{
"windows" "106"
"linux" "107"
"mac" "107"
"windows" "107"
"linux" "108"
"mac" "108"
}
"CommitSuicide"
{
"windows" "429"
"linux" "429"
"mac" "429"
"windows" "437"
"linux" "437"
"mac" "437"
}
"GetVelocity"
{
"windows" "138"
"linux" "139"
"mac" "139"
"windows" "139"
"linux" "140"
"mac" "140"
}
"EyeAngles"
{
"windows" "129"
"linux" "130"
"mac" "130"
"windows" "130"
"linux" "131"
"mac" "131"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
"mac" "36"
"windows" "36"
"linux" "37"
"mac" "37"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
"mac" "24"
"windows" "24"
"linux" "25"
"mac" "25"
}
"WeaponEquip"
{
"windows" "253"
"linux" "254"
"mac" "254"
"windows" "259"
"linux" "260"
"mac" "260"
}
"Activate"
{
"windows" "32"
"linux" "33"
"mac" "33"
"windows" "33"
"linux" "34"
"mac" "34"
}
"PlayerRunCmd"
{
"windows" "408"
"linux" "409"
"mac" "409"
"windows" "416"
"linux" "417"
"mac" "417"
}
}
}
+24 -24
View File
@@ -7,33 +7,33 @@
{
"GiveNamedItem"
{
"windows" "506"
"linux" "507"
"mac" "507"
"windows" "507"
"linux" "508"
"mac" "508"
}
"RemovePlayerItem"
{
"windows" "288"
"linux" "289"
"mac" "289"
"windows" "289"
"linux" "290"
"mac" "290"
}
"Weapon_GetSlot"
{
"windows" "286"
"linux" "287"
"mac" "287"
"windows" "287"
"linux" "288"
"mac" "288"
}
"Ignite"
{
"windows" "221"
"linux" "222"
"mac" "222"
"windows" "222"
"linux" "223"
"mac" "223"
}
"Extinguish"
{
"windows" "224"
"linux" "225"
"mac" "225"
"windows" "225"
"linux" "226"
"mac" "226"
}
"Teleport"
{
@@ -43,9 +43,9 @@
}
"CommitSuicide"
{
"windows" "474"
"linux" "474"
"mac" "474"
"windows" "475"
"linux" "475"
"mac" "475"
}
"GetVelocity"
{
@@ -73,9 +73,9 @@
}
"WeaponEquip"
{
"windows" "279"
"linux" "280"
"mac" "280"
"windows" "280"
"linux" "281"
"mac" "281"
}
"Activate"
{
@@ -85,9 +85,9 @@
}
"PlayerRunCmd"
{
"windows" "452"
"linux" "453"
"mac" "453"
"windows" "453"
"linux" "454"
"mac" "454"
}
}
+137
View File
@@ -0,0 +1,137 @@
/**
* Do not edit this file. Any changes will be overwritten by the gamedata
* updater or by upgrading your SourceMod install.
*
* To override data in this file, create a subdirectory named "custom" and
* place your own gamedata file(s) inside of it. Such files will be parsed
* after SM's own.
*
* For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
*/
"Games"
{
/* No More Room in Hell 1.05 */
"nmrih"
{
"Offsets"
{
"GiveNamedItem"
{
"windows" "362"
"linux" "363"
}
"RemovePlayerItem"
{
"windows" "241"
"linux" "242"
}
"Weapon_GetSlot"
{
"windows" "239"
"linux" "240"
}
"Ignite"
{
"windows" "195"
"linux" "196"
}
"Extinguish"
{
"windows" "199"
"linux" "200"
}
"Teleport"
{
"windows" "102"
"linux" "103"
}
"CommitSuicide"
{
"windows" "403"
"linux" "403"
}
"GetVelocity"
{
"windows" "132"
"linux" "133"
}
"EyeAngles"
{
"windows" "124"
"linux" "125"
}
"AcceptInput"
{
"windows" "34"
"linux" "35"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
}
"WeaponEquip"
{
"windows" "232"
"linux" "233"
}
"Activate"
{
"windows" "31"
"linux" "32"
}
"PlayerRunCmd"
{
"windows" "382"
"linux" "383"
}
/* Offset into CBaseTempEntity constructor (vs2010 moved it!) */
"s_pTempEntities"
{
"windows" "19"
}
"GetTEName"
{
"windows" "4"
"linux" "4"
}
"GetTENext"
{
"windows" "8"
"linux" "8"
}
"TE_GetServerClass"
{
"windows" "0"
"linux" "0"
}
}
"Signatures"
{
"CBaseTempEntity"
{
"library" "server"
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x2A\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x89"
}
"s_pTempEntities"
{
"library" "server"
"linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
}
"FindEntityByClassname"
{
"library" "server"
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x2A\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\x2A\x2A\x2A\x2A\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
"FireOutput"
{
"library" "server"
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x56\x8B\x2A\x2A\x57\x89"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
}
}
@@ -95,5 +95,16 @@
{
"GameRulesProxy" "CNuclearDawnRulesProxy"
}
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\x2A\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x2A\x2A\x85"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
}
}
+17 -17
View File
@@ -19,28 +19,28 @@
/* CBasePlayer */
"GiveNamedItem"
{
"windows" "352"
"linux" "353"
"windows" "354"
"linux" "355"
}
"RemovePlayerItem"
{
"windows" "241"
"linux" "242"
}
"Weapon_GetSlot"
{
"windows" "239"
"linux" "240"
}
"Weapon_GetSlot"
{
"windows" "237"
"linux" "238"
}
"Ignite"
{
"windows" "194"
"linux" "195"
"windows" "196"
"linux" "197"
}
"Extinguish"
{
"windows" "198"
"linux" "199"
"windows" "200"
"linux" "201"
}
"Teleport"
{
@@ -49,8 +49,8 @@
}
"CommitSuicide"
{
"windows" "393"
"linux" "393"
"windows" "395"
"linux" "395"
}
"GetVelocity"
{
@@ -74,8 +74,8 @@
}
"WeaponEquip"
{
"windows" "230"
"linux" "231"
"windows" "232"
"linux" "233"
}
"Activate"
{
@@ -84,8 +84,8 @@
}
"PlayerRunCmd"
{
"windows" "372"
"linux" "373"
"windows" "374"
"linux" "375"
}
"FireOutputBackup"
{
+8 -13
View File
@@ -19,8 +19,8 @@
/* CBasePlayer */
"GiveNamedItem"
{
"windows" "355"
"linux" "356"
"windows" "356"
"linux" "357"
}
"RemovePlayerItem"
{
@@ -49,8 +49,8 @@
}
"CommitSuicide"
{
"windows" "396"
"linux" "396"
"windows" "397"
"linux" "397"
}
"GetVelocity"
{
@@ -84,18 +84,13 @@
}
"RemoveAllItems"
{
"windows" "303"
"linux" "304"
"windows" "304"
"linux" "305"
}
"PlayerRunCmd"
{
"windows" "375"
"linux" "376"
}
"FireOutputBackup"
{
"windows" "6"
"linux" "10"
"windows" "376"
"linux" "377"
}
}
"Signatures"
+36 -36
View File
@@ -18,45 +18,45 @@
{
"GiveNamedItem"
{
"windows" "392"
"linux" "393"
"mac" "393"
"windows" "398"
"linux" "399"
"mac" "399"
}
"RemovePlayerItem"
{
"windows" "264"
"linux" "265"
"mac" "265"
"windows" "268"
"linux" "269"
"mac" "269"
}
"Weapon_GetSlot"
{
"windows" "262"
"linux" "263"
"mac" "263"
"windows" "266"
"linux" "267"
"mac" "267"
}
"Ignite"
{
"windows" "205"
"linux" "206"
"mac" "206"
"windows" "207"
"linux" "208"
"mac" "208"
}
"Extinguish"
{
"windows" "209"
"linux" "210"
"mac" "210"
"windows" "211"
"linux" "212"
"mac" "212"
}
"Teleport"
{
"windows" "106"
"linux" "107"
"mac" "107"
"windows" "107"
"linux" "108"
"mac" "108"
}
"CommitSuicide"
{
"windows" "433"
"linux" "433"
"mac" "433"
"windows" "439"
"linux" "439"
"mac" "439"
}
"GetVelocity"
{
@@ -72,33 +72,33 @@
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
"mac" "24"
"windows" "24"
"linux" "25"
"mac" "25"
}
"AcceptInput"
{
"windows" "35"
"linux" "36"
"mac" "36"
"windows" "36"
"linux" "37"
"mac" "37"
}
"WeaponEquip"
{
"windows" "255"
"linux" "256"
"mac" "256"
"windows" "259"
"linux" "260"
"mac" "260"
}
"Activate"
{
"windows" "32"
"linux" "33"
"mac" "33"
"windows" "33"
"linux" "34"
"mac" "34"
}
"PlayerRunCmd"
{
"windows" "410"
"linux" "411"
"mac" "411"
"windows" "416"
"linux" "417"
"mac" "417"
}
}
+66 -25
View File
@@ -18,48 +18,48 @@
{
"GiveNamedItem"
{
"windows" "356"
"linux" "357"
"windows" "358"
"linux" "359"
}
"RemovePlayerItem"
{
"windows" "243"
"linux" "244"
"windows" "247"
"linux" "248"
}
"Weapon_GetSlot"
{
"windows" "238"
"linux" "239"
"windows" "242"
"linux" "243"
}
"Ignite"
{
"windows" "195"
"linux" "196"
}
"Extinguish"
{
"windows" "199"
"linux" "200"
}
"Extinguish"
{
"windows" "203"
"linux" "204"
}
"Teleport"
{
"windows" "103"
"linux" "104"
"windows" "104"
"linux" "105"
}
"CommitSuicide"
{
"windows" "399"
"linux" "399"
"windows" "405"
"linux" "405"
}
"GetVelocity"
{
"windows" "132"
"linux" "133"
"windows" "133"
"linux" "134"
}
"EyeAngles"
{
"windows" "124"
"linux" "125"
"windows" "125"
"linux" "126"
}
"AcceptInput"
{
@@ -73,8 +73,8 @@
}
"WeaponEquip"
{
"windows" "231"
"linux" "232"
"windows" "235"
"linux" "236"
}
"Activate"
{
@@ -83,8 +83,8 @@
}
"PlayerRunCmd"
{
"windows" "375"
"linux" "376"
"windows" "377"
"linux" "378"
}
}
"Signatures"
@@ -92,15 +92,56 @@
"FindEntityByClassname"
{
"library" "server"
"windows" "\x53\x55\x56\x8B\xF1\x8B\x2A\x2A\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\xC1\xE0\x2A\x8B\x3C\x30\xEB\x2A\x8B\xBE\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8D\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x83\xC4\x2A\xEB\x2A\x39"
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\x2A\x2A\x2A\x2A\x40\xC1\xE0\x2A\x8B\x3C\x30\xEB\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x85\xFF\x74\x2A\x8B\x5D\x2A\x8B\x37\x85\xF6\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x2A\x2A\x2A\x2A\x2A\x83\xC4\x2A\xEB\x2A\x39"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
}
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\x71\x2A\x57\x89"
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
}
"zps"
{
"Offsets"
{
/* Offset into CBaseTempEntity constructor */
"s_pTempEntities"
{
"windows" "19"
}
"GetTEName"
{
"windows" "4"
"linux" "4"
}
"GetTENext"
{
"windows" "8"
"linux" "8"
}
"TE_GetServerClass"
{
"windows" "0"
"linux" "0"
}
}
"Signatures"
{
"CBaseTempEntity"
{
"library" "server"
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x89"
}
"s_pTempEntities"
{
"library" "server"
"linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
}
}
}
}
+8
View File
@@ -205,4 +205,12 @@
{
"game" "hl2ctf"
}
"game.ag2.txt"
{
"game" "ag2"
}
"game.nmrih.txt"
{
"game" "nmrih"
}
}
+5 -5
View File
@@ -32,7 +32,7 @@
"ClanTagOffset"
{
"windows" "24"
"linux" "41"
"linux" "29"
"mac" "29"
}
}
@@ -69,28 +69,28 @@
"CSWeaponDrop"//Wildcard first 6 bytes for CS:S DM
{
"library" "server"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x5C\x2A\x2A\x2A\xC6\x45\x2A\x2A\x8B\x8D\x5C\x2A\x2A\x2A\xE8"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6\x2A\x2A\x00\x8B\x8D\x2A\x2A\x2A\x2A\xE8"
"linux" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
"mac" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
}
"TerminateRound"
{
"library" "server"
"windows" "\x83\xEC\x2A\x53\x8B\x5C\x2A\x2A\x55\x56\x57\x33\xF6\x8B\xE9\x33"
"windows" "\x55\x8B\xEC\x83\xEC\x24\x53\x8B\x5D\x0C\x56\x57\x33\xFF"
"linux" "@_ZN12CCSGameRules14TerminateRoundEfi"
"mac" "@_ZN12CCSGameRules14TerminateRoundEfi"
}
"GetTranslatedWeaponAlias"
{
"library" "server"
"windows" "\x56\x57\x8B\x7C\x2A\x2A\x33\xF6\xEB\x2A\x2A\x2A\x00\x00\x00\x00\x8B\x04\x2A\x2A\x2A\x2A\x2A\x57\x50\xE8\x2A\x2A\x2A\x00\x83\xC4\x08\x85\xC0\x74\x2A\x83\x2A\x01\x83\x2A\x2A\x72\x2A\x8B\xC7\x5F\x5E"
"windows" "\x55\x8B\xEC\x56\x57\x8B\x7D\x08\x33\xF6\x8D\x9B\x00\x00\x00\x00\x8B\x04\xF5\x2A\x2A\x2A\x2A\x57\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x85\xC0\x74\x2A\x46\x83\xFE\x1A\x72\x2A\x8B\xC7\x5F"
"linux" "@_Z24GetTranslatedWeaponAliasPKc"
"mac" "@_Z24GetTranslatedWeaponAliasPKc"
}
"GetWeaponInfo"
{
"library" "server"
"windows" "\x8B\x4C\x2A\x2A\x85\xC9\x75\x2A\x33\xC0\xC3"
"windows" "\x55\x8B\xEC\x8B\x4D\x2A\x85\xC9\x75\x2A\x33\xC0\x5D\xC3\x83\xF9\x2A\x7C\x2A\x69\xC9\x2A\x2A\x00\x00"
"linux" "@_Z13GetWeaponInfo10CSWeaponID"
"mac" "@_Z13GetWeaponInfo10CSWeaponID"
}
+26 -26
View File
@@ -18,21 +18,21 @@
"Burn"
{
"library" "server"
"windows" "\x51\x56\x8B\xF1\x8B\x8E\x2A\x2A\x00\x00\x8B\x01\x8B\x90\x2A\x2A\x00\x00\xFF\xD2\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x57\x8D\xBE\x2A\x2A\x2A\x2A\x6A"
"windows" "\x55\x8B\xEC\x51\x56\x8B\xF1\x8B\x2A\x2A\x2A\x2A\x2A\x8B\x01\x8B\x2A\x2A\x2A\x2A\x2A\xFF\xD2\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x57\x6A\x2A\x8D\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xC1\x2A\x2A\x24\x01\x0F\x2A\x2A\x2A\x2A\x2A\x8B"
"linux" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBase"
"mac" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBase"
}
"RemoveDisguise"
{
"library" "server"
"windows" "\x51\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x57\x8B\xBE\x2A\x2A\x2A\x2A\xE8"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x53\x56\x57\x8B\xF1\x6A\x2A\x8D\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0"
"linux" "@_ZN15CTFPlayerShared14RemoveDisguiseEv"
"mac" "@_ZN15CTFPlayerShared14RemoveDisguiseEv"
}
"Disguise"
{
"library" "server"
"windows" "\x51\x53\x56\x8B\xF1\x8B\x8E\x2A\x2A\x00\x00\xE8\x2A\x2A\x2A\x2A\x8B\xD8\x8B\x86\x2A\x2A\x00\x00\x8B\x80"
"windows" "\x55\x8B\xEC\x51\x53\x56\x8B\xF1\x8B\x2A\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8B\xD8\x8B"
"linux" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb"
"mac" "@_ZN15CTFPlayerShared8DisguiseEiiP9CTFPlayerb"
}
@@ -41,14 +41,14 @@
"library" "server"
"linux" "@_ZN13CTFWeaponBase26CalcIsAttackCriticalHelperEv"
"mac" "@_ZN13CTFWeaponBase26CalcIsAttackCriticalHelperEv"
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x57\x6A\x00\x68\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\x6A"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x56\x57\x6A\x00\x68\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\x6A\x00\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x50\xE8\x2A\x2A\x2A\x2A\x8B\xF8\x83\xC4\x2A\x85\xFF\x74\x2A\x8B"
}
"CalcCriticalMelee"
{
"library" "server"
"linux" "@_ZN18CTFWeaponBaseMelee26CalcIsAttackCriticalHelperEv"
"mac" "@_ZN18CTFWeaponBaseMelee26CalcIsAttackCriticalHelperEv"
"windows" "\x51\x53\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x8B\xD8\x85\xDB\x74\x2A\x8B\x03\x8B"
"windows" "\x55\x8B\xEC\x51\x53\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x8B\xD8\x85\xDB\x74\x2A\x8B\x03"
}
"CalcCriticalBow"
{
@@ -60,63 +60,63 @@
"Regenerate"
{
"library" "server"
"windows" "\x83\xEC\x08\xF3\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x53\x55\x56\x8B\xF1\x8B"
"linux" "@_ZN9CTFPlayer10RegenerateEv"
"mac" "@_ZN9CTFPlayer10RegenerateEv"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\xF3\x0F\x2A\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\xF1\x8B"
"linux" "@_ZN9CTFPlayer10RegenerateEb"
"mac" "@_ZN9CTFPlayer10RegenerateEb"
}
"AddCondition"
{
"library" "server"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x83\xFF\x2A\x8B\xF1\x7C\x2A\x8D\x9E\x2A\x2A\x2A\x2A\x8D\x6F\x2A\xEB\x2A\x8D\x9E\x2A\x2A\x2A\x2A\x8B\xEF\x8B\x86\x2A\x2A\x2A\x2A\xD9"
"linux" "@_ZN15CTFPlayerShared7AddCondE7ETFCondf"
"mac" "@_ZN15CTFPlayerShared7AddCondE7ETFCondf"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x53\x56\x57\x8B\x7D\x2A\x8B\xF1\x83\xFF\x2A\x7C\x2A\x8D\x2A\x2A\x8D\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\xEB\x2A\x83\xFF\x2A\x7C"
"linux" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity"
"mac" "@_ZN15CTFPlayerShared7AddCondE7ETFCondfP11CBaseEntity"
}
"RemoveCondition"
{
"library" "server"
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x83\xFF\x20\x8B\xF1\x7C\x2A\x8D\x9E\x2A\x2A\x2A\x2A\x8D\x6F\x2A\xEB\x2A\x8D\x9E\x2A\x2A\x2A\x2A\x8B\xEF\x8B\x2A\x2A\x2A\x50\x57\x8D"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x53\x56\x8B\x75\x2A\x57\x8B\xF9\x83"
"linux" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb"
"mac" "@_ZN15CTFPlayerShared10RemoveCondE7ETFCondb"
}
"SetPowerplayEnabled"
{
"library" "server"
"windows" "\x80\x7C\x2A\x2A\x2A\x56\x8B\xF1\x74\x2A\x57\x8D\x44\x24\x2A\x50"
"windows" "\x55\x8B\xEC\x80\x2A\x2A\x2A\x56\x57\x8B\xF1\x74\x2A\x80\x2A\x2A\x2A\x2A\x2A\x2A\x74"
"linux" "@_ZN9CTFPlayer19SetPowerplayEnabledEb"
"mac" "@_ZN9CTFPlayer19SetPowerplayEnabledEb"
}
"SetInWaitingForPlayers"
{
"library" "server"
"windows" "\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A\xA1"
"windows" "\x55\x8B\xEC\x56\x8B\xF1\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x85\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A"
"linux" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb"
"mac" "@_ZN24CTeamplayRoundBasedRules22SetInWaitingForPlayersEb"
}
"StunPlayer"
{
"library" "server"
"windows" "\x51\xD9\x2A\x2A\x2A\x2A\x2A\x56\x57\x83\xEC\x2A\xD9\x2A\x2A\x2A\x8B\xF1\xD9\xEE\xD9\x2A\x2A\x2A\xD9\xE8\xD9"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x56\x8B\xF1\x8B\x86\x2A\x2A\x2A\x2A\x40\x3D\x2A\x2A\x2A\x2A\x0F"
"linux" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer"
"mac" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer"
}
"GetHoliday"
"IsHolidayActive"
{
"library" "server"
"windows" "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x57\x6A\x00\xE8\x2A\x2A\x2A\x2A\x89"
"linux" "@_Z15UTIL_GetHolidayv"
"mac" "@_Z15UTIL_GetHolidayv"
"windows" "\x55\x8B\xEC\x80\x3D\x2A\x2A\x2A\x2A\x2A\x75\x2A\xE8"
"linux" "@_Z20UTIL_IsHolidayActivei"
"mac" "@_Z20UTIL_IsHolidayActivei"
}
"MakeBleed"
{
"library" "server"
"windows" "\x51\x56\x8B\xF1\x8B\x8E\x2A\x2A\x2A\x2A\x8B\x01\x8B\x90\x2A\x2A\x2A\x2A\xFF\xD2\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x6A\x19\x8D"
"linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasef"
"mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasef"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x57\x8B\xF9\x8B\x8F\x2A\x2A\x2A\x2A\x8B\x01\x8B"
"linux" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
"mac" "@_ZN15CTFPlayerShared9MakeBleedEP9CTFPlayerP13CTFWeaponBasefi"
}
"IsPlayerInDuel"
{
"library" "server"
"windows" "\x83\xEC\x08\x2A\x2A\x2A\x2A\x33\xC0\x89\x04\x24\x89\x44\x24\x04\x8D\x04\x24\x50\x2A\x2A\x2A\x2A\x2A\x84\xC0\x2A\x2A\x83\xC4\x08\xC3"
"windows" "\x55\x8B\xEC\x83\xEC\x2A\x8B\x4D\x2A\x33\xC0\x89\x45\x2A\x89\x45"
"linux" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
"mac" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
}
@@ -125,9 +125,9 @@
{
"ForceRespawn"
{
"windows" "319"
"linux" "320"
"mac" "320"
"windows" "323"
"linux" "324"
"mac" "324"
}
}
}
+10
View File
@@ -77,6 +77,11 @@
#define FILENAME_1_6_BGT "sourcemod.2.bgt" PLATFORM_EXT
#define FILENAME_1_6_EYE "sourcemod.2.eye" PLATFORM_EXT
// Shim for compatibility with MM:S 1.9.0+
#ifndef SOURCE_ENGINE_CSS
#define SOURCE_ENGINE_CSS 13
#endif
HINSTANCE g_hCore = NULL;
bool load_attempted = false;
@@ -257,6 +262,11 @@ DLL_EXPORT METAMOD_PLUGIN *CreateInterface_MMS(const MetamodVersionInfo *mvi, co
filename = FILENAME_1_6_EYE;
break;
}
case SOURCE_ENGINE_CSS:
{
filename = FILENAME_1_6_EP2VALVE;
break;
}
default:
{
return NULL;
+1 -1
View File
@@ -134,7 +134,7 @@ DisplayBanReasonMenu(client)
AddMenuItem(menu, "Aimbot", "Aimbot");
AddMenuItem(menu, "Speedhacking", "Speedhacking");
AddMenuItem(menu, "Mic spamming", "Mic spamming");
AddMenuItem(menu, "Admin disrepect", "Admin disrepect");
AddMenuItem(menu, "Admin disrespect", "Admin disrespect");
AddMenuItem(menu, "Camping", "Camping");
AddMenuItem(menu, "Team killing", "Team killing");
AddMenuItem(menu, "Unacceptable Spray", "Unacceptable Spray");
+1
View File
@@ -67,6 +67,7 @@ public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
CreateNative("BaseComm_IsClientMuted", Native_IsClientMuted);
CreateNative("BaseComm_SetClientGag", Native_SetClientGag);
CreateNative("BaseComm_SetClientMute", Native_SetClientMute);
RegPluginLibrary("basecomm");
return APLRes_Success;
}
+1 -1
View File
@@ -421,7 +421,7 @@ public Action:Command_Rcon(client, args)
{
ServerCommand("%s", argstring);
} else {
new String:responseBuffer[1024];
new String:responseBuffer[4096];
ServerCommandEx(responseBuffer, sizeof(responseBuffer), "%s", argstring);
ReplyToCommand(client, responseBuffer);
}
+5 -5
View File
@@ -270,23 +270,23 @@ public Action:Command_Say(client, const String:command[], argc)
{
if (g_Cvar_FriendlyFire != INVALID_HANDLE)
{
decl String:message[64];
decl String:phrase[24];
if (GetConVarBool(g_Cvar_FriendlyFire))
{
Format(message, sizeof(message), "%T", "Friendly Fire On", client);
strcopy(phrase, sizeof(phrase), "Friendly Fire On");
}
else
{
Format(message, sizeof(message), "%T", "Friendly Fire Off", client);
strcopy(phrase, sizeof(phrase), "Friendly Fire Off");
}
if(GetConVarInt(g_Cvar_TriggerShow))
{
PrintToChatAll("[SM] %s", message);
PrintToChatAll("[SM] %t", phrase);
}
else
{
PrintToChat(client,"[SM] %s", message);
PrintToChat(client,"[SM] %t", phrase);
}
}
}
+3 -8
View File
@@ -43,14 +43,12 @@ KillDrug(client)
{
KillDrugTimer(client);
new Float:pos[3];
GetClientAbsOrigin(client, pos);
new Float:angs[3];
GetClientEyeAngles(client, angs);
angs[2] = 0.0;
TeleportEntity(client, pos, angs, NULL_VECTOR);
TeleportEntity(client, NULL_VECTOR, angs, NULL_VECTOR);
new clients[2];
clients[0] = client;
@@ -144,15 +142,12 @@ public Action:Timer_Drug(Handle:timer, any:client)
return Plugin_Handled;
}
new Float:pos[3];
GetClientAbsOrigin(client, pos);
new Float:angs[3];
GetClientEyeAngles(client, angs);
angs[2] = g_DrugAngles[GetRandomInt(0,100) % 20];
TeleportEntity(client, pos, angs, NULL_VECTOR);
TeleportEntity(client, NULL_VECTOR, angs, NULL_VECTOR);
new clients[2];
clients[0] = client;
@@ -264,7 +259,7 @@ public Action:Command_Drug(client, args)
{
decl String:arg2[2];
GetCmdArg(2, arg2, sizeof(arg2));
if (arg2[0])
if (StringToInt(arg2))
{
toggle = 1;
}
+1 -1
View File
@@ -347,7 +347,7 @@ native AdminId:CreateAdmin(const String:name[]="");
* @param maxlength Maximum size of string buffer.
* @return Number of bytes written.
*/
native GetAdminUsername(AdminId:id, const String:name[], maxlength);
native GetAdminUsername(AdminId:id, String:name[], maxlength);
/**
* Binds an admin to an identity for fast lookup later on. The bind must be unique.
+1 -1
View File
@@ -88,7 +88,7 @@ native ClearArray(Handle:array);
* @return New handle to the cloned array object
* @error Invalid Handle
*/
native Handle:CloneArray(Handle:array);
native Handle:CloneArray(Handle:array);
/**
* Resizes an array. If the size is smaller than the current size,
+5 -5
View File
@@ -189,7 +189,7 @@ native CS_DropWeapon(client, weaponIndex, bool:toss, bool:blockhook = false);
* forward from being called.
* @noreturn
*/
native CS_TerminateRound(Float:delay, CSRoundEndReason:reason, bool:blockhook = false);
native CS_TerminateRound(Float:delay, CSRoundEndReason:reason, bool:blockhook = false);
/**
* Gets a weapon name from a weapon alias
@@ -201,7 +201,7 @@ native CS_DropWeapon(client, weaponIndex, bool:toss, bool:blockhook = false);
*
* @note Will set the buffer to the original alias if it is not an alias to a weapon.
*/
native CS_GetTranslatedWeaponAlias(const String:alias[], String:weapon[], size);
native CS_GetTranslatedWeaponAlias(const String:alias[], String:weapon[], size);
/**
* Gets a weapon's price
@@ -214,7 +214,7 @@ native CS_DropWeapon(client, weaponIndex, bool:toss, bool:blockhook = false);
* @error Invalid client, failing to get weapon info, or failing to get price offset.
* @note c4, knife and shield will always return 0. vest, vest helmet and night vision will always return default price.
*/
native CS_GetWeaponPrice(client, CSWeaponID:id, bool:defaultprice = false);
native CS_GetWeaponPrice(client, CSWeaponID:id, bool:defaultprice = false);
/**
* Gets a clients clan tag
@@ -225,7 +225,7 @@ native CS_DropWeapon(client, weaponIndex, bool:toss, bool:blockhook = false);
*
* @error Invalid client.
*/
native CS_GetClientClanTag(client, String:buffer[], size);
native CS_GetClientClanTag(client, String:buffer[], size);
/**
* Sets a clients clan tag
@@ -235,7 +235,7 @@ native CS_DropWeapon(client, weaponIndex, bool:toss, bool:blockhook = false);
*
* @error Invalid client.
*/
native CS_SetClientClanTag(client, const String:tag[]);
native CS_SetClientClanTag(client, const String:tag[]);
/**
* Do not edit below this line!
+1 -1
View File
@@ -263,7 +263,7 @@ stock Float:operator--(Float:oper)
stock Float:operator-(Float:oper)
{
return oper^Float:((-1)^((-1)/2)); /* IEEE values are sign/magnitude */
return oper^Float:cellmin; /* IEEE values are sign/magnitude */
}
stock Float:operator*(Float:oper1, oper2)
+8
View File
@@ -41,6 +41,7 @@
#define SOURCE_SDK_EPISODE1 20 /**< SDK+Engine released after Episode 1 */
#define SOURCE_SDK_EPISODE2 30 /**< SDK+Engine released after Episode 2/Orange Box */
#define SOURCE_SDK_BLOODYGOODTIME 32 /**< Modified version of ep2 engine used by Bloody Good Time (no SDK) */
#define SOURCE_SDK_EYE 33 /**< Modified version of ep2 engine used by E.Y.E Divine Cybermancy (no SDK) */
#define SOURCE_SDK_EPISODE2VALVE 35 /**< SDK+Engine released after Episode 2/Orange Box */
#define SOURCE_SDK_LEFT4DEAD 40 /**< Engine released after Left 4 Dead (no SDK yet) */
#define SOURCE_SDK_LEFT4DEAD2 50 /**< Engine released after Left 4 Dead 2 (no SDK yet) */
@@ -126,6 +127,13 @@ native Float:GetEngineTime();
*/
native Float:GetGameTime();
/**
* Returns the game's internal tick count.
*
* @return Game tick count.
*/
native GetGameTickCount();
/**
* Returns the game description from the mod.
*
+12 -2
View File
@@ -404,6 +404,16 @@ native bool:GetMenuExitBackButton(Handle:menu);
*/
native SetMenuExitBackButton(Handle:menu, bool:button);
/**
* Sets whether or not the menu has a "no vote" button in slot 1.
* By default, menus do not have a no vote button.
*
* @param menu Menu Handle.
* @param button True to enable the button, false to remove it.
* @return True if allowed; false on failure.
* @error Invalid Handle.
*/
native bool:SetMenuNoVoteButton(Handle:menu, bool:button);
/**
* Cancels a menu from displaying on all clients. While the
@@ -489,14 +499,14 @@ native bool:VoteMenu(Handle:menu, clients[], numClients, time, flags=0);
* in progress.
* @error Invalid Handle.
*/
stock VoteMenuToAll(Handle:menu, time, flags=0)
stock bool:VoteMenuToAll(Handle:menu, time, flags=0)
{
new total;
decl players[MaxClients];
for (new i=1; i<=MaxClients; i++)
{
if (!IsClientInGame(i))
if (!IsClientInGame(i) || IsFakeClient(i))
{
continue;
}
+3
View File
@@ -66,6 +66,9 @@ enum RoundState {
//Game is over, doing bonus round stuff
RoundState_Bonus,
//Between rounds
RoundState_BetweenRounds,
};
/**
+35 -9
View File
@@ -109,20 +109,39 @@ enum TFCond
TFCond_NoHealingDamageBuff,
TFCond_SpeedBuffAlly,
TFCond_HalloweenCritCandy,
TFCond_CritCanteen,
TFCond_CritHype = 36,
TFCond_CritOnFirstBlood,
TFCond_CritOnWin,
TFCond_CritOnFlagCapture,
TFCond_CritOnKill,
TFCond_RestrictToMelee
TFCond_RestrictToMelee,
TFCond_Reprogrammed = 43,
TFCond_CritMmmph,
TFCond_DefenseBuffMmmph,
TFCond_FocusBuff,
TFCond_DisguiseRemoved,
TFCond_MarkedForDeathSilent,
TFCond_DisguisedAsDispenser,
TFCond_Sapped,
TFCond_UberchargedHidden,
TFCond_UberchargedCanteen,
TFCond_HalloweenBombHead,
TFCond_HalloweenThriller,
};
enum TFHoliday
{
TFHoliday_None = 1,
TFHoliday_Birthday = 1,
TFHoliday_Halloween,
TFHoliday_Birthday
TFHoliday_Christmas,
TFHoliday_ValentinesDay,
TFHoliday_MeetThePyro,
TFHoliday_FullMoon,
TFHoliday_HalloweenOrFullMoon,
TFHoliday_HalloweenOrFullMoonOrValentines,
};
enum TFObjectType
@@ -278,15 +297,22 @@ native TFClassType:TF2_GetClass(const String:classname[]);
forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result);
/**
* Called when the game checks to see if the current day is one of its tracked holidays
*
* @note Change the value of holiday and return Plugin_Changed to override.
* Return Plugin_Continue for no change.
*
* @param holiday Current Holiday
* @deprecated No longer called. Use TF2_OnIsHolidayActive.
*/
#pragma deprecated No longer called. Use TF2_OnIsHolidayActive.
forward Action:TF2_OnGetHoliday(&TFHoliday:holiday);
/**
* Called at various times when the game checks to see if the given holiday is active.
* Return Plugin_Continue to let the original calculation or return a higher
* action to override the decision with the value of 'result'
*
* @param holiday Holiday being checked.
* @param result Buffer param for the result of the decision.
* @return Plugin_Continue for original calculation, higher value to use 'result'.
*/
forward Action:TF2_OnIsHolidayActive(TFHoliday:holiday, &bool:result);
/**
* Returns whether or not a client (Player) is in a duel.
*
+16
View File
@@ -78,6 +78,7 @@
#define TF_DEATHFLAG_DEADRINGER (1 << 5)
#define TF_DEATHFLAG_INTERRUPTED (1 << 6)
#define TF_DEATHFLAG_GIBBED (1 << 7)
#define TF_DEATHFLAG_PURGATORY (1 << 8)
// Custom kill identifiers for the customkill property on the player_death event
enum {
@@ -130,6 +131,13 @@ enum {
TF_CUSTOM_PLASMA_CHARGED,
TF_CUSTOM_PLASMA_GIB,
TF_CUSTOM_PRACTICE_STICKY,
TF_CUSTOM_EYEBALL_ROCKET,
TF_CUSTOM_HEADSHOT_DECAPITATION,
TF_CUSTOM_TAUNT_ARMAGEDDON,
TF_CUSTOM_FLARE_PELLET,
TF_CUSTOM_CLEAVER,
TF_CUSTOM_CLEAVER_CRIT,
TF_CUSTOM_SAPPER_RECORDER_DEATH,
};
// Weapon codes as used in some events, such as player_death
@@ -216,6 +224,14 @@ enum {
TF_WEAPON_RAYGUN,
TF_WEAPON_PARTICLE_CANNON,
TF_WEAPON_MECHANICAL_ARM,
TF_WEAPON_DRG_POMSON,
TF_WEAPON_BAT_GIFTWRAP,
TF_WEAPON_GRENADE_ORNAMENT,
TF_WEAPON_RAYGUN_REVENGE,
TF_WEAPON_PEP_BRAWLER_BLASTER,
TF_WEAPON_CLEAVER,
TF_WEAPON_GRENADE_CLEAVER,
TF_WEAPON_ROCKETPACK,
};
// TF2 Weapon Slots for GetPlayerWeaponSlot
+2 -2
View File
@@ -37,6 +37,6 @@
#define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */
#define SOURCEMOD_V_MINOR 4 /**< SourceMod Minor version */
#define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */
#define SOURCEMOD_V_RELEASE 7 /**< SourceMod Release version */
#define SOURCEMOD_VERSION "1.4.0-dev" /**< SourceMod version string (major.minor.release.build) */
#define SOURCEMOD_VERSION "1.4.7" /**< SourceMod version string (major.minor.release.build) */
+3
View File
@@ -86,6 +86,9 @@ public OnPluginStart()
{
for (new i = 1; i <= MaxClients; i++)
{
if (!IsClientConnected(i))
continue;
if (IsClientSourceTV(i))
{
g_SourceTV = i;
+1 -1
View File
@@ -1 +1 @@
1.4.0-dev
1.4.7
+9 -1
View File
@@ -40,12 +40,13 @@
*/
#define SMINTERFACE_GAMEHELPERS_NAME "IGameHelpers"
#define SMINTERFACE_GAMEHELPERS_VERSION 7
#define SMINTERFACE_GAMEHELPERS_VERSION 8
class CBaseEntity;
class CBaseHandle;
class SendProp;
class ServerClass;
class ICommandLine;
struct edict_t;
struct datamap_t;
struct typedescription_t;
@@ -284,6 +285,13 @@ namespace SourceMod
* @return True on success, false on failure.
*/
virtual bool HintTextMsg(int client, const char *msg) =0;
/**
* @brief Retrieves the Valve command line pointer.
*
* @return ICommandLine ptr or NULL if not found.
*/
virtual ICommandLine *GetValveCommandLine() =0;
};
}
+3
View File
@@ -191,6 +191,9 @@ bool SDKExtension::OnExtensionLoad(IExtension *me, IShareSys *sys, char *error,
#if defined SMEXT_ENABLE_TRANSLATOR
SM_GET_IFACE(TRANSLATOR, translator);
#endif
#if defined SMEXT_ENABLE_NINVOKE
SM_GET_IFACE(NINVOKE, ninvoke);
#endif
#if defined SMEXT_ENABLE_ROOTCONSOLEMENU
SM_GET_IFACE(ROOTCONSOLE, rootconsole);
#endif
+15 -1
View File
@@ -40,7 +40,7 @@
/** SourcePawn Engine API Version */
#define SOURCEPAWN_ENGINE_API_VERSION 4
#define SOURCEPAWN_ENGINE2_API_VERSION 3
#define SOURCEPAWN_ENGINE2_API_VERSION 4
#if !defined SOURCEMOD_BUILD
#define SOURCEMOD_BUILD
@@ -479,6 +479,20 @@ namespace SourcePawn
* @return Memory usage, in bytes.
*/
virtual size_t GetMemUsage() =0;
/**
* @brief Returns the MD5 hash of the plugin's P-Code.
*
* @return 16-byte buffer with MD5 hash of the plugin's P-Code.
*/
virtual unsigned char *GetCodeHash() =0;
/**
* @brief Returns the MD5 hash of the plugin's Data.
*
* @return 16-byte buffer with MD5 hash of the plugin's Data.
*/
virtual unsigned char *GetDataHash() =0;
};
/**
+4 -2
View File
@@ -20,7 +20,7 @@ Pants will save us from certain death.
Invaders' blood marches through my veins, like GIANT RADIOACTIVE RUBBER PANTS!
THE PANTS COMMAND COMMAND ME! DO NOT IGNORE MY VEINS.
This file sure has gotten big.
sawce loves anime, sushi, and macs
applesawce loves anime, sushi, and macs
u
not me
skull man was here
@@ -34,7 +34,7 @@ On The Patty Winters Show this morning were descendants of members of the Donner
Everything outside of this is like a movie I once saw.
THIS IS NOT AN EXIT.
ABANDON ALL HOPE YE WHO ENTER HERE.
egg!
egg!!
blimey
crab
jibbly jibbly jibbly
@@ -51,3 +51,5 @@ clobstermonkey
that thing
clobber build because amx.h changed (sigh)
a dead fish
BuildBot is very well-written, stable, enterprise software.
I'm on a plane.
+1 -1
View File
@@ -16,7 +16,7 @@ elif compiler.cc.name == 'msvc':
compiler['POSTLINKFLAGS'].append('/SUBSYSTEM:CONSOLE')
if AMBuild.target['platform'] == 'linux':
compiler['CDEFINES'].extend(['LINUX', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC'])
compiler['CDEFINES'].extend(['LINUX', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC', '_GNU_SOURCE'])
elif AMBuild.target['platform'] == 'darwin':
compiler['CDEFINES'].extend(['DARWIN', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC'])
+1 -1
View File
@@ -30,7 +30,7 @@ LINK = -lgcc -static-libgcc
INCLUDE = -I. -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
CFLAGS += -DLINUX -DHAVE_STDINT_H -DAMX_ANSIONLY -DENABLE_BINRELOC -Dstricmp=strcasecmp -m32
CFLAGS += -D_GNU_SOURCE -Wall -Werror -Wno-uninitialized -Wno-unused-result -Wno-unused -Wno-switch -Wno-parentheses -Wno-format -DLINUX -DHAVE_STDINT_H -DAMX_ANSIONLY -DENABLE_BINRELOC -Dstricmp=strcasecmp -m32
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
################################################
+1 -1
View File
@@ -2923,7 +2923,7 @@ static cell initvector(int ident,int tag,cell size,int fillzero,
matchbrace=matchtoken('{');
for ( ;; ) {
prev2=prev1;
prev1=init(iVARIABLE,&ctag,errorfound);
prev1=init(ident,&ctag,errorfound);
if (!matchbrace)
break;
if ((ellips=matchtoken(tELLIPS))!=0)
+1 -1
View File
@@ -59,7 +59,7 @@ static short skiplevel; /* level at which we started skipping (including nested
static unsigned char term_expr[] = "";
static int listline=-1; /* "current line" for the list file */
#if defined __GNUC__
#if defined DARWIN
static double pow10(double d)
{
return pow(10, d);
+1
View File
@@ -36,6 +36,7 @@ binary.AddSourceFiles('sourcepawn/jit', [
'zlib/trees.c',
'zlib/uncompr.c',
'zlib/zutil.c',
'md5/md5.cpp',
'../../knight/shared/KeCodeAllocator.cpp'
])
SM.AutoVersion('sourcepawn/jit', binary)
+30 -1
View File
@@ -8,6 +8,8 @@
#include "sp_vm_basecontext.h"
#include "engine2.h"
#include "md5/md5.h"
using namespace SourcePawn;
BaseRuntime::BaseRuntime() : m_Debug(&m_plugin), m_pPlugin(&m_plugin), m_pCtx(NULL),
@@ -18,6 +20,9 @@ m_PubFuncs(NULL), m_PubJitFuncs(NULL), m_pCo(NULL), m_CompSerial(0)
m_FuncCache = NULL;
m_MaxFuncs = 0;
m_NumFuncs = 0;
memset(m_CodeHash, 0, sizeof(m_CodeHash));
memset(m_DataHash, 0, sizeof(m_DataHash));
}
BaseRuntime::~BaseRuntime()
@@ -214,7 +219,11 @@ int BaseRuntime::CreateFromMemory(sp_file_hdr_t *hdr, uint8_t *base)
return SP_ERROR_FILE_FORMAT;
}
if ((plugin->flags & SP_FLAG_DEBUG) && (!(plugin->debug.files) || !(plugin->debug.lines) || !(plugin->debug.symbols)))
if ((plugin->flags & SP_FLAG_DEBUG) && (
!(plugin->debug.files) ||
!(plugin->debug.lines) ||
!(plugin->debug.symbols) ||
!(plugin->debug.stringbase) ))
{
return SP_ERROR_FILE_FORMAT;
}
@@ -227,6 +236,16 @@ int BaseRuntime::CreateFromMemory(sp_file_hdr_t *hdr, uint8_t *base)
memset(m_PubJitFuncs, 0, sizeof(JitFunction *) * m_pPlugin->num_publics);
}
MD5 md5_pcode;
md5_pcode.update(plugin->pcode, plugin->pcode_size);
md5_pcode.finalize();
md5_pcode.raw_digest(m_CodeHash);
MD5 md5_data;
md5_data.update(plugin->data, plugin->data_size);
md5_data.finalize();
md5_data.raw_digest(m_DataHash);
m_pPlugin->profiler = g_engine2.GetProfiler();
m_pCtx = new BaseContext(this);
m_pCo = g_Jit.StartCompilation(this);
@@ -483,6 +502,16 @@ size_t BaseRuntime::GetMemUsage()
return mem;
}
unsigned char *BaseRuntime::GetCodeHash()
{
return m_CodeHash;
}
unsigned char *BaseRuntime::GetDataHash()
{
return m_DataHash;
}
BaseContext *BaseRuntime::GetBaseContext()
{
return m_pCtx;
+5
View File
@@ -48,6 +48,8 @@ public:
virtual void SetPauseState(bool paused);
virtual bool IsPaused();
virtual size_t GetMemUsage();
virtual unsigned char *GetCodeHash();
virtual unsigned char *GetDataHash();
JitFunction *GetJittedFunction(uint32_t idx);
uint32_t AddJittedFunction(JitFunction *fn);
public:
@@ -65,6 +67,9 @@ public:
JitFunction **m_PubJitFuncs;
ICompilation *m_pCo;
unsigned int m_CompSerial;
unsigned char m_CodeHash[16];
unsigned char m_DataHash[16];
};
#endif //_INCLUDE_SOURCEPAWN_JIT_RUNTIME_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);
};

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