Compare 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
Nicholas Hastings 4d54bfa6b4 Preemptive gamedata update for tonight's TF2 update. 2011-10-27 20:28:26 -04:00
Nicholas Hastings 28d1dab18a Small fixes to reservedslots, including ep2v Replay/SourceTV fix (bug 5094, r=fyren). 2011-10-20 21:42:18 -04:00
Nicholas Hastings f3d19a860a Added detection of Replay and SourceTV, and natives to query (bug 5124, r=fyren). 2011-10-20 21:39:57 -04:00
Nicholas Hastings 5732e34f50 Added check for element in Get/SetEntProp funcs >= 0 (bug 5141, r=fyren). 2011-10-20 21:35:50 -04:00
Asher Baker ca94a61acf Fixed ServerCommandEx native appending to buffer instead of overwriting (bug 5047, r=fyren). 2011-10-17 11:02:42 -04:00
Brian Simon a875c61b5f Added RootConsoleMenu iface support to sample ext (bug 5021, r=psychonic). 2011-10-17 10:55:44 -04:00
David Anderson 5ec70c9e0d Fixed shutdown bug in SDKTools (created EntOutputMgr shutdown func) (bug 5063, r=fyren). 2011-10-17 10:47:13 -04:00
GoD-Tony 4b0373408d Moved client language detection to be earlier (on connect) (bug 3714, r=psychonic). 2011-10-15 12:07:55 -04:00
Nicholas Hastings 7f8c4eff39 Updated GMod gamedata. 2011-10-14 15:21:12 -04:00
Don 00f152910b Added native to clientprefs to alter data on a disconnected player (bug 3882, r=pred). 2011-10-14 11:28:53 -04:00
Nicholas Hastings 95fdeb03c3 Move marking of mapstarted to before calling of map start notifs. (bug 5119, r=asherkin). 2011-10-14 09:25:42 -04:00
Nicholas Hastings 66e9ef9cf6 Updated HL2DM and DOD:S gamedata. 2011-10-13 20:06:40 -04:00
Peace-Maker 6b3221f1da Updated CS:S gamedata. 2011-10-13 19:15:02 -04:00
GoD-Tony 25ad7bcf5e Updated TF2 gamedata for today's update. 2011-10-13 18:31:24 -04:00
GoD-Tony 9a04a6bdb1 Added optional autoload of sdktools to cstrike ext.(bug 5125, r=psychonic). 2011-10-13 13:17:37 -04:00
Nicholas Hastings 1b9fb906e2 Added CS_GetClanTag and CS_SetClanTag natives to cstrike ext (bug 5122, r=fyren). 2011-10-13 13:17:29 -04:00
Nicholas Hastings e23d7ca51b Added TextMsg destination constants to IGameHelpers header (bug 5123, r=fyren). 2011-10-13 13:17:22 -04:00
Fyren 92773c2e1b Fixed client serials not getting cleared on disconnect (bug 5121, r=psychonic). 2011-10-12 00:51:58 -04:00
Nicholas Hastings 776889cfbb Removed error when optional ext dep is missing (bug 5112, r=fyren). 2011-10-11 22:51:24 -04:00
Nicholas Hastings 67163e14e6 Added checks to avoid crashing in some natives before map start (bug 5119, r=fyren). 2011-10-11 22:50:21 -04:00
Nicholas Hastings 45f68840ed Fixed multiple small issues with KickClient/Ex natives (bug 5120, r=fyren). 2011-10-11 19:50:53 -04:00
Nicholas Hastings 325ae5e977 Added better Nuclear Dawn compatibility to base plugins (bug 5117, r=fyren). 2011-10-11 19:47:20 -04:00
Nicholas Hastings 14919c65d9 Fixed wrong values for unsigned, >= 16-bit props in GetEntProp (bug 5105, r=fyren). 2011-10-11 19:41:56 -04:00
Nicholas Hastings 8888e88dc4 Updated tf2 inc files with more condition and custom dmg defs (bug 5118, r=asherkin). 2011-10-10 21:44:36 -04:00
javalia 0533664f90 Removed non-existant param from SetTrieString function doc (bug 5108, r=dvander). 2011-10-10 16:02:44 -04:00
Peace-Maker 64b824f457 Added gamedata for HL2CTF (bug 5114, r=psychonic). 2011-10-10 15:59:48 -04:00
Nicholas Hastings b6592d799f Updated Nuclear Dawn gamedata to use ShowMenu (now works). 2011-09-26 13:54:17 -04:00
Drifter c89711a863 Updated cstrike ext WeaponPrice offset. 2011-09-20 16:21:17 -04:00
Drifter 91a1292b12 Updated cstrike ext gamedata. 2011-09-16 11:36:37 -04:00
Paul Clothier b2d469cb84 Updated TF2 SetPowerplayEnabled gamedata (bug 5095, r=psychonic). 2011-09-15 18:43:33 -04:00
Nicholas Hastings 4f41da34c6 Merge. 2011-09-10 12:10:05 -04:00
Nicholas Hastings f136f2dcaf Added CheckAccess native to check cmd/override access of AdminId (bug 5083, r=fyren). 2011-09-10 12:08:38 -04:00
Reuben Morais e6df54537a Changed build system so that it no longer requires all SDKs to be available (bug 5023, r=ds). 2011-09-09 18:37:09 -05:00
Nicholas Hastings e62278859e Validate ent index bounds in LookupEntity (bug 5080, r=fyren). 2011-09-09 15:29:17 -04:00
Peace-Maker 51b91bce6d Updated Nuclear Dawn gamedata. 2011-09-08 19:59:09 -04:00
Nicholas Hastings d96a23d4f2 Fixed build. 2011-09-03 14:23:46 -04:00
javalia 98e049b336 Added GetDistGainFromSoundLevel native to SDKTools (bug 5066, r=dvander). 2011-09-03 14:18:08 -04:00
FlaminSarge 3c297f5d1d Fixed typo in tf2_stocks (persistant -> persistent) (bug 5074, r=psychonic). 2011-09-03 14:11:38 -04:00
FlaminSarge d64d196409 Fixed mixup of arrow stab and telefrag defs in tf2_stocks (bug 5074, r=psychonic). 2011-09-03 14:10:24 -04:00
Nicholas Hastings b1638e79c0 Added missing clientnatives files to sdktools proj file (NPOTB). 2011-08-29 13:55:11 -04:00
Nicholas Hastings 13753757d4 Fixed error in sdktools msvc10 proj file (NPOTB). 2011-08-28 16:18:48 -04:00
Nicholas Hastings 739e341218 Fixed Nuclear Dawn menus. 2011-08-25 13:58:12 -04:00
Nicholas Hastings fda282604d Added gamedata support for Nuclear Dawn. 2011-08-25 13:20:26 -04:00
Fyren 2cd7fa68d6 Reshove. 2011-08-20 16:45:44 -07:00
Fyren d78a0c87b8 Backed out changeset 42462959f48d 2011-08-20 16:44:16 -07:00
Fyren 88d4abeaf8 Shove. 2011-08-20 16:41:14 -07:00
Nicholas Hastings 1c0abbfce6 Partially fixed build. 2011-08-20 19:21:27 -04:00
Nicholas Hastings 1492e12ca2 Added support for E.Y.E Divine Cybermancy (bug 5035, r=fyren). 2011-08-20 18:58:37 -04:00
Nicholas Hastings 2b9a39e2eb Updated Fortress Forever gamedata to include support for newer features. 2011-08-20 13:25:38 -04:00
Nicholas Hastings 301ae447b4 Added more new TF2 weapon and custom damage defs (bug 5055, r=asherkin). 2011-08-20 13:25:07 -04:00
Asher Baker 3d47010cbd Fail to load a metamod-enabled extension if it refuses to attach to MM:S (bug 5042, r=dvander). 2011-08-15 20:19:07 +01:00
Asher Baker dd0ff999e4 Backed out changeset: 602945928c23 2011-08-15 20:06:14 +01:00
Asher Baker 05e5c93e91 Fail to load a metamod-enabled extension if it refuses to attach to MM:S (bug 5042, r=dvander). 2011-08-15 19:30:56 +01:00
Asher Baker 1bd97730ce Added a reset argument to 'sm cvars' (bug 5043, r=psychonic). 2011-08-14 21:42:32 +01:00
Fyren 458378be66 Let logic binary access ServerLang value on startup (bug 4675, r=dvander). 2011-07-24 19:52:22 -07:00
David Anderson c01101dbd0 Fix build. 2011-07-24 19:44:15 -07:00
Michael (LumiStance) f7364111f2 Fix corner cases with ExplodeString (bug 4629, r=dvander).
--HG--
extra : rebase_source : ebb338bc93d32544e66c16fcba4494d5eae7ee8e
2011-07-24 19:30:15 -07:00
Nicholas Hastings f3b84b8670 Added gamedata for International Online Soccer: Source (bug 5019). 2011-07-22 13:48:34 -04:00
Asher Baker ec11a31d9d Updated sm_rcon to use new ServerCommandEx native (bug 5018, r=ds). 2011-07-18 03:25:01 +01:00
Asher Baker 2271469d1b Added ServerCommandEx native to get the response when running a command (bug 3873, r=ds). 2011-07-18 03:23:03 +01:00
Asher Baker 7fe92d87c2 Added missing brackets back to l4d and l4d2 gamedata (bug 5016, r=psychonic). 2011-07-16 17:55:43 -04:00
Drifter 6046b8fb79 Fixed CS_GetWeaponPrice for some weapon (bug 4994, r=psychonic). 2011-07-14 12:57:18 -04:00
FlaminSarge a65239a8af Added defines for more new TF2 conditions to tf2.inc (bug 5000, r=psychonic). 2011-07-14 12:53:05 -04:00
Nicholas Hastings 746cd5f49c Merge. 2011-07-12 20:07:51 -04:00
Nicholas Hastings 75c315ad8a Fixed maxClients not being updated correctly in some cases/areas (bug 4986, r=fyren). 2011-07-12 20:06:08 -04:00
Nicholas Hastings c1926c6e25 Added FireOutput gamedata support for The Hidden. 2011-07-12 19:58:37 -04:00
Nicholas Hastings 3f8ba353b7 Updated Fistful of Frags gamedata for FoF 3.6 release. 2011-07-12 19:58:30 -04:00
Nicholas Hastings 39a2152a46 Reverted FindEntityByClassname gamedata obliteration from 7aea1316eff7 per bug 4963. 2011-07-12 19:58:16 -04:00
Nicholas Hastings ddd967534b Sped up native impl. of FindEntityByClassname (bug 4963, r=fyren). 2011-07-12 19:48:28 -04:00
Fyren 4d52fe0490 Revert 3336, try fix #2 (bug 4852, r=dvander) 2011-07-09 20:47:43 -07:00
Nicholas Hastings 264ffa80ce Backed out changeset: b5969264060e 2011-07-08 07:55:20 -04:00
Nicholas Hastings 258a9c636a Backed out changeset: 049c7073d1a4 2011-07-08 07:54:21 -04:00
Nicholas Hastings 8015d1827c Backed out changeset: 9007dacc012d 2011-07-08 07:53:31 -04:00
Nicholas Hastings ae10bc6601 Backed out changeset: 344daca49587 2011-07-08 07:53:14 -04:00
Nicholas Hastings 51c27afcd2 Fixed more crashes related to early, nonzero maxclients (bug 5008, r=dvander). 2011-07-07 21:31:07 -04:00
Nicholas Hastings e09d4f2cf2 Merge. 2011-07-07 19:53:56 -04:00
Nicholas Hastings 7e87f56699 Fixed nonzero maxClients startup crash in SDKTools (bug 5010, r=bee). 2011-07-07 19:51:05 -04:00
Scott Ehlert ca9150a731 Triggering build, ugh. 2011-07-07 11:25:00 -05:00
Nicholas Hastings 5250d819d0 Triggering a build, hoping for luck. 2011-07-07 09:27:24 -04:00
Nicholas Hastings d93413a4ae Fixed use of m_Players before init'd in PlayerManager (bug 5008, r=dvander). 2011-07-06 22:34:23 -04:00
Nicholas Hastings bb7f7eff51 Added native interface for Basecomm plugin (bug 2594, r=fyren). 2011-07-06 22:34:21 -04:00
Brian Simon 838e8c7b35 Added InactivateClient and ReconnectClient natives to SDKTools (bug 4931, r=fyren). 2011-07-06 18:11:02 -04:00
David Anderson bb48a16466 Fix compiler creating bogus arrays when missing a dimension (bug 4902, r=fyren). 2011-07-06 17:56:40 -04:00
David Anderson a02ff01d84 Prevent declaring arrays that the compiler is too buggy to handle (bug 4977, r=fyren). 2011-07-06 17:56:03 -04:00
David Anderson 66d27d6ac5 Fix return omission with else-after-return (bug 4852, r=fyren). 2011-07-06 17:55:14 -04:00
Nicholas Hastings 5ba82ef0fc Removed maxClients caching in core (bug 5007, bug 4986, r=fyren). 2011-07-06 17:50:37 -04:00
David Anderson 053b522aff Fixed some vars not being marked for init on first compile pass (bug 4643, r=fyren). 2011-07-06 17:50:26 -04:00
Nicholas Hastings 4521f80e5a Added ability in SDKTools to get/set prop values on gamerules class (bug 4983, r=fyren). 2011-07-06 17:37:35 -04:00
Nicholas Hastings f24efc17c1 Fixed TF2 OnConditionAdded/Removed forwards to catch all cases (bug 4982, r=fyren). 2011-07-06 17:37:35 -04:00
Nicholas Hastings f32d3849e5 Merge. 2011-07-06 15:30:19 -04:00
Michael Busby f2fb064ea6 Fixed typo in GetEntDataFloat function doc (bug 4993, r=psychonic). 2011-07-06 15:27:41 -04:00
Nicholas Hastings ce5093f91f BaseComm now uses CommandListeners for chat hooks (bug 4991, r=fyren). 2011-07-06 15:24:43 -04:00
David Anderson 75121588c4 Clobber 2011-07-04 15:33:11 -07:00
javalia 1ff0f478d4 Increase symbol name limit to 63 characters (bug 4564, r=dvander). 2011-07-04 15:26:08 -07:00
David Anderson 6c68082359 Fix crash when dynamic arrays run out of memory (bug 4632, r=fyren). 2011-07-04 01:57:19 -07:00
David Anderson a752d220cc Use active, not passive FTP. 2011-06-29 16:05:18 -07:00
Drifter ee1bbd5994 Added new CS_GetWeaponPrice native to cstrike extension (bug 4985, r=psychonic). 2011-06-28 20:32:55 -04:00
Michael Busby 91368e5656 Fixed typo in keyvalues.inc doc (bug 4990, r=psychonic). 2011-06-28 20:26:40 -04:00
Drifter c4c554b420 Added some small fixes for new CStrike patch (2ddc75e24c53) (bug 4732, r=psychonic). 2011-06-28 20:16:05 -04:00
Nicholas Hastings 52ec8bf049 Fixed build. 2011-06-27 09:35:38 -04:00
Nicholas Hastings 5c40e02ee6 Added support for gamedata lookups from matchmaking_ds lib (bug 4158, r=Fyren). 2011-06-27 09:30:52 -04:00
Nicholas Hastings d2a89c5856 Added gamedata for TF2 SetInWaitingForPlayers (bug 4704). 2011-06-27 08:29:11 -04:00
Nicholas Hastings 9ec3f1b89d Fixed TF2_RemoveCondition not always removing conditions (bug 4981, r=asherkin). 2011-06-26 21:00:03 -04:00
Nicholas Hastings 3ab81c764d Added more TF2 condition defines (bug 4979, r=asherkin). 2011-06-26 20:55:18 -04:00
Nicholas Hastings c072ce8f0c Fixed TF2 RemoveCondition gamedata. 2011-06-26 18:10:29 -04:00
Nicholas Hastings e44dbd0e77 Merge. 2011-06-26 18:09:55 -04:00
Nicholas Hastings ec12022550 Added msvc10 project files for TF2 ext (NPOTB). 2011-06-26 10:54:12 -04:00
Drifer e0f670499c Add a number of useful forwards and natives to the cstrike extension (bug 4732, r=fyren). 2011-06-26 01:25:42 -07:00
David Anderson 177cc87985 Doc improvement. 2011-06-25 15:31:11 -07:00
David Anderson 3e387f35e9 Updated credits. 2011-06-25 15:26:09 -07:00
Nicholas Hastings 7037723993 Fixed TF2 identifiers and condition stocks (bug 4974, r=me). 2011-06-24 19:45:16 -04:00
Scott Ehlert b1098d6287 Using gcc 4.4 from Debian 6 for Linux builds now. 2011-06-24 17:29:05 -05:00
Nicholas Hastings be222a16ce Updated TF2 identifiers and condition stocks. 2011-06-24 02:01:03 -04:00
Nicholas Hastings 17f9a3eba6 Updated TF2 gamedata. 2011-06-24 00:53:17 -04:00
Scott Ehlert 0ee77c0e7d Triggering a build. 2011-06-23 21:21:27 -05:00
Nicholas Hastings b92fa45da7 Triggering build. 2011-06-23 19:14:58 -04:00
Nicholas Hastings e64c2fc110 Triggering build. 2011-06-23 18:09:31 -04:00
Nicholas Hastings 49a6508888 Added msvc10 project for SDKTools (NPOTB). 2011-06-22 09:46:56 -04:00
David Anderson 859678536f Fixed crash on plugin unload when two cmds exist with same name, different casing (bug 4698, r=Fyren). 2011-06-20 13:30:14 -04:00
Nicholas Hastings 9a5f788807 Normalized line endings in IGameHelpers.h to appease FYREN. 2011-06-18 14:36:20 -04:00
Nicholas Hastings 84b3b1d29c Added HintTextMsg to IGameHelpers (bug 4950, r=Fyren). 2011-06-18 14:34:17 -04:00
Nicholas Hastings 80eb18a425 Moved GetEntityClassname to end of entity.inc to fix plugin compile errors (bug 4798). 2011-06-18 14:31:46 -04:00
Scott Ehlert 3e1ab53abd Fixed clang OS X build. 2011-06-17 18:21:17 -05:00
Scott Ehlert 18c119b4d5 Removed -static-libgcc for Mac OS X build (no bug, r=dvander).
This fixes the ld warning: could not create compact unwind for __Unwind_Resume: non-standard register 0 being saved in prolog
2011-06-17 18:00:32 -05:00
Nicholas Hastings e67a65c0db Fixed build. 2011-06-16 15:59:27 -04:00
Scott Ehlert 4c878c4963 Fixed crash in MemoryUtils::ResolveSymbol() on OS X Lion (10.7) (bug 4951, r=dvander). 2011-06-15 16:02:05 -05:00
Nicholas Hastings e8fbe0f36c Fixed uninit'ed string and other minor issues in basetriggers (bug 4945, r=fyren). 2011-06-05 23:13:25 -04:00
Nicholas Hastings 243b7e25f8 Added array element selection with Get/SetEntProp* on arrays (bug 4160, r=fyren). 2011-06-05 21:52:36 -04:00
John Schoenick f1a4a08c7f Fixed regression in FindEntityByClassname from bug 4899 (bug 4941, r=predcrab). 2011-06-01 20:36:16 -04:00
Fyren c0fa36b9a1 Added support for language aliases (bug 4858, r=dvander). 2011-05-25 21:10:18 -04:00
Nicholas Hastings 835b2d7ced Slight ep1 gamedata cleanup. 2011-05-25 20:56:30 -04:00
Nicholas Hastings 13c2381ba7 Added gamedata for Eternal Silence (bug 4880). 2011-05-25 20:50:51 -04:00
Fyren fbc8e899dd Forcing build. 2011-05-25 13:57:17 -04:00
Nicholas Hastings 5ee8c8ce91 Backed out changeset: a7a73225f8ee 2011-05-25 13:56:34 -04:00
Nicholas Hastings 971793d6a1 Backed out changeset: 065beec73902 2011-05-25 13:56:13 -04:00
Nicholas Hastings 9d7a905fb1 Backed out changeset: 65eb3df32b1c 2011-05-25 13:31:14 -04:00
Nicholas Hastings 731f002175 Backed out changeset: abe4ce9d3e0e 2011-05-25 13:30:40 -04:00
Nicholas Hastings 7e6f3bfd83 Adjusting the proper set of flags this time. 2011-05-25 11:25:20 -04:00
Nicholas Hastings 3e14739b29 Attempting to fix SDKTools build. 2011-05-25 11:21:16 -04:00
Nicholas Hastings d7fb6b2892 Fixed invalid client errors from late-load of SourceTV (bug 4881, r=fyren). 2011-05-25 08:31:12 -04:00
Nicholas Hastings 7527f441ae Switched to using IServerTools in SDKTools where possible. (bug 4899, r=fyren). 2011-05-25 08:27:27 -04:00
Nicholas Hastings 5228ee1d91 Updated garrysmod gamedata. 2011-05-24 20:36:09 -04:00
Nicholas Hastings 297a98e065 Handle leak notice now prints to error log (as well as fatal) (bug 4929, r=dvander). 2011-05-24 18:37:45 -04:00
Nicholas Hastings 727d8afd94 Updated core msvc10 proj file (no smn_profiler) (NPOTB). 2011-05-24 18:35:09 -04:00
Nicholas Hastings c292fba3df Updated core msvc9 proj file (engine defs, -smn_profiler, mms17 -> mms18) (NPOTB). 2011-05-24 18:34:45 -04:00
Nicholas Hastings 9954ff55f5 Added msvc10 project file for sm logic. (NPOTB). 2011-05-24 14:21:24 -04:00
Fyren fefd84d431 Translator now properly falls back on bad server language (bug 4861, r=dvander). 2011-05-24 13:25:28 -04:00
Fyren b4a7d21b9e Removed compiler double include check (bug 4863, r=dvander). 2011-05-24 10:49:40 -04:00
Nicholas Hastings d03e051611 Fixed var names and docs for TF2_MakeBleed native (bug 4928, r=fyren). 2011-05-24 10:17:48 -04:00
John Schoenick e8c141d775 Make SQL_LastInsertId and SQL_GetAffectedRows work on query handles, allowing their use with threaded queries 2011-05-14 20:21:37 -07:00
David Anderson 5b45e29533 Move profile natives to logic, add linux support (bug 4927, r=ds). 2011-05-22 02:04:34 -07:00
FlaminSarge 024d094459 Added TF2 megaheal cond defines to tf2 incs (bug 4916, r=psychonic). 2011-05-12 11:33:50 -04:00
Gareth Clarke df977577e2 Updated ep2v SetUserCvar gamedata (bug 4904). 2011-05-06 08:07:40 -04:00
Scott Ehlert b63b94bc81 Updated buildbot scripts to support clang builders. 2011-05-01 00:17:11 -05:00
Scott Ehlert 7e514f5d34 Moved -static-libgcc to linker flags. 2011-05-01 00:09:25 -05:00
Scott Ehlert cb2de2e5c4 Avoid depending on __isoc99_sscanf@GLIBC_2.7 when building on Linux with glibc >= 2.7 (bug 4894, r=dvander). 2011-04-28 02:43:55 -05:00
Nicholas Hastings f2fedbc3e6 Merge. 2011-04-25 19:05:48 -04:00
Nicholas Hastings 8ef686fd21 Updated dinodday gamedata for today's game update. 2011-04-25 19:05:01 -04:00
Nicholas Hastings 4c96e9a17d Updated zps gamedata for today's game update. 2011-04-25 19:04:34 -04:00
Scott Ehlert 939bc00b2b Added detection for clang compiler and fixed various warnings triggered by it (bug 4878, r=dvander). 2011-04-23 21:53:53 -05:00
Nicholas Hastings 0b06d3412e Updated Windows signature for GMod CreateEntityByName. 2011-04-17 16:12:45 -04:00
Nicholas Hastings 94f6f60105 Merge. 2011-04-15 15:40:38 -04:00
Nicholas Hastings 4bd6bc9683 Updated Garry's Mod gamedata. 2011-04-15 15:16:47 -04:00
David Anderson 3c59621425 Backed out changeset d6853d8d39fd 2011-04-15 10:59:10 -07:00
David Anderson a37e2ab26a Fix bug where globals can be assigned invalid memory (bug 4643, r=ds). 2011-04-15 10:50:09 -07:00
Nicholas Hastings d099febf7b Added new param to CTFPlayerShared::Disguise call in TF2 ext (bug 4866, r=fyren). 2011-04-15 12:11:32 -04:00
Nicholas Hastings b9f82332c8 Shortened __ext name for ClientPrefs to avoid hitting symbol limit (bug 4839). 2011-04-15 02:06:50 -04:00
Nicholas Hastings c02c4c6d6a Gamedata update for CS:S, TF2, DOD:S, and HL2DM. 2011-04-15 01:34:18 -04:00
Nicholas Hastings 17476ec137 Triggering build to (hopefully) fix load on linux. 2011-04-15 00:34:51 -04:00
Nicholas Hastings ee51a68c6f Triggering build... again. 2011-04-14 23:35:08 -04:00
Nicholas Hastings 0120ce5d7c Merge. 2011-04-14 23:30:04 -04:00
Nicholas Hastings 42c6e640fc Triggering build. 2011-04-14 23:26:39 -04:00
Scott Ehlert bc571316b9 Triggering a build for goodness sake. 2011-04-14 20:53:59 -05:00
Scott Ehlert 3cc1af9618 Triggering a build. 2011-04-13 20:25:10 -05:00
Scott Ehlert 6957bf504b Triggering a build. 2011-04-13 19:05:41 -05:00
Scott Ehlert d47dd70141 Attempt #2 at meaningful bootstrap error message. 2011-04-13 18:37:41 -05:00
Scott Ehlert 86eb2360db Attempt at getting a meaningful error message out of buildbot bootstrap. 2011-04-13 18:30:34 -05:00
Scott Ehlert c55e350cb2 Triggering a build, argh. 2011-04-13 17:08:39 -05:00
Scott Ehlert b0fe032b8d Triggering a build. 2011-04-13 16:44:20 -05:00
Scott Ehlert aa25870fb8 Triggering a build. 2011-04-13 16:09:36 -05:00
Nicholas Hastings a8118ea8f4 Merge. 2011-04-13 08:31:02 -04:00
Nicholas Hastings 1a344c1441 SetEntProp now marks edict state as changed at offset (bug 4855, r=fyren). 2011-04-13 08:13:49 -04:00
Berni 86a1641ac1 Fix compiler hanging when #including a directory (bug 4822, r=dvander) 2011-04-13 04:02:22 -07:00
Nicholas Hastings 10129fa568 Removed gEntList failure notify on Windows. (bug 4832, r=fyren). 2011-04-11 22:30:03 -04:00
David Anderson 935a8d36da Triggering build. 2011-04-09 18:18:59 -07:00
Nicholas Hastings 2516a3af8a Updated hgignore to catch msvc temp files (npotb). 2011-04-09 15:52:58 -04:00
Nicholas Hastings 120a265fc3 Removed core/msvc10/sourcemod_mm.sdf from version control (npotb). 2011-04-09 15:43:10 -04:00
Nicholas Hastings 33aebeb727 Added forwards to TF2 ext for cond addition and removal (bug 4851, r=fyren). 2011-04-09 00:33:55 -04:00
Nicholas Hastings 7e06cfb471 Added gamedata for Dino d-day. 2011-04-09 00:29:57 -04:00
Berni f2bcff69a9 Added GetEntityClassname stock (bug 4798, r=dvander). 2011-04-09 00:29:46 -04:00
Nicholas Hastings 39b7d175b9 Merge 2011-04-07 23:03:51 -04:00
Nicholas Hastings b9cebe8d87 triggering build. 2011-04-07 23:01:16 -04:00
Scott Ehlert 6814cfbcd7 Triggering a build, please. 2011-04-07 15:09:56 -05:00
Scott Ehlert 2884696024 Triggering a build, perhaps. 2011-04-07 14:51:56 -05:00
David Anderson 6930046bc6 Triggering build. 2011-04-07 04:16:38 -05:00
David Anderson 174cbfe3b9 Triggering build. 2011-04-07 04:13:54 -05:00
David Anderson 611c7633cf Triggering build. 2011-04-07 04:05:00 -05:00
David Anderson 822d4269c4 Pushing build. 2011-04-07 04:04:02 -05:00
David Anderson 8fd16efc33 Triggering build. 2011-04-07 03:58:20 -05:00
Nicholas Hastings ef082d855c Fixed some gamedata lookups requiring symbols on linux/mac (bug 4832, r=fyren). 2011-04-04 13:44:19 -04:00
Nicholas Hastings a5c4739804 Added better cross-engine entity flag compatibility. (bug 4809, r=fyren). 2011-04-04 13:37:29 -04:00
Nicholas Hastings d1f1a88ffd Mark clientprefs natives as optional when ext not required. (bug 4839, r=fyren). 2011-03-24 09:48:36 -04:00
David Anderson c05f6b7bf3 Trigger build. 2011-03-22 21:45:20 -07:00
Nicholas Hastings 4b5fa26cd6 Changed some instances of LogMessage to LogAction. (bug 4649, r=fyren). 2011-03-20 19:37:25 -04:00
Nicholas Hastings 0162d18343 Updated SM core vcxproj. MMSOURCE17 -> 18, Removed files moved to logic. (NPOTB) 2011-03-13 14:03:33 -04:00
Nicholas Hastings b6415818f6 Added new TF2 condition defines (bug 4834, r=fyren). 2011-03-13 14:03:26 -04:00
David Anderson e16efbf58b Upgraded symstore. 2011-03-12 23:01:29 -08:00
Nicholas Hastings 46804d0faf SM Central fixes for new language natives (bug 4613). 2011-03-12 23:56:04 -05:00
Dr\!fter a81567e2d6 Add OnClientSettingsChanged to IPlayerHelpers (bug 4812, r=fyren) 2011-03-08 12:59:42 -08:00
databomb 217670b54a Fix precedence of voice mute flag versus specific client overrides (bug 4826, r=fyren) 2011-03-08 12:23:34 -08:00
databomb f2e19c0387 Fix mistaken unhooking of voice hooks (bug 4804, r=fyren) 2011-03-08 12:17:21 -08:00
Fyren 9799970042 Update spcomp Makefile 2011-03-08 12:07:06 -08:00
GoD-Tony ca75d0d765 Added new language natives (bug 4613, r+a13=dvander). 2011-03-08 08:38:21 -05:00
Asher Baker 0824e49000 Added missing files to the spcomp project file (bug 4824, r=dvander). 2011-03-07 15:05:51 +07:00
Nicholas Hastings c3a98db0ea Fixed SetTeamScore not updating score on client (bug 2736, r=fyren). 2011-02-28 19:40:21 -05:00
Nicholas Hastings f27685717b Updated SDKTools vc project file (NPOTB). 2011-03-01 21:25:02 -05:00
Nicholas Hastings 55034bfa6f Merge 2011-03-01 21:22:09 -05:00
Nicholas Hastings 6f8b420d0d Backed out changeset: 6da59ea19165 2011-03-01 21:22:01 -05:00
Nicholas Hastings 2ed7e14a99 Merge. 2011-02-28 19:47:14 -05:00
Nicholas Hastings ee3bcef8ab Updated Empires Mod gamedata for version 2.31a. 2011-02-28 19:45:44 -05:00
Nicholas Hastings adbcb97515 Fixed graphical glitches with funcommands effects in L4D1 (bug 3486, r=fyren). 2011-02-28 19:45:36 -05:00
Nicholas Hastings c667723958 Added identifier for new TF2 flag event, 'returned' (bug 4808, r=fyren). 2011-02-28 19:44:41 -05:00
Nicholas Hastings d94634398e Updated TF2 condition idenifiers (bug 4801, r=fyren).
Added TFCond_InHealRadius (amputator glow) and fixed TFCond_Healing.
2011-02-28 19:43:08 -05:00
Nicholas Hastings f348e58508 Fixed SetTeamScore not updating score on client (bug 2736, r=fyren). 2011-02-28 19:40:21 -05:00
David Anderson 60f16970ac Trigger build. 2011-02-27 23:58:10 -08:00
David Anderson 39c5eafafc Trigger build. 2011-02-27 23:33:15 -08:00
David Anderson b7f6c223d8 Push build. 2011-02-27 23:04:10 -08:00
Nicholas Hastings bf9a65338b Forcing build to see if upload is fixed. 2011-02-27 12:43:13 -05:00
Nicholas Hastings 5b3ae5eff9 Updated ZPS gamedata. 2011-02-07 15:50:27 -05:00
Asher Baker f80a8d306b Added defines for TF2 weapon slots (r=dvander). 2011-02-01 14:45:19 -05:00
Nicholas Hastings 9ed9060940 Updated CSPromod gamedata. 2011-02-01 13:50:17 -05:00
Nicholas Hastings 5453e60099 Updated customkill and deathflag defines in tf2_stocks (bug 4799, r=dvander). 2011-01-16 20:25:44 -05:00
Nicholas Hastings 3de61b69ad Raised MAXPLAYERS from 64 to 65 (bug 4490, r=dvander). 2011-01-16 20:06:55 -05:00
Erik Minekus 322a4ed05d Fixed bug in nominations that could cause "Unknown command" error (bug 4797, r=psychonic). 2011-01-16 20:00:44 -05:00
Nicholas Hastings 8f3b4afcf7 Removed tv_enable hook to fix rare max client count issue (bug 4791, r=fyren). 2011-01-12 18:59:34 -05:00
Nicholas Hastings ebdc6b94fc forcing build. 2011-01-12 06:47:13 -05:00
Nicholas Hastings a7218d2e59 Added missing SOURCE_SDK_BLOODYGOODTIME define to halflife.inc (bug 4780, rs=dvander). 2011-01-12 00:30:47 -05:00
Nicholas Hastings 6d93beac8e maybe i was too impatient... 2011-01-12 00:12:06 -05:00
Nicholas Hastings 1fb1309e77 forcing build 2011-01-12 00:07:20 -05:00
Nicholas Hastings 5916f40b7a Added Bloody Good Time gamedata (bug 4780, r=fyren). 2011-01-11 23:36:32 -05:00
Nicholas Hastings 5226714bbd Added support for Bloody Good Time (bug 4780, r=fyren). 2011-01-11 23:35:58 -05:00
Asher Baker dabf486a9f Added missing MENUFLAG_BUTTON_NOVOTE define to menus.inc (bug 4217, r=psychonic). 2011-01-04 11:02:39 -05:00
Zach Kanzler c78f4407ea Exposed ProcessCommandTarget in IPlayerHelpers (bug 4742, r=fyren). 2010-12-31 20:04:59 -05:00
Asher Baker fae4127ddc Added missing unhooking of ClientConnect in PlayerManager (bug 4749, r=fyren). 2010-12-31 20:02:41 -05:00
Zach Kanzler 9cc1497e9e Fixed namespace-related compile issue in INativeInvoker.h (bug 4750, r=fyren). 2010-12-31 20:00:07 -05:00
Nicholas Hastings cdd64d52eb Updated Garry's Mod gamedata (bug 4762, r=fyren). 2010-12-19 14:10:36 -05:00
Nicholas Hastings 4d319c12f8 Updated TF2 includes with new weapon and condition identifiers (bug 4761, r=fyren). 2010-12-18 17:07:42 -05:00
Nicholas Hastings 8fc3e4ab12 Updated HL2DM gamedata (bug 4756, r=fyren). 2010-12-18 00:11:51 -05:00
Nicholas Hastings ed7d68d6a7 Updated DOD:S gamedata (bug 4755, r=fyren). 2010-12-18 00:03:31 -05:00
Nicholas Hastings 59820519ce Updated CS:S gamedata (bug 4754, r=fyren). 2010-12-18 00:03:04 -05:00
Nicholas Hastings 767c807a40 Updated TF2 gamedata (bug 4753, r=DS). 2010-12-17 23:08:49 -05:00
Nicholas Hastings d25adc1b10 Updated Goldeneye:Source gamedata (bug 4751, r=fyren). 2010-12-17 23:07:54 -05:00
Nicholas Hastings 35f0067fe5 Updated Garry's Mod gamedata (bug 4747, r=fyren). 2010-12-15 21:29:59 -05:00
Nicholas Hastings f1b01dd086 Triggering build to fix bug 4729 on L4D1 now. 2010-12-13 15:37:39 -05:00
Asher Baker 3df08d64e2 Fix permissions check in antiflood (bug 4584, r=dvander). 2010-12-12 18:13:05 -08:00
Erik Minekus f56cc43331 Fixed sm_rtv printing "unknown command" (bug 4730, r=psychonic). 2010-12-04 15:28:15 -05:00
Scott Ehlert b4b37daaf6 Triggering build to fix bug 4729. 2010-12-03 23:58:41 -08:00
Nicholas Hastings 1f187d24c8 Updated TF2_GetPlayerConditionFlags to match Valve's current logic. 2010-12-03 17:12:06 -05:00
Nicholas Hastings 5b806a467b Fixed BanClient always banning by IP address (bug 4626, r=fyren). 2010-11-30 13:09:30 -05:00
Jason Booth 20d14d5a10 Fixed profiler flush not clearing, added 'report' and 'clear' (bug 4674, r=dvander). 2010-11-30 13:08:30 -05:00
Nicholas Hastings 043b2df345 Fixed voting crash when client console, chat, and SourceTV are enabled (bug 4676, r=fyren). 2010-11-30 13:04:13 -05:00
Nicholas Hastings 9ec7feb9ab Fixed CDetour crash in TF2 extension when last plugin using forward is unloaded (bug 4713, r=fyren). 2010-11-28 22:41:48 -05:00
Nicholas Hastings 57cf6db4e0 Fixed TF2 GetHoliday Windows signature (bug 4714, r=fyren). 2010-11-24 20:46:17 -05:00
Nicholas Hastings 61b677c073 Add GetGameRules to ISDKTools (bug 4707, r=fyren) 2010-11-19 23:02:27 -05:00
Nicholas Hastings 264e42a4c5 Merge 2010-11-19 15:52:41 -05:00
Nicholas Hastings 251fd660f9 Backed out changeset: 07fb9b761438 2010-11-19 15:52:33 -05:00
Matt Woodrow 6459f53263 Why, oh why, do you do this to me gcc? 2010-11-19 18:16:24 +13:00
Matt Woodrow 55c8d93862 gcc strikes again with the no newline error. Bustage fix 2010-11-19 18:12:40 +13:00
Matt Woodrow c6f83f8c14 Bustage fix. Thanks for nothing Crimson 2010-11-19 18:07:28 +13:00
Brett Powell c9eaca0e56 Add WaitingForPlayers forwards to TF2 extension (bug 4704, r=pred) 2010-11-19 17:58:46 +13:00
Brett Powell 6267c17c6b Extend Nominations API (bug 4677, r=pred) 2010-11-19 17:39:53 +13:00
Brett Powell 616113d384 Add GetGameRules to ISDKTools (bug 4707, r=pred) 2010-11-19 17:37:26 +13:00
Nicholas Hastings ac738aff10 TF2 GetHoliday detour now detours UTIL_GetHoliday (bug 4700, r=fyren). 2010-11-09 21:12:38 -05:00
A.W. Stanley 7627bf80b9 Added TF2_IsPlayerInDuel native to TF2 extension (bug 4695, r=psychonic). 2010-11-07 19:05:32 -05:00
Scott Ehlert 172abb2710 Added support for L4D on Mac OS X (bug 4684, r=fyren). 2010-10-29 20:04:50 -05:00
Scott Ehlert a643c6ef1e Fixed sample ext makefiles for L4D Linux builds (bug 4681, r=fyren). 2010-10-28 12:42:13 -07:00
Nicholas Hastings 64bfb0961e Updated TF2 customkill defines (bug 4682, r=fyren). 2010-10-28 10:23:30 -04:00
Scott Ehlert 68d822f50a Fixed loading L4D on Linux (bug 4681, r=dvander). 2010-10-27 22:05:56 -07:00
Fyren 56e3bab02a vcproj crap (NPOTB) 2010-10-20 05:13:48 -07:00
Fyren 9dd5ab4ebd Fix Windows entity output hooks (bug 4644, r=dvander) 2010-10-20 05:10:13 -07:00
David Anderson b1ef86de75 Follow-up fixes to database conf reading (bug 4286, r=fyren). 2010-10-16 22:27:34 -07:00
Fyren b4a0d7a5b7 Use SH strings for database configs (bug 4286, r=dvander) 2010-10-16 03:52:36 -07:00
Scott Ehlert e6a93a799a Added support for L4D2 on Mac OS X (bug 4647, r=fyren). 2010-10-14 18:27:37 -05:00
Nicholas Hastings 4e175f9cd6 Updated Gmod gamedata (bug 4652, r=fyren). 2010-10-07 18:35:26 -04:00
Nicholas Hastings 62e3fe1414 Merge. 2010-10-06 20:47:16 -04:00
Nicholas Hastings eeb7285528 Updated CSS/DODS/TF2/HL2DM CommitSuicide offset (bug 4650, r=fyren). 2010-10-06 20:46:29 -04:00
Scott Ehlert 0340b62b7c Triggering build against L4D2 SDK changes.
This should fix sm_kick.
2010-10-05 23:32:27 -07:00
Scott Ehlert 5488f60260 Triggering build against L4D1 SDK changes. 2010-10-05 20:07:14 -07:00
Fyren be7ef860d5 Revert mistaken vsound.cpp change 2010-10-04 19:45:21 -07:00
Zach Kanzler 9aba700d8c Added GetMessageName to IUserMessages (bug 4573, r=pred). 2010-10-02 17:58:06 -04:00
Nicholas Hastings 7972acf5bf Added one more missing enum value in tf2_stocks. 2010-10-01 15:24:30 -04:00
Fyren 430c001d58 Static gamedata checker (NPOTB) 2010-10-01 12:15:43 -07:00
Nicholas Hastings 943777e5d0 Fixed/updated TF2_DisguisePlayer (bug 4641, r=fyren). 2010-10-01 10:46:21 -04:00
Nicholas Hastings c086c3b03b Updated more TF2 gamedata and fixed RemoveCondition call (bug 4641, r=fyren). 2010-10-01 09:07:51 -04:00
Nicholas Hastings e517eceb24 Shortened names of some symbols in tf2_stocks (bug 4642, r=fyren). 2010-10-01 08:50:18 -04:00
Nicholas Hastings 7fb57a4064 Updated TF2 includes with more defined identifiers (bug 4640, r=dvander). 2010-09-30 23:40:42 -04:00
Nicholas Hastings 888bca13c0 Updated HL2DM gamedata (bug 4636, r=fyren). 2010-09-30 20:09:10 -04:00
psychonic 8b39e0631d Updated DODS gamedata (bug 4638, r=fyren). 2010-09-30 17:24:19 -04:00
psychonic d0d0148a58 Updated TF2 gamedata (bug 4635, r=fyren). 2010-09-30 17:23:54 -04:00
psychonic a73b62c5bf Updated CSS gamedata (bug 4637, r=fyren). 2010-09-30 17:23:37 -04:00
Nicholas Hastings bee0afd301 forcing build 2010-08-27 20:15:28 -04:00
Nicholas Hastings 8f37940f4c Updated cstrike ext gamedata for 2010-08-26 update (bug 4595, r=fyren). 2010-08-26 22:23:07 -04:00
Nicholas Hastings 0fa8d8cb51 Updated Gmod gamedata, including linux support (bug 4569, r=fyren). 2010-08-24 19:23:57 -04:00
Nicholas Hastings 1f589d0d5d Added AMXX Pawn geshi generation script. 2010-08-23 13:53:44 -04:00
Nicholas Hastings ad36745a7c Normalized spacing and fixed warnings with newest geshi in (Source)Pawn geshi script. 2010-08-23 13:52:42 -04:00
Scott Ehlert 99b9860ea5 Added Alien Swarm build config for sample extension (bug 4530, r=psychonic). 2010-08-20 10:42:16 -05:00
Scott Ehlert dc5f82cce2 Fixed alignment on a couple of SourcePawn debugging structures on OS X (bug 4578, r=dvander).
This problem only affected plugins compiled with a fairly old version of spcomp.
2010-08-19 22:51:42 -05:00
Nicholas Hastings dc3050537b Fixed timeleft not getting reset on Game_Commencing in CS:S (bug 4557, r=fyren). 2010-08-19 21:57:09 -04:00
Nicholas Hastings 5acd0dd2d1 Fixed Curl lib AMBuilder script failing with vs2010 (bug 4575, r=ds). 2010-08-19 13:03:14 -04:00
Scott Ehlert 0d933a1901 Disabled nextmap plugin on Alien Swarm (bug 4571, r=fyren). 2010-08-16 15:13:47 -05:00
Nicholas Hastings 9f21865caf Fixed typo in edd61d1e1e26 (bug 4542) 2010-08-05 19:24:30 -04:00
Nicholas Hastings 2ba81d3fef Added initial gamedata for Alien Swarm (bug 4530, r=ds). 2010-08-02 12:28:38 -04:00
Erik Minekus bcc1c2e658 Fixed typos in some usage replies (bug 4552, r=dvander). 2010-08-02 09:44:49 -04:00
Nicholas Hastings 5fa8972ae6 Fixed Ignite crash on Fistful of Frags (bug 4556, r=fyren). 2010-08-02 09:37:36 -04:00
Nicholas Hastings 96363a0ce3 Fixed Firearms Source FireOutput signature (bug 4555, r=fyren). 2010-08-02 09:36:10 -04:00
Scott Ehlert 817fa9d9be Oh, fixed package script for new bintools binary (bug 4548). 2010-08-01 15:09:48 -05:00
Scott Ehlert 89334bb459 Bintools extension no longer needs a separate build for each engine (bug 4548, r=dvander). 2010-08-01 14:57:54 -05:00
Scott Ehlert 0ae2d99599 Fixed potential crash with IMemUtils::FindPattern on Linux (bug 4554, r=dvander). 2010-07-31 16:06:22 -05:00
Scott Ehlert e1199a02ee Fixed missing version string and compile date for MySQL extension (bug 4547, r=dvander). 2010-07-28 14:48:51 -05:00
Scott Ehlert 9408a61eb1 Ugh, fixed builds for real. How did that even happen? 2010-07-27 20:28:27 -05:00
Scott Ehlert 78d7e1bdfe Hopefully fixed build. 2010-07-27 18:02:37 -05:00
Scott Ehlert dd44a0aaea Added support for Alien Swarm (bug 4530, r=dvander). 2010-07-27 17:32:32 -05:00
Nicholas Hastings b3144dd19a Added gamedata for Fistful of Frags (bug 3883, r=fyren). 2010-07-26 19:26:32 -04:00
Nicholas Hastings 2722e96fac Two more phrases in ice.sp are now able to use translations (bug 4540, r=fyren). 2010-07-26 19:11:06 -04:00
pheadxdll 488de0014e Added TF2_MakeBleed native to TF2 ext (bug 4542, r=fyren,psychonic). 2010-07-26 11:06:08 -04:00
Zach Callear 9c2e0ebd4c Fixed living players hearing dead players if alltalk is disabled while deadtalk is on (bug 4533, r=fyren). 2010-07-26 08:23:49 -04:00
Nicholas Hastings 28cc96cfd0 Fixed errors and missing effects caused by missing sprites on L4D2 (bug 4512, r=fyren). 2010-07-26 08:15:52 -04:00
Erik Minekus 4ab3b15efd Added TF2 object stocks (bug 4536, r=psychonic). 2010-07-23 21:23:35 -04:00
Nicholas Hastings ff363e3893 Added gamedata for Firearms: Source (bug 4537 r=fyren). 2010-07-23 21:16:15 -04:00
Nicholas Hastings cd2c10b6dc Added support for logical entities to gamedata for Synergy. (bug 4534, r=fyren) 2010-07-22 21:38:55 -04:00
Scott Ehlert 563e981902 Fixed Linux and OS X builds. 2010-07-21 22:23:56 -05:00
Fyren c3e20d5d12 FireOutput detour in SDKTools now uses CDetour (bug 4416, r=pred). 2010-07-21 22:09:03 -05:00
Nicholas Hastings 2802486671 Fixed a couple small things in npp xml generation script. 2010-07-21 08:46:52 -04:00
Nicholas Hastings 1507d03c21 Updated TF2 conditions enum and defines (bug 4526, r=fyren) 2010-07-20 11:21:37 -04:00
Jason Booth fbbf193345 Fixed duplicated entries and unnecessary file locking in ProfViewer (bug 4510, r=dvander) 2010-07-18 21:39:15 -04:00
Jason Booth 78e51e6b11 Fixed problems with ProfViewer project file (bug 4510, r=dvander) 2010-07-18 21:37:18 -04:00
Nicholas Hastings be2bbec526 Fixed PlayerRunCmd being hooked when not used. (bug 3990, r=fyren) 2010-07-18 15:43:56 -04:00
Scott Ehlert a366096ef4 Added MSVC10 project file for sample extension (bug 4521, r=dvander). 2010-07-15 15:19:14 -05:00
Scott Ehlert c72222f718 Updated docs on replicate and notify params for SetConVar* and ResetConVar (bug 4517, r=pred). 2010-07-14 20:29:53 -05:00
Scott Ehlert fba0ec93bf Fixed replicate and notify params not working on old engine games (bug 4516, r=pred).
This also fixes an issue where clients could be notified of convar changes twice on newer engines (Orange Box and later).
2010-07-14 20:29:45 -05:00
Scott Ehlert 86f767e1aa Made name param of GetConVarName() non-const (bug 4515, r=pred). 2010-07-14 20:29:29 -05:00
Scott Ehlert 7e54192713 Added gamedata for DOD:S on Mac OS X. (bug 4513, r=dvander). 2010-07-12 21:03:25 -05:00
David Anderson e76a73e276 Fixed Windows build fo' realz. 2010-07-11 18:06:06 -07:00
David Anderson ccf0490624 Windows build fix. 2010-07-11 17:45:35 -07:00
David Anderson fe2721e04e Merge. 2010-07-11 17:33:09 -07:00
David Anderson fdd1a9afef Use hash table for global name lookups (bug 4496, r=fyren). 2010-07-11 17:32:46 -07:00
Scott Ehlert abf7aed880 Triggering a build to compile against L4D2 SDK changes (bug 4509). 2010-07-11 03:00:30 -05:00
Nicholas Hastings d986c7cdc0 Fixed TF2 sigs that broke with recent update (bug 4506, r=fyren) 2010-07-08 21:07:06 -04:00
Scott Ehlert 9d5e994c01 Bleh, fixed compiler error in console.inc caused by previous changeset. 2010-07-07 02:27:59 -05:00
Scott Ehlert 6f16fc77b8 Added GetConVarDefault() native (bug 4502, r=dvander). 2010-07-06 17:32:58 -05:00
David Anderson 651dfb796c Merge. 2010-07-02 18:17:16 -07:00
David Anderson 4f2fc17a8f Fixed staging buffers reallocating on every operation (bug 3820, r=fyren+fyren). 2010-07-02 18:16:50 -07:00
David Anderson 7bc019547f Fixed O(n) insertion of debug strings (bug 4495, r=fyren). 2010-07-02 18:16:15 -07:00
David Anderson f8c2629a3e Fixed O(n^2) generation of debug info tables (bug 4493, r=fyren). 2010-07-02 18:15:59 -07:00
David Anderson b5b4bff2fc Fixed bogus assert in callfunction (bug 4487, r=fyren). 2010-07-02 18:15:21 -07:00
David Anderson 7054b92a14 Fixed bogus assert about name lengths (bug 4486, r=fyren). 2010-07-02 18:12:31 -07:00
Nicholas Hastings 5856f9a45f Gmod gamedata update (bug 4489, r=fyren) 2010-06-29 18:17:25 -04:00
Fyren cec10060c6 How did I even do that. 2010-06-28 17:25:06 -07:00
Fyren 74a479ab41 Fix build 2010-06-28 16:41:08 -07:00
Nicholas Hastings e51ab09bb1 Backed out changeset: f1bfc4089ce5 2010-06-28 19:17:10 -04:00
Nicholas Hastings 0cd98bc353 Another try at fixing build. 2010-06-28 19:12:37 -04:00
Nicholas Hastings 158f9b0dc7 Backed out changeset: 54086a5d694b 2010-06-28 19:12:05 -04:00
Nicholas Hastings 95fe6eaf86 Fix build. 2010-06-28 19:03:16 -04:00
Nicholas Hastings 40b4859b16 newline 2010-06-28 18:37:43 -04:00
Nicholas Hastings e4832f0d08 Added forward/detour for TF2's GetHoliday function (bug 4462, r=pred) 2010-06-28 17:48:14 -04:00
_KaszpiR_ 5d5400a9ac Added FindFlagChar native. (bug 3776, r=dvander) 2010-06-27 19:17:25 -04:00
David Anderson f439cad46c Removed code now dead from CS:S Orange Box move (bug 4399, r=ds). 2010-06-23 23:35:28 -07:00
Nicholas Hastings 9fe2e8e31a Removed cstrike ep1 and cstrike_beta builds and references. 2010-06-23 23:49:06 -04:00
Erik Minekus 92d3fc3d8c Fixed lack of error checking on sm_motd. (bug 4460, r=dvander) 2010-06-23 23:41:47 -04:00
Nicholas Hastings 5d89599799 Backed out changeset: 6c4d95b625ea 2010-06-23 23:40:53 -04:00
Erik Minekus 2eb5b5eb67 Fixed lack of error checking on sm_motd. 2010-06-23 23:39:39 -04:00
Nicholas Hastings 45549a8173 Cstrike ext now recognizes and loads on cstrike_beta (bug 4399, r=fyren) 2010-06-23 10:08:08 -04:00
devicenull d7ebf2edc1 Fixed inaccuracy in CommandListener documentation 2010-06-23 09:22:49 -04:00
Greyscale a9aed2e557 Removed unnecessary tag from return value of SetArrayCell 2010-06-23 09:17:21 -04:00
Nicholas Hastings d691a0cf24 Ep2v cstrike ext now gets added to package. 2010-06-23 08:54:56 -04:00
Nicholas Hastings cbaa959521 Adding building of cstrike ext for ep2v (bug 4399, r=fyren) 2010-06-23 08:19:19 -04:00
Nicholas Hastings 2f128113b6 Added missing TF2 critcola condflag define (bug 4464, r=fyren) 2010-06-22 19:31:33 -04:00
Nicholas Hastings 70251a8b2e Updated TF2 'Burn' signature (bug 4463, r=fyren) 2010-06-22 19:26:07 -04:00
Fyren e332f4e12b Possible dynamic array dimension fix (bug 4428, r=dvander) 2010-06-19 15:15:23 -07:00
Nicholas Hastings 9a140ff93f Fixed outputname null pointer crash in sdktools (bug 4422, r=fyren) 2010-06-14 09:32:50 -04:00
David Anderson 97ab5dd1b5 Fixed switch case comparisons failing with large numbers (bug 4457, r=pred). 2010-06-13 20:26:58 -07:00
Scott Ehlert 075b4e92a9 Added gamedata for TF2 on Mac OS X. (bug 4455, r=dvander). 2010-06-10 17:12:52 -05:00
Nicholas Hastings f22dcfe03c Added missing FireOutput and PlayerRunCmd gamedata for zombie_master (bug 4452, r=fyren) 2010-06-07 19:35:34 -04:00
Scott Ehlert 124086419e Fixed IMemUtils::ResolveSymbol() on Mac OS X (bug 4448, r=dvander). 2010-06-07 13:26:45 -05:00
Nicholas Hastings 0712db0d29 Merge. 2010-06-06 20:53:13 -04:00
Nicholas Hastings 895f7edd12 Added new player condition (TFCond_CritCola) to tf2.inc. (bug 4447, r=fyren) 2010-06-06 20:51:35 -04:00
Matt Woodrow a3c5c0c23a Merge 2010-06-07 10:33:47 +12:00
Matt Woodrow f7a3a6c17b Fixed clientprefs deleting cookies twice in rare cases (bug 4412, r=Fyren) 2010-06-07 10:30:33 +12:00
Nicholas Hastings 98bec2580e Fixed OnClientConnected forward not firing for bots (bug 4443, r=fyren) 2010-06-06 17:53:38 -04:00
Fyren 5ca2d469a8 Fix sdktools voice memory corruption (bug 4415, r=dvander) 2010-06-05 23:15:29 -07:00
Scott Ehlert b413405876 Added gamedata for CS:S Beta (ep2v) on Mac OS X. (bug 4399, r=dvander). 2010-06-04 17:14:52 -05:00
Nicholas Hastings 330ff93e3e Updated Obsidian Conflict gamedata (bug 4439, r=fyren) 2010-06-02 07:47:00 -04:00
Nicholas Hastings fe08104d18 Fixed tf2.inc incorrectly attempting to load tf2 ext on all games (bug 4197, r=fyren) 2010-05-31 16:31:10 -04:00
Scott Ehlert e518605d69 Fixed various areas where code was being compiled for Linux only, but should actually be used on OS X too (bug 4392, r=dvander). 2010-05-29 18:11:47 -04:00
Scott Ehlert 9a35085ac3 Merge. 2010-05-29 00:38:08 -05:00
Scott Ehlert b0cf41de08 Fixed potential problem when using bintools to call functions that return objects by value on OS X (bug 4392, r=dvander).
Objects are only returned in memory when their sizes are greater than 8 or are not a power of 2.
2010-05-29 00:22:21 -05:00
Nicholas Hastings 00c3dc73f3 Updated/fixed SourceForts gamedata (bug 4429, r=fyren) 2010-05-28 13:28:04 -04:00
Scott Ehlert a73cc93d21 Added version information to Mac OS X binaries (bug 4392, r=dvander). 2010-05-27 21:05:32 -05:00
Scott Ehlert 5a10299074 Added Mac OS X build support to sample extension makefiles (bug 4392, r=dvander). 2010-05-27 21:04:49 -05:00
Scott Ehlert 77d243f87f Merge. 2010-05-27 21:04:22 -05:00
Nicholas Hastings fb4f6406c9 Fixed SDKTools sm_dump_datamaps crash on improperly created entities (bug 4424, r=pred) 2010-05-26 08:30:13 -04:00
Scott Ehlert 3133b9b010 Merge. 2010-05-22 01:08:42 -05:00
Nicholas Hastings 12723167fc Added gamedata for Resistance and Liberation (bug 4418, r=fyren) 2010-05-21 14:04:19 -04:00
Nicholas Hastings 2cc22778b5 Added comment to databases.cfg to denote acceptable "host" types 2010-05-21 14:00:33 -04:00
Nicholas Hastings 790d3f12a6 Empires gamedata fixes (bug 4417, r=fyren). 2010-05-21 13:55:29 -04:00
Scott Ehlert beb1ab81e0 Updated .hgignore to ignore dylib binaries on OS X. 2010-05-19 04:31:10 -05:00
Scott Ehlert e5126b4c65 Added support for "mac" in game data files (bug 4393, r=dvander). 2010-05-16 02:27:53 -04:00
Scott Ehlert a2a4df5d06 Triggering build. 2010-05-15 20:50:24 -04:00
Scott Ehlert ac0bd9714b Triggering build. 2010-05-15 20:00:55 -04:00
David Anderson 60226d9195 Fixed windows build. 2010-05-15 13:01:23 -07:00
David Anderson 64455b9852 Moved gameconf code from core to logic (bug 4406 part 11, r=ds).
--HG--
rename : core/GameConfigs.cpp => core/logic/GameConfigs.cpp
rename : core/GameConfigs.h => core/logic/GameConfigs.h
rename : core/smn_gameconfigs.cpp => core/logic/smn_gameconfigs.cpp
2010-05-14 23:35:42 -07:00
David Anderson 96f6cdf677 Moved datapack natives from core to logic (bug 4406 part 10, r=ds).
--HG--
rename : core/smn_datapacks.cpp => core/logic/smn_datapacks.cpp
2010-05-14 21:16:35 -07:00
David Anderson c188491289 Moved handle natives from core to logic (bug 4406 part 9, r=ds).
--HG--
rename : core/smn_handles.cpp => core/logic/smn_handles.cpp
2010-05-14 21:06:06 -07:00
David Anderson e9e4d566a5 Build fix. 2010-05-14 20:56:40 -07:00
David Anderson 85bedca236 Move string natives from logic to core (bug 4406 part 8, r=fyren).
--HG--
rename : core/smn_string.cpp => core/logic/smn_string.cpp
2010-05-14 20:04:44 -07:00
David Anderson d80191df3d Move replace functions from logic to core (bug 4406 part 7, r=fyren). 2010-05-14 20:04:30 -07:00
David Anderson 9137e92c09 Move translator from logic to core (bug 4406 part 6, r=ds).
--HG--
rename : core/PhraseCollection.cpp => core/logic/PhraseCollection.cpp
rename : core/PhraseCollection.h => core/logic/PhraseCollection.h
rename : core/Translator.cpp => core/logic/Translator.cpp
rename : core/Translator.h => core/logic/Translator.h
rename : core/sm_memtable.h => core/logic/sm_memtable.h
rename : core/smn_lang.cpp => core/logic/smn_lang.cpp
2010-05-14 19:43:53 -07:00
David Anderson 721dae3892 Inline sm_memtable (bug 4406 part 5, r=ds). 2010-05-14 19:43:38 -07:00
David Anderson 1cdacf69be Move some string functions from core to logic (bug 4406 part 4, r=fyren). 2010-05-14 19:28:10 -07:00
David Anderson b5b002aa4b Move banning natives from core to logic (bug 4406 part 3, r=fyren).
--HG--
rename : core/smn_banning.cpp => core/logic/smn_banning.cpp
2010-05-14 18:22:03 -07:00
David Anderson 78f5b513c0 Move admin natives from core to logic (bug 4406 part 2, r=ds).
--HG--
rename : core/smn_admin.cpp => core/logic/smn_admin.cpp
2010-05-14 17:46:19 -07:00
David Anderson 0032fcaa66 Move memutils from core to logic (bug 4406, r=ds).
--HG--
rename : core/MemoryUtils.cpp => core/logic/MemoryUtils.cpp
rename : core/MemoryUtils.h => core/logic/MemoryUtils.h
rename : core/sm_symtable.h => core/logic/sm_symtable.h
2010-05-14 16:14:59 -07:00
Scott Ehlert 0fba0923c8 Changed MSVC compiler flag /Ot to /Ox and added /OPT:REF linker flag. 2010-05-14 02:42:08 -05:00
Scott Ehlert e0169f6696 Fixed loader on Mac OS X (bug 4392, r=dvander). 2010-05-14 01:04:17 -05:00
David Anderson 28217f10cb Added ProcessTargetString simple filter API (bug 4404, r=ds). 2010-05-13 12:28:51 -07:00
Scott Ehlert fb28f4bcd0 Fixed package name for Windows (bug 4395). 2010-05-13 04:54:31 -05:00
Scott Ehlert 8852256ab6 Appended OS names to package archives (bug 4395, r=dvander). 2010-05-13 04:23:43 -05:00
Scott Ehlert 95de453677 Compile and link fixes for Mac OS X (bug 4392, r=dvander). 2010-05-13 04:22:31 -05:00
Scott Ehlert 5ef40e15c4 Add support for Mac OS X to ResolveSymbol() and FindPattern() in IMemUtils (bug 4392, r=dvander). 2010-05-13 04:20:41 -05:00
Scott Ehlert 31f223bff5 Merge. 2010-05-13 04:19:39 -05:00
Scott Ehlert 9fce2b1d8e Only build OB-Valve binaries on Mac OS X for now (bug 4392, r=dvander). 2010-05-13 04:18:58 -05:00
David Anderson a6ceb337b2 Move timer natives into logic binary (bug 4402, r=ds).
--HG--
rename : core/smn_timers.cpp => core/logic/smn_timers.cpp
2010-05-13 01:47:12 -07:00
Scott Ehlert f4e22cb44c Backed out changeset 29e6cc6f2124 (bug 4392). 2010-05-12 04:13:56 -05:00
David Anderson ab9750f8b2 Only build OB-Valve binaries on Mac OS X right now (bug 4392, r=ds). 2010-05-11 23:48:39 -05:00
Nicholas Hastings fe8e0b0e0a Merge 2010-05-11 20:41:19 -04:00
Nicholas Hastings c2565cf3b7 Updated gamedata for ep2v cstrike(_beta) (bug 4399, r=fyren) 2010-05-11 20:40:14 -04:00
David Anderson af82971bf5 Fixed Windows build. 2010-05-11 02:07:35 -07:00
David Anderson 271b52158e Mac build fixes (bug 4392, r=me). 2010-05-11 01:46:55 -07:00
Fyren 26c404adee Mac build fixes (bug 4392, r=dvander). 2010-05-11 01:46:54 -07:00
Scott Ehlert f06af54165 Fixed compiler and linker flags for darwin (r=dvander).
The previous commit by 'me' was a fake atrocity created by dvander. :o
2010-05-11 02:36:03 -05:00
Fyren 2a77dfbcd2 Fixed buildbot scripts for darwin (r=dvander). 2010-05-11 00:16:52 -07:00
David Anderson 738fcb6563 Added pcre-7.9 build for darwin. 2010-05-11 00:10:37 -07:00
Scott Ehlert 3d4754d4ad Fixed master amb script for darwin (r=dvander). 2010-05-11 00:10:36 -07:00
Scott Ehlert b9ea1d1be4 Fixed master amb script for darwin (r=dvander). 2010-05-11 00:10:36 -07:00
Nicholas Hastings b1b0484dae Fixed TF2 natives not being marked optional when ext not required (bug 4389, r=fyren) 2010-05-10 18:18:15 -04:00
Nicholas Hastings 20b79784bf Updated Empires gamedata (bug 4390, r=fyren) 2010-05-08 21:37:21 -04:00
Nicholas Hastings 4baa3358df Updated geshi and npp sp language files for SM 1.3.2
Also fixed typo in geshi generator and added 'default' to list of reserved words.
2010-05-08 21:31:32 -04:00
Scott Ehlert 8fe7f8b8d8 Fixed SendConVarValue() on TF2, DOD:S, L4D, and L4D2 (bug 4273, r=dvander). 2010-05-04 22:53:26 -04:00
Scott Ehlert 6996a0db2b Argh, really fixed HookEntityOutput() crash on TF2 (bug 4375). 2010-04-30 11:18:45 -04:00
Scott Ehlert b89a899c82 Fixed HookEntityOutput() crash with recent updates to TF2 and L4D2 (bug 4375, r=pred, a=blocking). 2010-04-30 03:51:35 -04:00
Fyren bbbbb660b3 Triggering build 2010-04-29 20:48:17 -07:00
Scott Ehlert 6ba29219e5 Updated sample extension makefiles to compile against latest changes for L4D2 and TF2 (bug 4374, r=dvander). 2010-04-29 16:06:32 -04:00
Nicholas Hastings dd97bdcc2c Fixed SetUserCvar offset for ep2v (bug 4371, r=fyren) 2010-04-29 14:12:08 -04:00
Nicholas Hastings b63e0f08bf Backed out changeset 907677755029 2010-04-29 14:11:03 -04:00
Nicholas Hastings c5ae9d45ad Fixed SetUserCvar offset for ep2v (bug 4371, r=fyren) 2010-04-29 14:05:22 -04:00
David Anderson e906a0da8c Merge. 2010-04-29 01:28:27 -07:00
David Anderson 2edfb0aaac Fixed regression when using panels (no bug, r=me). 2010-04-29 01:28:11 -07:00
Nicholas Hastings dc116858a9 ep2v gamedata (bug 4371, r=fyren) 2010-04-29 00:09:35 -07:00
Fyren 1a938f8711 ep2v build changes (bug 4371, r=dvander) 2010-04-29 00:08:08 -07:00
David Anderson fc88cd3cb1 Check return value of GetPlayerNetInfo (bug 4315, r=fyren). 2010-04-27 23:40:04 -07:00
David Anderson 55205e631b Merge. 2010-04-27 21:07:59 -07:00
David Anderson a36fa76d21 Root menu handles in callbacks (bug 4353, r=fyren). 2010-04-27 21:03:20 -07:00
Nicholas Hastings b8d512f5e1 Fixed entity output hooks not working in Insurgency (bug 4365, r=fyren) 2010-04-24 21:10:23 -04:00
Nicholas Hastings d4263b59c6 Added obsidian to list of games which support tempents with ep2 gamedata (thread 75480, r=me). 2010-04-24 21:08:06 -04:00
Nicholas Hastings e5e1507dff Fixed functions.inc not having double-include prevention (bug 4342, r=fyren) 2010-04-24 21:06:10 -04:00
Zach Kanzler 2edf63c5fd Fixed IGamePlayer->GetUserId() returning junk (bug 3916, r=fyren) 2010-04-24 21:00:43 -04:00
Fyren 5ec4b3441e Build stuff for L4D2 DLC (bug 4361, r=SAWCE) 2010-04-23 11:39:12 -07:00
Nicholas Hastings dd1757b3c3 Updated L4D2 gamedata for The Passing update (bug 4361, r=pending) 2010-04-23 14:22:41 -04:00
Nicholas Hastings dda26545e5 Updated Insurgency gamedata for Insurgency 2010-04-19 update (bug 4356, r=fyren) 2010-04-23 10:38:16 -04:00
Nicholas Hastings 410ef8ce96 Merge 2010-04-19 11:18:46 -04:00
Nicholas Hastings ce7cb9cf64 Added Notepad++ userDefineLang.xml generator for Sourcepawn
(based on the SP GeSHi generator)
2010-04-19 11:10:26 -04:00
Nicholas Hastings 31a16375ab Enhanced Sourcepawn GeSHi generation script
* Added a few missing keywords.
* Added better preprocessor, number, and string control char highlighting.
* Added default tab width (of 4 spaces).
* Fixed parsing of some enum values.
* Changed keywords to be case sensitive.
* Changed colors to be more sane.
2010-04-19 11:08:23 -04:00
Nicholas Hastings ec7b47da22 Updated Empires gamedata for Empires 2.25a release (bug 4108, r=fyren) 2010-04-19 10:38:28 -04:00
David Anderson 0124020ba4 Added obsidian to list of games which need menu redraws (thread 123237, r=me). 2010-04-04 23:50:27 -07:00
David Anderson 28f71d18bd Added obsidian to radiotimeout game list (t=123237, r=me). 2010-04-04 23:49:28 -07:00
Nicholas Hastings fe226c1c8d Updated sourcepawn GeSHi colors slightly to appease 2.53% of the haterz. 2010-03-31 18:40:03 -04:00
Nicholas Hastings 18e20de4d6 Added GeSHi language file generator for Sourcepawn 2010-03-31 14:27:09 -04:00
Nicholas Hastings 956d345e17 Added TF2_StunPlayer native and TF2_GetPlayerConditionFlags stock to TF2 ext. (bug 4331, r=pred) 2010-03-31 08:51:25 -04:00
Nicholas Hastings ddfb958647 Added missing semicolon in plugins/include/tf2.inc. 2010-03-23 20:06:13 -04:00
Nicholas Hastings 145d0ef37d Added Gamerules SDKCall support to CSPromod gamedata (bug 4320, r=pred) 2010-03-23 19:42:19 -04:00
Nicholas Hastings 019e3956f7 Fixed bad caller crash with HookEntityOutput (bug 4311, r=fyren) 2010-03-20 11:07:45 -04:00
Nicholas Hastings a72daff4ac Added 4 new natives to TF2 ext. (bug 4166, r=pred)
Added natives for Regenerate, add/remove condition, and SetPlayerPowerPlay. Also updated TF2 test plugin.
2010-03-18 11:35:05 -04:00
Nicholas Hastings 58ce9cd37f Added missing core voting cvars to sourcemod.cfg (bug 4309, r=fyren) 2010-03-11 22:00:46 -05:00
Nicholas Hastings 687bdaff8f Added missing core voting cvars to sourcemod.cfg (bug 4224, r=pred) 2010-03-11 17:43:46 -05:00
Nicholas Hastings 2143a66ad6 Fixed incorrect DispatchSpawn signature for ZPS and added ShowMenu and Hudtext support (bug 4279, r=Fyren) 2010-03-09 20:39:56 -05:00
Nicholas Hastings 74892f1562 Re-enabled ShowMenu support for FortressForever (bug 4028, r=dvander) 2010-03-09 18:50:47 -05:00
Nicholas Hastings 4a59ac011f Fixed FireOutput signature for FortressForever (bug 4062, r=dvander) 2010-03-09 18:47:56 -05:00
Nicholas Hastings e0fd2e8f27 Fixed sm_rename on L4D2 on Windows (bug 4131, r=dvander) 2010-03-09 18:44:18 -05:00
Nicholas Hastings ba76506773 Fixed inaccurate description for sm_unban (bug 4245, r=dvander) 2010-03-09 18:41:25 -05:00
Nicholas Hastings d224827544 Fixed CSPromod SDKTools Support (bug 4255, r=dvander) 2010-03-09 18:36:45 -05:00
Nicholas Hastings 8d35b5bd11 Updated PVKII support for PVKII 2.3 (bug 4276, r=dvander) 2010-03-09 18:29:31 -05:00
Nicholas Hastings 9df28c25d7 Fixed CreateGameRulesObject sig for ZPS (bug 4285, r=dvander). 2010-03-09 18:13:21 -05:00
Matt Woodrow 5f9b2a91fd Added optional 'No Vote' option to vote menu (bug 4217, r=dvander) 2010-02-27 14:56:02 +13:00
Erik Minekus 46a46f5e49 Fixed Insurgency gamedata file (bug 4282, r=dvander). 2010-02-24 23:41:06 -08:00
Liam 4bdc495d01 Corrected a typo in the string.inc file. (bug 4207, r=fyren) 2010-02-13 01:49:39 -05:00
Liam e60d5e6aeb Updated VC2010 files. 2010-02-13 01:13:43 -05:00
UNLOZE 7c3387755d Added MSVC10 files for Visual Studio 2010 support. 2010-02-13 00:40:53 -05:00
Fyren 6f04dad428 maxClients -> MaxClients in sdktools_sound.inc (fix bug 3985, r=psychonicsux) 2010-02-10 11:07:21 -08:00
Nicholas Hastings 6ed4720df3 Added missing file for Battlegrounds support (bug 4146). 2010-02-08 20:47:51 -08:00
Nicholas Hastings ac7b454039 Added SDKTools support for CSProMod (bug 4255, r=dvander) 2010-02-08 20:25:11 -08:00
Nicholas Hastings 0af39de346 Fixed base plugins using GetMaxClients() instead of MaxClients (bug 3985, r=dvander). 2010-02-08 20:14:52 -08:00
Nicholas Hastings d484979fe8 Fixed CreateEntityByName for Insurgency (bug 4180, r=dvander). 2010-02-08 20:10:24 -08:00
Nicholas Hastings 6e87e5c05f Updated Garry's Mod offsets (bug 4230, r=dvander). 2010-02-08 20:08:14 -08:00
Nicholas Hastings 7633c8e76e Fixed nextmap errors on Garry's Mod (bug 4268, r=dvander). 2010-02-08 20:06:48 -08:00
Fyren c78e89c3c1 Compiler confused |any| tag with |String| on array arguments. 2010-02-08 20:00:06 -08:00
David Anderson 1852aaf332 Fixed GetClientCookieTime not being exported (bug 4237, r=fyren). 2010-02-08 19:58:36 -08:00
Nicholas Hastings 8b4c8f63c0 Fixed FindEntityByClassname crash in Synergy (bug 4235, r=dvander). 2010-02-08 19:57:20 -08:00
Fyren d7b64c18c2 Fixed NULL-deref in entity handling code. 2010-02-08 19:55:14 -08:00
Nicholas Hastings 09668c972e Fixed Day of Defeat offsets for 20100203 update (bug 4262, r=dvander). 2010-02-04 19:28:06 -06:00
Scott Ehlert 68a0d10443 Webternet and Updater extensions now load on Windows 2000 (bug 4234, r=dvander). 2010-01-20 15:12:57 -06:00
David Anderson 0708e7f8f6 Fixed accidental hook against garbage offset (bug 4231, r=fyren). 2010-01-20 04:03:46 -08:00
David Anderson 1235e989d4 Added PlayerRunCmd offset for DoD:s (bug 4231 mitigation, r=me). 2010-01-20 04:01:39 -08:00
Scott Ehlert 3a6808e4d8 Updated .hgignore for Explorer files beginning with a lowercase letter (argh!) 2010-01-20 02:40:55 -06:00
David Anderson dbfb034548 Mercurial queues... oh, how terrible. 2010-01-18 03:20:44 -08:00
David Anderson 94d01e9e5a Moved CRC32 from core to logic (no bug, r=me). 2010-01-18 03:08:52 -08:00
David Anderson 5e48b49b7e Updated credits for 1.3 release. 2010-01-14 03:29:31 -08:00
Greyscale 3b0785cae0 Fixed missing #endif in adminmenu.inc (bug 4216, r=dvander). 2010-01-14 00:22:45 -08:00
David Anderson bd3b46d624 Fixed command listener spew on server shutdown (bug 4198, r=fyren). 2010-01-13 21:48:51 -08:00
David Anderson 1cbe996831 Linux build fix (bug 3520 fallout). 2010-01-11 22:50:44 -08:00
Downtown1 18865c44c8 Added a new ValveCallType that allows for arbitrary |this| parameters, as well as associated features in gamedata and for reading/writing memory (bug 3520, r=dvander, sr=fyren). 2010-01-11 22:46:44 -08:00
David Anderson ead6ca73e5 Triggering build. 2010-01-11 20:09:34 -08:00
Nicholas Hastings deb3f6d9c4 Changed basechat to use %N instead of GetClientName (bug 4205, r=dvander). 2010-01-10 17:57:34 -08:00
Nicholas Hastings b1b98c5256 Fixed basechat not using color messages on hl2mp (bug 4204, r=dvander). 2010-01-10 17:51:24 -08:00
Nicholas Hastings 4dc2227f23 Fixed lack of quotes on some basechat log messages (bug 4132, r=dvander). 2010-01-10 17:50:30 -08:00
David Anderson a76f9e11fb Backed out changeset 9a52d61fe6ba (bad commit). 2010-01-10 17:49:44 -08:00
Nicholas Hastings abeb91a5e4 Fixed lack of quotes on some basechat log messages (bug 4132, r=dvander). 2010-01-10 17:47:11 -08:00
Nicholas Hastings 6d5e7cbe08 Added missing SDK define for L4D2 (bug 4209, r=dvander). 2010-01-10 17:38:03 -08:00
Nicholas Hastings c468c26ad6 Follow-up to bug 4194 (r=dvander). 2010-01-10 17:29:32 -08:00
David Anderson a0e940c5a9 Merge. 2010-01-10 17:16:08 -08:00
David Anderson 2f1de22cae Backed out changeset 292be4eb9d0c (bug 4211). 2010-01-10 17:16:02 -08:00
David Anderson 4631282709 Fixed reentrancy problems with iterators, forwards, and function removals (bug
4059, r=fyren).
2010-01-10 16:58:17 -08:00
Fyren 306ac5243a Fixed GuessSDKVersion() not working on ep2v (bug 4194, r=dvander). 2010-01-09 11:33:19 -08:00
Nicholas Hastings 956fe42a6c Fixed SetUserCvar (sm_rename) on TF/DoD Linux (bug 4196, r=dvander). 2010-01-07 01:26:01 -08:00
Nicholas Hastings 1824bdfe7e Add Insurgency to list of games that support HUD messages (bug 4136, r=dvander). 2009-12-19 20:42:32 -08:00
David Anderson 5f53284cbd Fixed build, wrong enum comparison. 2009-12-19 18:25:56 -08:00
David Anderson 7a84b71eb2 Fixed crashes from rare plugin loading errors (bug 4153, r=ds). 2009-12-19 18:19:28 -08:00
David Anderson 85382cd6c2 Fixed SourceMod crashing after flushing the profiler (bug 4149, r=ds). 2009-12-19 18:18:17 -08:00
David Anderson 02a99f1e51 Add ability to change dontBroadcast status on hooked events (bug 3886, r=ds). 2009-12-19 18:16:41 -08:00
Nicholas Hastings fe405df704 Another TF2 gamedata fix (bug 4151, r=dvander). 2009-12-19 12:57:26 -08:00
Nicholas Hastings ac5ee90c9b Battlegrounds 2 gamedata support (bug 4146, r=dvander). 2009-12-19 00:03:57 -08:00
Nicholas Hastings fb6b34e155 TF2 gamedata updates (bug 4147, r=dvander). 2009-12-18 22:01:41 -08:00
Fyren caa8932c9a Improve/fix GetEntity (bug 4092, r=pred) 2009-12-15 23:14:53 -08:00
David Anderson 75611f3bca Fixed profiler being set to NULL (bug 4143, r=fyren). 2009-12-14 23:08:15 -08:00
David Anderson f0f14d8a22 Fixed infinite loop in Windows build failure path (bug 4144, r=ds). 2009-12-14 23:07:54 -08:00
Nicholas Hastings 98ad6cd23b Fixed CreateEntityByName for Insurgency (bug 4046, r=dvander). 2009-12-14 20:31:16 -08:00
Nicholas Hastings bd80d1cd76 Updated Synergy gamedata (bug 3987, r=dvander). 2009-12-14 20:30:44 -08:00
Nicholas Hastings 5a4670ec2f Added HudText support for Zombie Master (bug 4004, r=dvander). 2009-12-14 20:30:04 -08:00
Nicholas Hastings 6fd039925a Added Neotokyo support (bug 4126, r=dvander). 2009-12-14 20:29:23 -08:00
David Anderson cd602ab5e3 Fixed basecomm description spelling (bug 4112, r=me). 2009-12-14 20:27:26 -08:00
Dog f59ead54d3 Fixed CommitSuicide offset on DoD:S (bug 4109, r=dvander). 2009-12-14 20:26:45 -08:00
Fyren 4030f1e40d Merge 2009-11-23 01:50:28 -08:00
Fyren b7ac7452f7 Fix wonky handling of path separators for "sm plugins" commands (bug 3857, r=dvander) 2009-11-23 01:47:32 -08:00
Scott Ehlert 5dd6867408 Updated .hgignore to ignore some Windows and OS X files. 2009-11-22 01:39:29 -06:00
Scott Ehlert 9d410df287 Updated sample_ext and mms_sample_ext for Orange Box Valve and Left 4 Dead 2 (bug 4118, r=pred). 2009-11-22 01:33:08 -06:00
David Anderson fe8dc36074 Use GetVSPInfo() from MM:S 1.8 legacy API (bug 4081, r=ds). 2009-11-20 15:18:58 -06:00
Fyren 0cef3fbf27 Fix leak in nominations plugin (bug 4104, r=pred) 2009-11-18 15:44:51 -08:00
Fyren b5d9b18da4 Fix rare basevotes map vote problem (bug 3905, r=dvander) 2009-11-18 15:42:21 -08:00
Scott Ehlert dc0ea197cd Added IMemoryUtils::ResolveSymbol() for resolving symbols hidden via GCC's -fvisibility=hidden (bug 4091, r=dvander,pred).
Right now, this is only used on L4D2 where it is needed.
2009-11-06 16:24:40 -06:00
David Anderson 5bf17fc5ae Clarified handle invariants in clientprefs.inc (no bug, r=me). 2009-11-04 13:52:12 -05:00
Fyren 33ca5943fa Don't call edict_t::StateChanged(ushort) on L4D2 (bug 4090, r=dvander) 2009-11-01 02:53:34 -08:00
Scott Ehlert edc6591041 Use SOURCE_ENGINE_ORANGEBOXVALVE constant from MM:S 1.8 (bug 4087, r=dvander). 2009-10-30 14:04:43 -05:00
Fyren 113ec33743 More L4D2 gamedata changes 2009-10-30 01:24:55 -07:00
Scott Ehlert 8c297832f6 Fixed Windows build, I think. 2009-10-30 00:03:54 -05:00
Fyren e767b2ff94 Typo fix 2009-10-29 20:34:00 -07:00
Scott Ehlert a1ff408c13 Merge. 2009-10-29 21:47:27 -05:00
Matt Woodrow 440184e83c New sdk uses _linux for vstdlib/tier0 2009-10-30 15:20:48 +13:00
Matt Woodrow 8ee6cad7ea Build Trigger 2009-10-30 15:10:34 +13:00
Matt Woodrow edb17b76f0 AMBuild updated to use new MM:S version 2009-10-30 14:58:17 +13:00
Fyren 31dc5f335d Updated GuessSDKVersion 2009-10-30 14:34:34 +13:00
Matt Woodrow eb68e4c627 SourceMod MSVC project files updated, windows tested and loading, gamedata fix. 2009-10-30 14:29:45 +13:00
Matt Woodrow 98e97920ae AMBuild updated for new L4D2 engine 2009-10-30 13:27:19 +13:00
Matt Woodrow 533723cd8b L4D2 gamedata updates 2009-10-30 13:27:05 +13:00
Fyren 9e69afbbd6 Inital SM fixes for l4d2 and linux makefile updates 2009-10-30 13:26:13 +13:00
Scott Ehlert 2dea76dfa1 Changed name in credits. 2009-10-29 17:35:00 -05:00
David Anderson 8a8bafb199 Use GetSourceEngineBuild() from MM:S 1.8 legacy API (bug 4083, r=ds). 2009-10-29 01:33:57 -07:00
David Anderson 5a21d8c24d Let SourceMod use OnUnlinkConCommandBase from MM:S 1.8 legacy API (bug 4080, r=ds). 2009-10-29 00:53:31 -07:00
David Anderson 5111b4799c Fix iloop race when using AddCommandListener and SourceMod unloads (bug 4077, r=pred). 2009-10-29 00:06:12 -07:00
David Anderson 528bbe0116 Build against MM:S 1.8 with core-legacy (bug 4076, r=ds). 2009-10-28 23:30:52 -07:00
David Anderson 3030ab8664 Fixed crash when activating command listeners on EP1 while inside a command callback (bug 4072, r=pred). 2009-10-28 00:50:48 -07:00
David Anderson 2698ff1a04 Added feature testing functionality (bug 4021, r=pred). 2009-10-28 00:37:34 -07:00
David Anderson 084dd1c8dd Build fix. 2009-10-28 00:31:48 -07:00
David Anderson a8392889de Fix maphistory command not returning a value (bug 4069, r=pred). 2009-10-28 00:08:15 -07:00
David Anderson 3bf5edc2b3 Added @spec target (bug 2718, r=fyren). 2009-10-27 03:41:36 -07:00
David Anderson 97be0ff22a Bumped trunk version. 2009-10-27 03:11:34 -07:00
David Anderson b43c8c018b Warn user when adminmenu_custom is going to emit duplicate entries (bug 3894, r=pred). 2009-10-27 01:43:51 -07:00
David Anderson 38a5a4b97b Increase display lengths on custom menus (bug 3677, r=pred). 2009-10-27 01:37:19 -07:00
Matt Woodrow 73d70b6953 Fixed bug in entity output hooks (bug 3988, r=fyren). 2009-10-27 00:03:59 -07:00
David Anderson 6b06733192 Added better random number generator (bug 3831, r=fyren). 2009-10-26 23:59:59 -07:00
David Anderson 359146f60b Don't pass unconnected clients into OnClientCommand (bug 3732, r=fyren). 2009-10-26 23:51:39 -07:00
Fyren 0931c6a7e1 Fix OnConfigsExecuted() executing too early on EP1 with large config files (bug 3828, r=dvander). 2009-10-26 23:44:57 -07:00
Fyren f2049c5910 Fix menu population for sm_who (bug 4030, r=pred) 2009-10-20 15:48:56 -07:00
David Anderson de76827dd8 Fixed using war mode not load_unlocking before reloading (bug 3869, r=pred). 2009-09-27 02:25:32 -04:00
David Anderson 0cae3ac5a1 Use case-insensitive game folder matches for Windows (bug 3913, r=pred). 2009-09-27 02:19:17 -04:00
David Anderson 4fc378d3e2 Target filters now run for "@me" special target (bug 4000, r=pred). 2009-09-27 02:17:23 -04:00
Scott Ehlert e3e11d233c Merge. 2009-10-06 13:37:59 -05:00
Scott Ehlert fcfd5c7419 Fixed crash when a plugin was unloaded before a client convar query had returned results (bug 4044, r=dvander). 2009-10-06 13:37:30 -05:00
Erik Minekus be8c498aea Fix help message for sm cvars (bug 3994, r=dvander). 2009-10-06 03:15:10 -07:00
TESLA-X4 5528b9ba09 HL2DM support for OnPlayerRunCmd (bug 3914, r=dvander). 2009-10-06 03:13:44 -07:00
Nicholas Hastings c60877b6f2 GoldenEye:Source supports ShowMenu (bug 3747, r=dvander). 2009-10-06 03:06:02 -07:00
Scott Ehlert 07901946d0 Fixed building of libcurl on Linux when a build clobber is done. 2009-10-06 01:52:08 -05:00
Scott Ehlert 705ea18b2a Really fixed version.rc file problem by removing and recreating build OUTPUT directory when required (bug 4042, r=dvander). 2009-10-06 01:46:06 -05:00
Scott Ehlert 3277cc3675 Fixed case where version.rc files could have incorrect version number (bug 4042, r=dvander). 2009-10-04 00:52:53 -05:00
David Anderson c09b7bed34 Updated to latest GeoLite Country database (OCT-2009). 2009-10-02 05:08:14 -07:00
Fyren 83e633534d New L4D offset for SetUserCvar (bug 4033, r=dvander). 2009-10-02 04:59:47 -07:00
David Anderson 8a2c299653 Fixed rare crash involving hudtext code and maxclient shifts (bug 4016, r=fyren). 2009-10-02 04:30:46 -07:00
David Anderson 74dc2ed1f9 Re-enabled PDB files. 2009-10-02 03:47:42 -07:00
David Anderson dc0d6a9b4a Fixed crash when reloading blocked plugins fails (bug 4038, r+a=fyren). 2009-10-02 03:33:59 -07:00
David Anderson 3f264097a7 Removed unused files. 2009-10-02 03:30:54 -07:00
Nicholas Hastings e0c7b17bd5 Updated GiveNamedItem for latest L4D update (bug 4035, r=dvander). 2009-10-02 02:35:25 -07:00
Fyren d43b027c25 Fixed crash when block-loading more than 8 plugins (bug 4034, r=dvander). 2009-10-02 02:30:01 -07:00
Eric Minekus 85963cafe7 Fixed several plugins excluding the last client from loops (bug 3984, r=dvander). 2009-10-02 02:26:11 -07:00
Fyren d4deeb4edd Puuuuuush for SDK change (bug 4032) 2009-10-01 08:48:57 -07:00
David Anderson c72bfe3685 Another forgotten-file for bug 4015. Thanks mqueues. 2009-09-26 17:19:47 -04:00
David Anderson 90137f2263 Follow-up to bug 4015: apparently hg patch doesn't commit added files. 2009-09-26 17:14:50 -04:00
David Anderson d8474cfafa Added generic command hooking mechanism, to replace Reg*Cmd which is intended for command creation (bug 4015, r=pred). 2009-09-26 17:12:23 -04:00
Matt Schubert 493a756aaa Typo; missed a quotation mark 2009-09-17 13:08:18 -04:00
Matt Schubert 95d30ba4ec Fixed the Huntsman not firing CalcIsAttackCritical (bug 3927, r=dvander) 2009-09-17 12:42:58 -04:00
Matt Woodrow dbcb3e6192 Merge 2009-09-17 19:04:15 +12:00
Matt Woodrow 4228642b53 Rockthevote 'already voted' message now displays RTV progress (bug 4011, r=Fyren) 2009-09-17 18:55:40 +12:00
Matt Woodrow acba87ae46 Added voting output (bug 1997, r=dvander) 2009-09-17 18:54:40 +12:00
David Anderson 533f17b3b0 Block plugins from registering "sm" command (bug 4013, r=pred). 2009-09-16 22:37:20 -07:00
Matt Woodrow 77de71d79d Fixed gnprintf's translation parameter reordering (bug 4010, r=dvander) 2009-09-16 13:38:04 +12:00
David Anderson caadb7fa27 Fixed invalid array access in PluginSys (bug 3933, r=pred). 2009-09-07 21:29:18 -07:00
David Anderson 1dd862f83d Build fix, bug 3818 fallout. 2009-09-07 17:15:47 -07:00
Fyren 70bb4930f6 Respect clientside mutes and add fixed client listening API (bug 3818, r=pred,dvander). 2009-09-07 17:09:28 -07:00
David Anderson 852eb5c524 Fixed BanClient() crashing if called before certain callbacks (bug 3912, r=pred). 2009-09-07 16:21:48 -07:00
Matt Woodrow 3cfc45c4e8 Fixed TR_GetEntityIndex returning -1 for world ent hits (Logical entities bcompat break) 2009-09-05 19:36:12 +12:00
David Anderson db97c2a5b1 Thanks, Python. 2009-08-30 17:27:44 -07:00
David Anderson 70993256b9 Added -lpthread to sourcemod.logic binary. 2009-08-30 17:26:03 -07:00
David Anderson a439c3be3c Added sourcemod.logic to package script. 2009-08-30 12:06:32 -07:00
David Anderson 0a060982e3 Fixed extension version reporting. 2009-08-30 01:54:45 -07:00
David Anderson 7ffcc176cd Fixed build failure in profiler. 2009-08-30 01:43:05 -07:00
David Anderson 4a9650df80 Added missing version file. 2009-08-30 01:40:39 -07:00
David Anderson f1c6f09f98 Added missing configure script. 2009-08-30 01:38:28 -07:00
David Anderson f039c0636e More build fixes. 2009-08-30 01:34:24 -07:00
David Anderson a620e1490c Build fixes. 2009-08-30 01:19:32 -07:00
David Anderson d682361cfc More changes for new build system. 2009-08-30 00:46:56 -07:00
David Anderson d3f0a14867 Imported support for new build system. 2009-08-30 00:21:42 -07:00
David Anderson 83393f299a Removed auto folders (bug 3949). 2009-08-30 00:03:58 -07:00
Matt Woodrow bf1285567e Build fix 2009-08-24 09:41:53 +12:00
DaFox e315726001 Added PointOutsideWorld native to sdktools (bug 3906, r=dvander) 2009-08-24 09:19:42 +12:00
Erik Minekus 2f3e172162 Added "motd" chat trigger to basetriggers (bug 2694, r=dvander) 2009-08-24 09:13:37 +12:00
Kornelijus Survila d6cf9bd8ae Added manual extension reloading command to root console menu (bug 3934, r=dvander) 2009-08-24 09:11:42 +12:00
Zach Kanzler 5710a35388 Added Kick, Ban and IsInKickQueue to public extension API (bug 3907, r=dvander) 2009-08-24 09:05:54 +12:00
Mr E. Unknown 1156d00538 Fixed 'list' type custom menu entries overwriting admin restrictions (bug 3783, r=pred) 2009-08-24 09:02:10 +12:00
Downtown1 5707354a18 Added sm_resetcvar command to basecommands (bug 3636, r=pred) 2009-08-24 08:55:34 +12:00
Matt Schubert 155cc4573c Fixed ForceRespawn offset for TF2 2009-08-20 03:02:43 -04:00
Matt Woodrow 3288592d30 Fixed tf2 build configs 2009-08-17 11:07:14 +12:00
Matt Woodrow 886b683739 Makefile fix 2009-08-17 10:54:57 +12:00
Matt Woodrow 95cffca5f1 Forgot makefiles patch 2009-08-17 10:53:54 +12:00
Matt Woodrow 85cb592a7e Fixed typo in the build tool 2009-08-17 10:44:35 +12:00
Matt Woodrow 13b9deb5ef Merged the build fixes (hopefully) 2009-08-17 10:42:01 +12:00
Matt Woodrow c307c692a0 Copy of new tf engine changes from 1.2 branch 2009-08-17 10:03:53 +12:00
David Anderson 008e98d980 Fixed incorrect escaping in clientprefs SQLite queries (bug 3904, r+a12=pred). 2009-08-10 22:16:58 -04:00
Fyren b11f597521 Fix SetClientViewModel (bug 3941, r=pred) 2009-08-09 15:35:49 -07:00
Matt Woodrow 944c523a49 Fixed incparser for new functag format and added a sample Crimson Editor template 2009-08-09 14:03:50 +12:00
psychonic 3c365259cc Synergy gamedata updates (bug 3315, r=dvander) 2009-07-30 17:17:48 -07:00
David Anderson 98274d4b17 Linux build of pcre-7.9 (bug 3923). 2009-07-28 12:56:16 -05:00
David Anderson 12a1cb9e97 Check-in of pcre-7.9 source code and win32 static lib (bug 3923). 2009-07-28 17:51:34 -04:00
Matt Woodrow d273750849 Mergé 2009-07-28 15:06:57 +12:00
Matt Woodrow 75c54c6738 Fixed regression with sound natives (bug 3918, r=dvander) 2009-07-28 15:05:47 +12:00
Fyren ffd72fbb4d Improve non-admin to admin chat (bug 3844, r=pred) 2009-07-27 17:02:04 -07:00
Fyren 71dc3d4826 Make Insurgency use SayText for printing to chat (bug 3738, r=dvander) 2009-07-27 16:45:30 -07:00
psychonic b7757d71bf Insurgency gamedata updates (bug 3511, r=dvander) 2009-07-27 16:17:13 -07:00
psychonic 55338e731b ZM gamedata updates (bug 3746, r=dvander) 2009-07-27 16:16:33 -07:00
psychonic 097aa3fa16 Empires gamedata updates (bug 3500, r=dvander) 2009-07-27 16:13:55 -07:00
psychonic 935d6a7cf5 ZPS gamedata updates (bug 3877, r=dvander) 2009-07-27 16:04:43 -07:00
psychonic c69d1c7fb8 AoC gamedata updates (bug 3891, r=dvander) 2009-07-27 13:30:01 -07:00
Fyren b5152c0c48 Fix sm_corecfgfile for modified sm_basepaths (bug 3856, r=dvander) 2009-07-27 13:22:55 -07:00
Matt Woodrow ed02df113f A newline again? Really? 2009-07-24 13:17:26 +12:00
Matt Woodrow 2afdcf54ab I surrender GCC! Please? 2009-07-24 13:09:06 +12:00
Matt Woodrow 764fbe7fac A merge? 2009-07-24 12:59:13 +12:00
Matt Woodrow 0c9160ec8b More build fix attempts 2009-07-24 12:54:08 +12:00
Matt Woodrow 33bed487ac Please GCC? 2009-07-24 12:43:13 +12:00
Matt Woodrow 3e36382b58 Added support for logical (non-networked) entities using entity references - See http://wiki.alliedmods.net/Entity_References_%28SourceMod%29 (bug 2459, r=dvander) 2009-07-24 12:34:31 +12:00
Matt Schubert 7ec656db09 Fix RemoveDisguise Windows signature for TF2 2009-07-09 17:51:12 -04:00
Matt Schubert cf61779b08 Backed out changeset a42b24399f60 2009-07-09 17:49:26 -04:00
Matt Schubert 71600a4f37 Fix RemoveDisguise Windows signature for TF2 (bug 3892) 2009-07-09 17:45:20 -04:00
Fyren 14320f2155 Fix PlayerRunCmd offset for TF2 2009-06-16 19:41:44 -07:00
David Anderson 1923368353 Fixed build. 2009-05-30 20:04:55 -04:00
David Anderson 752bd78de5 Fixed compiler asserting when returning a string literal (bug 3836, r=fyren). 2009-05-30 20:03:56 -04:00
David Anderson c4b17855e5 Fixed compiler erroring when tagging functions for string return (bug 3837, r=fyren). 2009-05-30 20:03:01 -04:00
David Anderson a1543f79cb Fixed compiler not handling constant chained relational operators correctly (bug 3838, r=fyren). 2009-05-30 20:02:05 -04:00
David Anderson d4798ccaa5 Fixed revote bug and inflexibilities in RedrawClientVoteMenu (bug 3834, r=fyren). 2009-05-30 19:59:55 -04:00
Fyren c2c4ed1fe5 Fix crash when unloading a plugin with live user message hooks (bug 3817, r=dvander) 2009-05-25 18:12:26 -07:00
David Anderson 614188c82b Fixed compiler using NDEBUG in debug builds (bug 3815, r=fyren). 2009-05-24 12:08:27 -04:00
David Anderson 53e98c114a Fixed Plugin_Handled acting like a Stop in usermsg hooks (bug 3685, r=fyren). 2009-05-24 12:01:18 -04:00
Fyren 73c8246204 Preliminary TF2 gamedata changes 2009-05-21 20:43:22 -07:00
Matt Woodrow 58d98f8454 Fixed crash on client disconnect 2009-05-19 15:16:25 +12:00
Fyren 7605396e84 Add L4D handling to GuessSDKVersion() (bug 3842, r=dvander) 2009-05-16 16:32:21 -07:00
"David Anderson cec339552e Moved smn_functions to logic binary.
--HG--
rename : core/smn_functions.cpp => core/logic/smn_functions.cpp
2009-05-14 11:38:50 -04:00
"David Anderson fc003db139 Updated MSVC9 files. 2009-05-14 11:28:43 -04:00
"David Anderson caf434aef2 Moved profiler and adt_trie to logic binary.
--HG--
rename : core/Profiler.cpp => core/logic/Profiler.cpp
rename : core/Profiler.h => core/logic/Profiler.h
rename : core/smn_adt_trie.cpp => core/logic/smn_adt_trie.cpp
2009-05-14 11:24:07 -04:00
David Anderson 5261873f39 Fixed Linux build. 2009-05-13 22:07:11 -04:00
David Anderson 421b58f68e Import of core modularization plan (bug 3599). 2009-05-13 21:55:50 -04:00
Fyren 850dbd62c6 Fix pred's failed l2merge merge 2009-05-13 16:24:55 -07:00
David Anderson 2af45da0a8 Merge from 1.2 branch. 2009-05-12 19:43:21 -04:00
David Anderson 685e8bac22 DOS line endings to match 1.2 branch. 2009-05-12 19:43:02 -04:00
David Anderson e2a6ae9ecc Central place to mark releases so buildbot symbols aren't scrapped by purge script (bug 3809, r=me, a12=NPOTB). 2009-05-12 19:06:57 -04:00
David Anderson eb64e66e9f Fixed crash when clientprefs saw disconnect from 64th client (bug 3821, r=pred). 2009-05-12 17:28:43 -04:00
Fyren 6a24b049cb Fixed early tv_enable causing crashes (bug 3766, r=dvander). 2009-05-12 17:27:45 -04:00
David Anderson 1112dfffb3 Merge. 2009-05-12 17:26:47 -04:00
David Anderson 3304bc2f3a Backed out changeset 97d5f4dbae0b 2009-05-12 17:26:39 -04:00
David Anderson 4d2bee192f FortressForever does not support radio menus (bug 3819, r+a12=me). 2009-05-12 12:59:11 -04:00
David Anderson 2d4fb8a463 Merge. 2009-05-12 12:37:24 -04:00
Fyren 56c5012bef Fixed early tv_enable causing crashes (bug 3766, r=dvander). 2009-05-12 12:37:12 -04:00
Fyren 47002f970d Fix bad bintools assert that will always fail in debug (r=pred) 2009-05-11 19:45:51 -07:00
Matt Woodrow f6fd395485 I dislike you GCC 2009-05-12 14:19:06 +12:00
Matt Woodrow 4f426dafef Merged, thanks Fyren 2009-05-12 13:56:00 +12:00
Matt Woodrow 7b6f2863a9 Added PlayerRunCmd hook to sdktools (bug 3289, r=dvander) 2009-05-12 13:54:06 +12:00
Fyren 834a9bc84d Some sdktools string and style changes (r=pred) 2009-05-11 18:46:19 -07:00
Matt Woodrow 7710a1fdb0 Merge from 1.2 branch 2009-05-11 11:45:08 +12:00
Matt Woodrow bd97bdd378 Fixed unhook event crash (bug 3814, r=dvander) 2009-05-11 11:32:59 +12:00
David Anderson 211c5dcfcd Fixed compiler reading uninitialized strings while processing varargs (bug 3811, r=fyren,pred, a12=blocking). 2009-05-10 11:01:19 -04:00
David Anderson 2cdf1897b9 Merge. 2009-05-09 09:24:04 -04:00
David Anderson bf8c57c669 Fixed compiler choosing whether to emit stradjust.pri on dynamic arrays based on uninitialized memory (bug 3810, r=fyren,pred, a12=blocking). 2009-05-09 09:21:14 -04:00
Fyren 7fd6b308f8 Fix Windows L4D CreateFakeClient signature (bug 3792) 2009-05-08 00:10:12 -07:00
Fyren 6908c0f1d0 Fix sdktools MSVC9 project file (and sm_slap) for EP1 games (bug 3768) 2009-05-07 20:15:32 -07:00
Fyren f74380b3e9 Fix casting problems in TextParsers breaking TrimString for non-ASCII (bug 3800, r+a12=dvander) 2009-05-03 11:23:12 -07:00
Matt Woodrow 4abdc29d9e l2merge Fyren 2009-04-24 18:20:55 +12:00
Fyren 5096aef6e7 Remove knife critical stuff and previous "fix" (bug 3791, r=pred) 2009-04-22 19:06:19 -07:00
Fyren d9f5801a68 I can in no way find fault with myself, so I blame buildbot. 2009-04-21 17:55:14 -07:00
Fyren 462e03d150 Fix medigun/CalcIsAttackCritical Windows crash (bug 3791, r=pred) 2009-04-21 02:38:35 -07:00
Fyren 6aded88e14 Fixed CommitSuicide offset for today's TF2 update 2009-04-20 21:38:12 -07:00
Fyren 74a25097b2 Fix OnClientConnect rejectmsg handling, improve doc (bug 3690, r=dvander) 2009-04-13 16:39:53 -07:00
Matt Woodrow 2c190f502f Added new playerhelpers interface 2009-04-13 10:02:55 +12:00
Matt Woodrow 0122686541 Clientprefs now loads cookies for clients on late load (bug 3735, r=dvander) 2009-04-13 09:50:46 +12:00
Fyren 187c0a9bf7 Fix GetCommandFlags for original engine games (bug 3759, r=dvander) 2009-04-07 17:24:22 -07:00
Fyren a4295d1e93 Add a warning to not edit SM's gamedata files; switched to UNIX line endings (bug 3728, r=dvander) 2009-04-07 09:59:21 -07:00
Fyren 9def5e57de Disable nextmap in Synergy and Dystopia (bug 3687, bug 3741; r=liam) 2009-04-01 05:56:51 -07:00
Fyren 3d573c08a1 Fix CommitSuicide offset (bug 3726, r=Srdog) 2009-04-01 04:35:51 -07:00
Fyren c9ff6be881 Fix CommitSuicide offset (bug 3726, r=Srdog) 2009-04-01 04:34:01 -07:00
David Anderson 40a8892cb7 Merge from sourcemod-1.2 branch. 2009-03-30 11:43:16 +02:00
David Anderson e1bb10d859 Removed SSE optimizations from msvc9 project files (bug 3756, r=ds, a12=blocking). 2009-03-30 08:31:35 +02:00
David Anderson 569f4646a0 Fixed builder not passing GCC version in some cases (bug 3750, r=ds, a12=ds). 2009-03-30 08:29:47 +02:00
David Anderson 16756e550f Handle FormatMessage failures from LoadLibrary oddities (bug 3760, r=fyren). 2009-03-29 09:01:40 -04:00
Fyren 933b77e429 Fix sm exts info help message 2009-03-25 21:01:40 -07:00
David Anderson 3ac9ecb4b7 Removed tag system (bug 3751, r=fyren, a12=blocking). 2009-03-25 03:27:32 -04:00
Fyren ccc4386285 Let vtablecheck take class names instead of just vtable symbols (also fix line endings) 2009-03-21 18:17:43 -07:00
Fyren 4364ba46e2 Switch base plugins to APL2; disable nextmap for L4D, Dystopia, Synergy (bugs 3716, 3687, 3741; r=pred) 2009-03-18 22:10:39 -07:00
Fyren d7917a6a9a Add AskPluginLoad2() to allow silent failure, deprecate AskPluginLoad() (bug 3716, r=dvander) 2009-03-18 19:20:40 -07:00
Fyren 81e30e75c4 Merge: this'll teach me to not pull first 2009-03-18 19:15:40 -07:00
Fyren 7a94343dec Fix/restore TF2_IgnitePlayer (bug 3528, r=pred) 2009-03-18 18:50:31 -07:00
Fyren 3ee6bae4ba Fix/restore TF2_IgnitePlayer (bug 3528, r=pred) 2009-03-18 18:50:20 -07:00
Fyren 9a77e6b3cc Gave OnClientAuthorized() its meds. 2009-03-18 18:34:46 -07:00
Fyren a1727cc047 vim syntax file and a perl script to generate a syntax file from the includes 2009-03-18 18:30:35 -07:00
Matt Woodrow 5b012b6509 Merge 2009-03-17 12:31:10 +13:00
Matt Woodrow c23ffa2ce5 Added GetClientCookieTime native (bug 3736, r=dvander) 2009-03-17 12:30:21 +13:00
Matt Woodrow ff68383732 Added GetClientCookieTime native (bug 3736, r=dvander) 2009-03-17 12:29:10 +13:00
Matt Woodrow bce2b2adb6 Added new playerhelpers interface 2009-03-17 12:28:37 +13:00
Matt Woodrow fa8c9a8418 Clientprefs now loads cookies for clients on late load (bug 3735, r=dvander) 2009-03-17 12:28:05 +13:00
David Anderson 2e176b8b8d Fixed auto update URL being set too late (bug 3699, r=pred). 2009-03-16 18:43:34 -04:00
Fyren f6bb6037f3 Allow spaces in compiler command line options (bug 3729, r=dvander) 2009-03-12 18:37:04 -07:00
Scott Ehlert 7fac7c8713 Pushing a build to test buildbot against mercurial 1.2. 2009-03-09 06:38:20 -05:00
David Anderson bdaef0b0dc Pushing build to test buildbot. 2009-03-09 01:21:01 -04:00
Liam 5b21fc89fc Fixed typo in code that broke buildbot. (Bug 3698 r=Liam) 2009-03-07 23:27:10 -05:00
Liam bc7b90a1b4 Removed the alive check from sm_rename. Improved mod support between various engines. (Bug 3698 r=pred) 2009-03-07 17:11:11 -05:00
Liam 134cb68396 Removed the alive check from sm_rename. Added in additional support for CSS / OB engines. 2009-03-07 16:58:14 -05:00
David Anderson c0ee2ce345 Fixed assorted updater bugs (bug 3697, r=pred, a121=blocking). 2009-03-06 17:41:35 -05:00
David Anderson a299533508 Bumping merge node so buildbot doesn't puke. 2009-03-06 14:45:03 -05:00
David Anderson d4bcbc3771 Merge from 1.2 branch. 2009-03-06 14:44:25 -05:00
Fyren 2c7555366f Fixed SetEntityHealth (bug 3693, r+a12=dvander). 2009-03-06 14:40:30 -05:00
Scott Ehlert d8264fada7 Merge from 1.2 branch. 2009-03-05 15:48:38 -06:00
Scott Ehlert 72da49415e Added -dev tag back to version.h files for manual builds. 2009-03-05 14:59:09 -06:00
David Anderson 8e744ec5f7 Re-added -dev tag, bumped version to 1.2.1. 2009-03-05 02:36:27 -05:00
David Anderson 7372b66680 Added tag sourcemod-1.2.0 for changeset 3a73bbf60f34 2009-03-05 02:35:44 -05:00
David Anderson 8dfbcf5a9f Bumped versions. 2009-03-05 02:07:44 -05:00
David Anderson 01ff2cca0c Removed -dev tag for release. 2009-03-05 02:06:59 -05:00
David Anderson e981c2b43f Updated changelog. 2009-03-05 02:05:56 -05:00
David Anderson 1f636bf7a9 Bumped trunk to 1.3.0. 2009-03-05 01:48:18 -05:00
David Anderson 68bc33ef4d Pushing build. 2009-03-05 00:01:07 -05:00
Matt Woodrow a7e447a3f5 Merge 2009-03-05 12:00:31 +13:00
Matt Woodrow 096a04b3e4 Added SourceMod to the sv_tags list and added a tags API for plugins (bug 3688, r=dvander) 2009-03-05 11:59:49 +13:00
David Anderson 86e600000d Added -lrt to webternet from suggestion in bug 3686. 2009-03-04 06:45:50 -05:00
David Anderson a0128d9b7c Fixed SetEntityHealth not compiling, darkm regression (bug 3684). 2009-03-03 09:41:55 -05:00
Matt Woodrow 65996254c6 Triggering automatic break.. uh build. 2009-03-03 11:07:50 +13:00
Fyren a85031be53 Gently disable nextmap on L4D, rather than fail load (bug 3683, r+a12=dvander). 2009-03-01 21:15:14 -05:00
Matt Woodrow 8509f0857a Build Push! 2009-03-02 14:44:33 +13:00
David Anderson b24c75b400 Moved structs.gamedata.txt out of the way.
--HG--
rename : gamedata/structs.gamedata.txt => extensions/structs/structs.gamedata.txt
2009-03-01 17:45:04 -05:00
FLOOR_MASTER d372e789a4 Performance improvements to admin-sql-prefetch (bug 3354, r+a12=dvander). 2009-03-01 16:59:12 -05:00
Fyren d9f7e4c9e0 Added more detail to certain player-oriented menu titles (bug 2740, r=liam, a12=dvander). 2009-03-01 16:51:15 -05:00
Fyren e6ea726b69 Improved docs of TIMER_HNDL_CLOSE (bug 3641, r=dvander). 2009-03-01 16:48:55 -05:00
Fyren 98c1a18e57 Improved error message for handle leakage (bug 3646, r,a12=dvander). 2009-03-01 16:43:48 -05:00
Fyren e04d2a4a10 Added case insensitivity search to ReplaceString (bug 3639, r=dvander). 2009-03-01 16:41:44 -05:00
David Anderson 96a3671bb6 Improved user message interception API (bug 3631, r=pred). 2009-03-01 16:39:25 -05:00
David Anderson 0c028ca9d0 Fixed CommitSuicide offset for Insurgency (bug 2560). 2009-03-01 16:35:01 -05:00
David Anderson 64124447d5 Fixed shutdown breakage from updater landing. 2009-03-01 03:49:59 -05:00
David Anderson 037ea592ab Fixed Linux build. 2009-03-01 01:58:42 -05:00
David Anderson 6ebbb48f9f Re-landed automating updating (bug 3530, r=pred). 2009-03-01 01:35:39 -05:00
David Anderson 2e8a53ff34 Normalized gamedata line endings to Windows. 2009-03-01 01:19:51 -05:00
David Anderson f104438802 Do binary writes instead. 2009-03-01 01:18:09 -05:00
David Anderson eb25650e26 Merge. 2009-02-28 23:15:23 -05:00
David Anderson c4cba5254c Added auto-restart functionality to the Updater extensions (bug 3530, r=pred). 2009-02-28 23:14:16 -05:00
Scott Ehlert c90dda908a Merge from 1.1 branch. 2009-02-27 00:50:12 -06:00
Scott Ehlert 6aca0a8bfc Added -dev tag back to version.h files for manual builds. 2009-02-27 00:22:59 -06:00
Matt Woodrow 864376e7ba Merging from 1.1 branch 2009-02-27 12:20:36 +13:00
Matt Woodrow 71794fe511 Updated branch for 1.1.3 development 2009-02-26 17:41:42 -05:00
Matt Woodrow c69989c56f Added tag sourcemod-1.1.2 for changeset b3ffa8a4511c 2009-02-26 17:37:57 -05:00
Matt Woodrow cc91beece7 Bumped all versions 2009-02-26 16:54:03 -05:00
Matt Woodrow 0d6c6bdb58 Updated changelog and removed -dev tag 2009-02-26 16:48:31 -05:00
Matt Woodrow e234b1537c Merge 2009-02-27 10:20:47 +13:00
Matt Woodrow 407e58604f Fixed Critical hits being permanently disabled (bug 2674, r=dvander) 2009-02-27 10:19:46 +13:00
Scott Ehlert 2c3bf7dd23 Ran versionchanger script for consistency. 2009-02-25 23:44:18 -06:00
Scott Ehlert 5e6417eac0 Merged changes from 1.1 2009-02-25 23:17:37 -06:00
Scott Ehlert a4db34a419 Re-added -dev tag. 2009-02-25 23:05:31 -06:00
Scott Ehlert 8c493576cc Fixed 1.1.1 tag for great justice! 2009-02-25 23:00:59 -06:00
David Anderson 110a0d98fa Added tag sourcemod-1.1.1 for changeset 46c76edb0875 2009-02-25 20:25:23 -05:00
David Anderson 449b52e5a4 Removed tag sourcemod-1.1.1 2009-02-25 20:25:20 -05:00
David Anderson d0fda1f919 Bumped all versions. 2009-02-25 20:24:56 -05:00
David Anderson 79ea33beda Pushing build. 2009-02-25 20:21:47 -05:00
David Anderson fef5bd321c Added tag sourcemod-1.1.1 for changeset ffa740152efd 2009-02-25 20:10:12 -05:00
David Anderson 6c7a763b76 Fixed changelog. 2009-02-25 20:09:22 -05:00
David Anderson 78fa1c9995 Merge. 2009-02-25 20:07:20 -05:00
David Anderson 3623ee3ce8 Backed out changeset fa286305bd3f 2009-02-25 20:07:12 -05:00
David Anderson ba28da5fdc Removed -dev tag for release build. 2009-02-25 20:02:47 -05:00
David Anderson c2b7bd10ec Updated changelog. 2009-02-25 19:38:45 -05:00
David Anderson 35ab37c76c Merge. 2009-02-25 19:22:47 -05:00
David Anderson c968dfa113 Allow for second private chat trigger (bug 3667, r,a11=pred). 2009-02-25 19:22:36 -05:00
Matt Woodrow 09b24e45f9 Merge from 1.1 branch 2009-02-26 12:47:56 +13:00
Matt Woodrow 8541040bb9 Fixed CommitSuicide offset. 2009-02-26 12:42:59 +13:00
Matt Woodrow 8ae003046c Updated CDetour code in TF2 extension to prevent crashes with spies. Updated windows sig. 2009-02-26 12:42:13 +13:00
Matt Woodrow fc7f9ac6e9 Fixed linux offset for SetClientInfo (bug 3652, r=Fyren) 2009-02-23 10:09:51 +13:00
Matt Woodrow 7dcc7ea99c And again with the linux fixing (bug 3657) 2009-02-23 08:58:14 +13:00
Matt Woodrow 4590015ed6 Fixed linux build 2009-02-22 14:58:05 +13:00
Matt Woodrow 79f9dc61a4 Added edict_t and CBaseHandle conversion functions to IGameHelpers (bug 2616, r=dvander) 2009-02-22 14:38:05 +13:00
Matt Woodrow 3fac7d027a Fixed SetClientInfo offset after TF2 update (bug 3652) 2009-02-21 11:29:28 +13:00
Matt Woodrow 10ba5809d2 Fixed mapchooser not checking for an existing vote with mp_fraglimit (bug 3503) 2009-02-19 20:35:41 +13:00
Matt Woodrow 792204bd06 This has to be the worst GCC error ever. 2009-02-19 19:35:45 +13:00
Matt Woodrow f19cb010a0 Upgraded clientprefs to use the client serial API (bug 3616) 2009-02-19 19:28:50 +13:00
Matt Woodrow ca3df3bd50 Added a client verification serial API (bug 3616, r=dvander) 2009-02-19 19:19:44 +13:00
Matt Woodrow db43487b5a Merging changes from 1.1 branch 2009-02-19 14:23:36 +13:00
Fyren 38c37b8160 Fixed modules.versions not including clientprefs (bug 3647, r=dvander) 2009-02-19 14:22:22 +13:00
Scott Ehlert 44a04e6167 DS fails once again. Fixed Linux build once and for all. 2009-02-18 03:25:01 -06:00
Scott Ehlert 9d6a9eb615 Ugh, fixed Linux build for real by removing stray underscores. 2009-02-18 03:13:25 -06:00
Scott Ehlert 27070af1b9 Added Dark Messiah build config to sample_ext. 2009-02-18 03:08:02 -06:00
Scott Ehlert 32d2d4107d Fixed Linux build. 2009-02-18 02:58:03 -06:00
Scott Ehlert 75ebac822d Merge. 2009-02-18 02:30:21 -06:00
Scott Ehlert bd9fab6cf5 Added support for Dark Messiah engine and game. (no bug, r=me).
The development of this feature would not be possible without the support of the following people from the game's community:
Dylan Riggs, Carl Pettengill, Ed Moreland, and Christian.
2009-02-18 02:19:22 -06:00
Matt Woodrow d75f8f11e1 Oops - FormatPath missing a param (bug 3645) 2009-02-18 19:59:14 +13:00
Matt Woodrow 47900db414 Merging changes from 1.1 branch 2009-02-18 19:14:27 +13:00
Matt Woodrow aec3469c03 Fixed CalcCriticalKnife signature for TF2 (r=bl4nk) 2009-02-18 19:13:08 +13:00
Matt Woodrow b61542242c Build Fix! 2009-02-18 15:30:43 +13:00
Matt Woodrow 13c1fd09c4 Added custom gamedata file parsing (bug 3644, r=dvander) 2009-02-18 15:08:17 +13:00
Matt Woodrow fddb69e49e Fixed MsgSentNotify callbacks not firing on intercept hook (bug3631, r=dvander) 2009-02-18 15:03:17 +13:00
David Anderson ed51d5cf84 Disallow ".." to appear in paths from the updater. 2009-02-17 16:58:17 -05:00
David Anderson 3d7b0db114 Updater uses a core.cfg specified URL now. 2009-02-17 16:39:02 -05:00
David Anderson 9e445a5adf Added API to grab arbitrary kv pairs from core.cfg. 2009-02-17 16:19:11 -05:00
David Anderson 97e25c37de Deprecated Acquire/ReleaseLock from IGameConfigManager, use thread pump in updater. 2009-02-17 15:59:51 -05:00
David Anderson 16033c1307 Deprecated sm_corecfgfile for sm_basepath (bug 2693, r=ds). 2009-02-17 14:03:20 -05:00
David Anderson 15d64b8486 Fixed documentation typos in dbi.inc (bug 3587). 2009-02-08 15:40:48 -05:00
David Anderson 5d06aa3c8c Pushing build because buildbot is delicate and needs its hand held to cross the street and put on underwear. 2009-02-08 01:06:31 -05:00
David Anderson e276223b61 Merge from sourcemod-1.1. 2009-02-08 00:02:58 -05:00
David Anderson 71b48fad0f Merge. 2009-02-07 23:57:11 -05:00
David Anderson a3fade1c1d Fixed EventManager holding onto stale pointers (bug 3548, r=ds). 2009-02-07 23:56:48 -05:00
David Anderson 6530f47b2d Renamed translation file with deprecated naming scheme.
--HG--
rename : translations/plugin.playercommands.txt => translations/playercommands.phrases.txt
2009-02-07 22:32:55 -05:00
Milo 3ab1ef139f Fixed documentation typo on TF2_GetPlayerClass (bug 3608, r=dvander). 2009-02-07 22:05:04 -05:00
mr.e.unk 36bd6423c2 Allow longer path strings in adminmenu (bug 3620, r=pred). 2009-02-07 22:01:09 -05:00
David Anderson ffd8ff099a Initial import of updater extension, currently incomplete - just getting it in the tree (bug 3530). 2009-02-02 15:41:25 -05:00
mr.e.unk 178347f9f1 Removed RTV section from maplists.cfg. (bug 3611 r=Liam) 2009-02-01 20:39:23 -05:00
David Anderson e194f89b25 Removed UTIL_Format from webternet extension. 2009-02-01 20:38:59 -05:00
David Anderson 3bfc70aa3b Normalized line endings. 2009-02-01 20:37:50 -05:00
David Anderson 93a6a0f211 Merge. 2009-02-01 20:31:48 -05:00
David Anderson cef6a2e389 Added an SMC stream reader to ITextParser (bug 3530, r=pred). 2009-02-01 20:31:27 -05:00
mr.e.unk 4f5764e4a5 Removed RTV section from maplists.cfg. (bug 3611 r=Liam) 2009-02-01 20:22:50 -05:00
David Anderson 21770ff10f Corrected IWebternet version number. 2009-02-01 19:58:16 -05:00
David Anderson 2b97461f54 Added snprintf/vsnprintf helpers to ISourceMod, finally (bug 3530, r=pred). 2009-02-01 19:57:09 -05:00
David Anderson 0cf5f4ae2a Added form POSTing and HTTP error code handling to Webternet (bug 3530, r=pred). 2009-02-01 19:56:24 -05:00
David Anderson 7b6dcfce87 Removed md5 files from core, as they are unused. 2009-02-01 17:50:44 -05:00
David Anderson f9d472847c Merge from sourcemod-1.1. 2009-02-01 02:37:00 -05:00
David Anderson d69d97402b Fixed nits from bug 3570. 2009-02-01 02:35:19 -05:00
David Anderson 643c39690f Added client "sm", "sm credits", and "sm plugins" commands (bug 3570, r=ds,pred). 2009-02-01 02:33:31 -05:00
David Anderson 6048144310 RegConsoleCmd is now case insensitive for client-only commands (bug 3602, r=ds). 2009-02-01 02:13:17 -05:00
[email protected] 94303ea9a0 Fixed nextmap trigger showing wrong output with end-of-map voting disabled and sm_trigger_show set to zero (bug 3597, r=pred). 2009-02-01 02:09:15 -05:00
David Anderson a017e4820a Added the ability for extensions to invoke arbitrary natives (bug 3605, r=ds,theY4Kman). 2009-02-01 02:03:03 -05:00
David Anderson 50e1c5ba1f Database fallback for clientprefs is now more "intelligent" (bug 3564, r=pred). 2009-01-31 23:42:35 -05:00
David Anderson c5ec369388 Fixed STEAM_0 reference in common.phrases.txt (bug 3577). 2009-01-31 22:51:48 -05:00
David Anderson 7d3ebce7d1 Fixed sm_sql_addgroup not working (bug 3578, r=liam). 2009-01-31 22:46:34 -05:00
Liam 52826342fc Removed sounds translations from funcommands.phrases.txt, created and added sounds.phrases.txt, modified sounds.sp to include translation files (bug 3603, r=dvander) 2009-01-31 22:39:36 -05:00
Liam 29b357a2f6 Insurgency game_start / game_newmap event fix (bug 3497, +dvander) 2009-01-31 22:21:37 -05:00
David Anderson 747ed1e59a Fixed bugs in the Knight shared files (not that these are used in SM). 2009-01-29 12:50:32 -05:00
Scott Ehlert 992c05b6aa Wow, buildbot, just wow. You built 1.1 instead of 1.2 again. 2009-01-28 02:14:41 -06:00
Scott Ehlert f4a5457941 Merged changes from sourcemod-1.1 branch. 2009-01-28 00:00:19 -06:00
Scott Ehlert 7167a807bf Fixed a crash in the Event Manager when a game fired an event from a listener that was looking for the same event (bug 3468, r=me).
In other words it was a problem where our FireEvent hooks were being re-entered for the _same_ game event. The Event Manager was not able to handle this and crashed.
2009-01-27 23:53:48 -06:00
Scott Ehlert 22675ba2e7 Fixed crash in GetClientInfo() native on L4D (bug 3569, r=me).
The CreateFakeClient signature (used for verification before retrieving the IServer interface pointer) changed in a recent update. The IServer pointer was therefore null and GetClientInfo() did not check for this.

The CreateFakeClient signature is also no longer hardcoded. It is modifiable in gamedata/sdktools.games/engine.*.txt.
2009-01-22 15:20:45 -06:00
Matt Woodrow 80602b011d Build fixed hopefully. 2009-01-17 13:45:51 +13:00
Matt Woodrow abea8e2195 Fixed bintools compile options 2009-01-17 13:17:55 +13:00
Liam 9075aecb18 Updated basebans.sp to support L4D and allow future expansion of the STEAM_ identifier. (bug 3567 r=dvander) 2009-01-15 12:08:33 -05:00
Liam 6e9ac875d7 Fixed the bug in sounds.sp. (Bug 3568 r=dvander) 2009-01-15 10:37:54 -05:00
Fyren 100ecb12e9 Fixed admin-sql-threaded not working on L4D (bug 3559, r=dvander). 2009-01-14 17:00:24 -05:00
David Anderson 57b4701e57 Fixed gamedata bug in SDKTools (no bug, r=me). 2009-01-14 12:20:22 -05:00
David Anderson fffc211989 Whoops, updated build tool to correctly copy new gamedata files. 2009-01-14 00:55:28 -05:00
jonasfietz 5a0528de26 Improve compile.sh to accept filenames (bug 3550, r=dvander). 2009-01-13 16:14:44 -05:00
Rothgar fb8f46ea45 Updated SDKTools definitions for Zombie Panic Source (bug 2467, r=dvander). 2009-01-13 15:58:29 -05:00
TheDOO a8e1a4f2fd Update of Obsidian CommitSuicide offset (bug 2699, r=dvander).
(transplanted from sourcemod-central ffc584a3c382c064006b857e6697c99fff1a681d)

--HG--
extra : transplant_source : %FF%C5%84%A3%C3%82%C0d%00k%85%7Ef%97%C9%9F%FF%1Ah%1D
2009-01-12 02:33:03 -05:00
Scott Ehlert 157f050f89 Fixed a memory leak when game events were hooked as EventHookMode_Post (no bug, r=me).
The duplicated event data that was being carried over to the IGameEventManager2::FireEvent post hook was not being freed. EventHookMode_Post is the default so this leak could have happened fairly often.
2009-01-27 13:41:57 -06:00
TheDOO 3653f56331 Update of Obsidian CommitSuicide offset (bug 2699, r=dvander). 2009-01-12 02:33:03 -05:00
David Anderson e31cbbfe21 New gamedata organization (bug 3546, r=ds,pred). 2009-01-12 02:28:22 -05:00
David Anderson bc3491c5bd Another build fix for Windows. 2009-01-12 01:32:53 -05:00
David Anderson 9a7c25047d Fixed windows build. 2009-01-12 01:15:29 -05:00
David Anderson 7cef8b7363 Attempt at getting webternet extension into build process. 2009-01-12 00:36:36 -05:00
David Anderson e449b8384c Webternet extension now exposes API and acts like other SM extensions. 2009-01-11 23:56:34 -05:00
David Anderson 9514c12982 Initial import of untested curl extension (bug 3560, r=pred,ds). 2009-01-11 23:48:17 -05:00
David Anderson 489d6c5a65 Imported libcurl source code. 2009-01-08 18:31:00 -05:00
David Anderson ccc59ecdaf Pre-emptive removal of gamedata updater pending rewrite. 2009-01-08 16:11:59 -05:00
David Anderson d2ce50f989 Merge from sourcemod-1.1 branch. 2009-01-08 13:39:16 -05:00
David Anderson 14e409adb4 Fixed another build issue. 2009-01-08 02:38:31 -05:00
David Anderson 4a0f639e89 Fixed build, removed stale build entries. 2009-01-08 02:19:17 -05:00
David Anderson 32c5925652 Whitespace patrol - fixed soft tabs leaking into build tool. 2009-01-08 01:54:55 -05:00
Matt Woodrow 4c91dd8621 Fixed build 2009-01-08 00:44:48 -05:00
Matt Woodrow f641aa92f5 Added Dynamic Hooking to BinTools (bug 2616 r=dvander,DS) 2009-01-08 18:17:17 +13:00
David Anderson 3bdc8583e5 Exposed IServer through SDKTools (bug 3545, r=ds). 2009-01-07 22:55:40 -05:00
David Anderson 4e37900d93 Updated build to have the sounds plugin (follow-up from bug 3498). 2009-01-07 19:28:42 -05:00
David Anderson c676ecc026 Fixed regression in printing floats with no precision (bug 3447, r=ds). 2009-01-07 19:23:24 -05:00
Liam db760dc29b Rewrote timer system in funcommands. Cleaned up the code. Moved sounds to a seperate plugin. Misc code optimizations. (bug 3498 r=dvander) 2009-01-07 19:21:54 -05:00
David Anderson 0fbb87e3b2 Fixed various wrong offsets in Insurgency (bug 3544, r=me). 2009-01-07 16:43:23 -05:00
David Anderson 29996d0133 Cleaned up SourceForts entries in sdktools.games.txt (bug 3492). 2009-01-07 04:06:18 -05:00
The DOO 7807f3e31a Added basic SDKTools/core support for Obsidian Conflict (bug 2699). 2009-01-07 03:33:45 -05:00
IceMatrix e246d14a6b Added Age of Chivalry offsets (bug 3366). 2009-01-07 03:25:53 -05:00
David Anderson a34a27be65 Fixed top menu categories being available even if not usable (bug 3256, r=me). 2009-01-07 02:08:14 -05:00
Scott Ehlert e1d2b88c23 Fixed some inconsistencies in admins_simple.ini (bug 3540). 2009-01-02 00:31:23 -06:00
Liam f96ca17f17 Updated the game check with GetGameFolderName instead of GetGameDesc. (Bug 3473 r=dvander) 2008-12-31 23:05:36 -05:00
Liam 50580498c4 Fixed nexmap issue (Bug 2150 r=Liam) 2008-12-30 19:17:13 -05:00
Liam a21e688c96 Modified the ProcessRename function to use SetClientInfo instead of ClientCommand (Bug 2150 r=DS) 2008-12-29 23:38:28 -05:00
Scott Ehlert 4b1deee7e1 El merge. 2008-12-29 00:12:37 -06:00
Scott Ehlert bf5fefe84f Merge from sourcemod-1.1 branch. 2008-12-29 00:11:32 -06:00
Scott Ehlert 5c92b0d154 Bumped version to 1.1.1 and added back -dev build string. 2008-12-28 23:50:26 -06:00
Scott Ehlert 2b7ccf6625 Tagging SourceMod 1.1.0 2008-12-28 23:41:14 -06:00
Liam 004d450844 Removed the if (ident==NULL) from BindAdminCache 2008-12-29 00:31:16 -05:00
Liam 7705e88b57 Prevented blank/empty admins from being created. (Bug 3431 r=dvander) 2008-12-28 23:45:18 -05:00
David Anderson 3f250ba42d Bumped version files. 2008-12-28 20:35:51 -05:00
David Anderson 1b8bb4e049 Removed -dev tag for release build. 2008-12-28 20:33:21 -05:00
David Anderson 1577fab93a Ran versionchanger.pl over trunk to get 1.2.0 into headers (bug 3521). 2008-12-28 19:59:40 -05:00
David Anderson 181fe74b09 Merge from sourcemod-1.1 branch. 2008-12-28 19:56:40 -05:00
David Anderson 34b8d00548 Updated changelog. 2008-12-28 19:55:52 -05:00
David Anderson 0a6cbadcd8 Merge. 2008-12-28 18:54:51 -05:00
David Anderson 701fef1ba4 Log file name consistency for gamedata logs (no bug). 2008-12-28 18:54:36 -05:00
Liam cdd78b2ec3 Added rename command to PlayerCommands. Merged rename.phrases.txt and slapslay.phrases.txt into plugin.playercommands.txt. (Bug 2150 r=dvander) 2008-12-28 18:28:57 -05:00
Matt Woodrow ba04132142 SDKTools didn't NULL check after GetMemSig (bug 3504, r=dvander). 2008-12-28 17:52:33 -05:00
Liam ddc42bedf5 Modified Command_Kick to display the reason (if given) on the kick message.
Modified the translation file to use the new reason style.
2008-12-28 16:48:59 -05:00
David Anderson ea84302e28 Clean slate for languages.cfg (no bug). 2008-12-28 16:09:47 -05:00
David Anderson a7a08a7d4e Clean slate for languages.cfg (no bug). 2008-12-28 16:09:15 -05:00
David Anderson 0a33a25a7d Merge from sourcemod-1.1 branch. 2008-12-28 03:23:45 -05:00
Liam 2c9622ea52 Forced nextmap to not load on L4D (bug 3473 r=Liam) 2008-12-28 03:15:15 -05:00
David Anderson 08e2fc8deb Support for 3-letter language codes (bug 3526, r=ds). 2008-12-28 02:38:53 -05:00
David Anderson ebed45a0f6 Fixed Linux build. 2008-12-28 01:10:20 -05:00
David Anderson d3c279fd05 Fixed threading issues in gamedata fetcher, new restart mechanism (bug 3351, r=pred). 2008-12-28 01:02:05 -05:00
David Anderson e69ed4b0da Removed unsafe calls from gamedata threader (bug 3351, r=pred). 2008-12-27 19:50:13 -05:00
David Anderson 4daca3c5ba Another gamedata cleanup sponsored by an r=pred (bug 3351). 2008-12-26 23:26:21 -05:00
David Anderson cb41fa6de4 Fixed JIT build on Linux for real. 2008-12-22 20:12:33 -06:00
David Anderson dc758ead10 Build fix for Linux. 2008-12-23 01:55:20 -05:00
David Anderson 1fe38c7473 SourceMod can now be somewhat compiled on OS X for patch sanity testing (bug 3516, r=ds).
This adds the ability for us to change the GCC version we use more flexibly.
2008-12-23 01:33:37 -05:00
David Anderson 5564c38a2f Pushing build to test buildbot. 2008-12-16 21:04:03 -06:00
David Anderson 2a853a23d7 Pushing build to test buildbot. 2008-12-16 20:46:11 -06:00
David Anderson 37da98c9bb Pushing build to test buildbot. 2008-12-16 20:43:16 -06:00
Matt Woodrow 5a5172be57 Merge 2008-12-15 00:48:54 -05:00
Matt Woodrow 58ec9a4f38 Merge 2008-12-15 18:47:11 +13:00
Matt Woodrow b7477fc321 Cleaned up vtable_scanner code a bit to diagnose l4d crashes 2008-12-15 18:45:33 +13:00
Matt Woodrow 88afac51f0 Merge 2008-12-12 23:24:13 -05:00
Matt Woodrow 2bb3e5fd6b Gamedata cleanup and security fix (bug 3351 r=dvander) 2008-12-12 23:20:35 -05:00
Scott Ehlert dd338d40f3 Triggering build. 2008-12-08 03:28:08 -06:00
Scott Ehlert 1cc8440900 Triggering build. 2008-12-08 00:46:54 -06:00
Scott Ehlert 47cf8f4233 Merge from 1.1 branch. 2008-12-07 21:07:14 -06:00
Scott Ehlert eedfd2d70d Shell script code in Makefiles is _really_ POSIX compliant now.
Missed an equal sign :\
2008-12-07 21:05:51 -06:00
Scott Ehlert 4e88626d65 Merge, agh. 2008-12-07 20:54:23 -06:00
Scott Ehlert a1b91ac136 Merge from 1.1 branch. 2008-12-07 20:52:06 -06:00
Scott Ehlert 4bbd74b702 Shell script code in Makefiles is now POSIX compliant and is able to be run on dash. 2008-12-07 20:40:31 -06:00
Scott Ehlert 1d07d24054 Triggering a build? 2008-12-07 00:49:29 -06:00
Scott Ehlert 0a0fd0c64a Triggering yet another build. 2008-12-07 01:26:03 -05:00
Scott Ehlert a7c6fc12d8 Triggering a build on an off chance. 2008-12-06 23:53:55 -06:00
Scott Ehlert 48f0a49f9b Triggering a build perhaps. 2008-12-06 23:26:18 -06:00
Scott Ehlert b63d714a06 Triggering a build maybe. 2008-12-06 22:17:51 -06:00
Scott Ehlert 7bdcea5814 Merged changes from 1.1 branch. 2008-12-05 15:57:49 -06:00
Scott Ehlert f418f38589 Added L4D build config to sample extension's project files. 2008-12-05 15:56:36 -06:00
Matt Schubert 7d3e32b65f Attempted fix for GiveNamedItem crashing on Windows (bug 3472, r=dvander) 2008-12-03 13:04:48 -05:00
Scott Ehlert 52377b509b Triggering another build to fix bug 3478 for real. 2008-12-03 10:41:00 -06:00
Scott Ehlert 14152bb7ba Triggering build to fix bug 3478.
The structure of typedescription_t in our L4D SDK was wrong and it has been updated.
Not only does this fix sm_dump_datamaps in SDKTools, but it also fixes issues with the datamap-related natives in Core where there was a datamap within a datamap.
2008-12-03 10:34:32 -06:00
Scott Ehlert d51aaec97d Fixed a memory leak that occurred when a ConCmdIter handle was closed. (L4D engine)
Note: These handles are used by the FindFirstConCommand and FindNextConCommand natives.
2008-12-02 10:57:42 -06:00
Matt Schubert ea3fe754f4 Fixed missing slap sounds in L4D (bug 3453, r=dvander) 2008-11-30 12:53:18 -05:00
David Anderson 04354a809c Fixed FindTeamByName using wrong case sensitivity (bug 3446, r=pred). 2008-11-29 23:28:28 -06:00
David Anderson 3cf30f5e62 Added filetest.sp to testsuite. 2008-11-29 22:44:11 -06:00
David Anderson 7ff0129f36 Fixed ReadFileString ignoring fourth parameter (bug 3459, r=ds). 2008-11-29 22:43:30 -06:00
David Anderson b684d3aad7 Various nits on smupdate tool (bug 3351, r=pred). 2008-11-29 20:07:43 -06:00
Matt Schubert f164419baa Fixed hsay/tsay not checking for in-game players 2008-11-29 18:49:10 -05:00
David Anderson f20603ad06 Triggered build, something funky happened.... 2008-11-29 16:58:59 -06:00
David Anderson bac975331d Merge from sourcemod-1.1. 2008-11-29 16:28:50 -06:00
David Anderson dcccfbd26a Fixed sm_sql_addadmin reading the immunity field as a password (bug 3395, r=pred). 2008-11-29 16:27:52 -06:00
Matt Schubert 4baf847062 Fixed hsay/tsay not checking for in-game players 2008-11-29 13:16:33 -05:00
Scott Ehlert 90a44ea6c8 Pushed build. 2008-11-28 23:49:37 -06:00
Scott Ehlert fef83838f9 Merged another change from 1.1 branch. 2008-11-28 23:34:18 -06:00
Scott Ehlert 1422a9abe3 Merged changes from 1.1 branch. 2008-11-28 23:32:59 -06:00
David Anderson 2fc0520895 Fixed ReadFile sign-extending instead of zero-extending (bug 3449, r=ds). 2008-11-28 20:01:23 -06:00
Scott Ehlert 7b1adfe00b Added msvc9 project file for sample_ext
Also updated msvc8 project file for compilation against MM:S 1.7
2008-11-27 02:37:31 -06:00
Scott Ehlert 28e1568eb7 Missed a reference to SOURCEMM16 in JIT project files (bug 3445). 2008-11-27 02:20:08 -06:00
Scott Ehlert 0a6eac7c27 Added .hgignore so that 'hg status' can ignore untracked files of certain types. 2008-11-27 00:49:37 -06:00
Scott Ehlert ecaced40f2 Now compiles against Metamod:Source 1.7 (bug 3445). 2008-11-27 01:13:51 -06:00
Matt Woodrow 984a2d26f4 Merge! 2008-11-25 19:14:02 +13:00
Matt Woodrow f85bb7e490 SourceMod now handles steamid's internally without the STEAM_*: part (bug 3428) 2008-11-25 19:13:08 +13:00
Matt Woodrow 321443450a SourceMod now handles steamid's internally without the STEAM_*: part (bug 3428) 2008-11-25 19:10:52 +13:00
Scott Ehlert 25a0a192a2 Added /MP back to core and sdktools MSVC project files. 2008-11-24 09:41:46 -06:00
Scott Ehlert 843ff25de4 Moved SE_* constants from PrePreprocessorDefinitions to AdditionalOptions in MSVC project files.
-Doing this should make it a bit easier to maintain in the future.

Also added back /MP to core and sdktools.
2008-11-24 09:33:11 -06:00
Scott Ehlert 4563c00deb Merge. 2008-11-24 08:39:46 -06:00
Scott Ehlert 7a38e5584c OriginalFilename field in core/version.rc now has correct filename based on engine. 2008-11-24 08:37:06 -06:00
Scott Ehlert e26ce2b457 OriginalFilename field in core/version.rc now has correct filename based on engine. 2008-11-24 08:25:36 -06:00
Scott Ehlert 9c1e45d97c Fixed crash when L4D server went into hibernation mode after having had an active bot and a reserved name was used by this bot
- When going into hibernation, ClientSettingsChanged is called for remaining bots
- Hook checks bot's name against reserved names in admins config and tries to kick using IClient::Disconnect
- Method of getting IClient relies on client having an INetChannel pointer
- Bots do not have an INetChannel pointer so this results in a crash
2008-11-21 14:09:50 -06:00
Scott Ehlert c2756c731f Try 2 of eliminating VPK warning.
Previous commit was more complicated then it really needed to be.
2008-11-19 02:38:28 -06:00
Scott Ehlert d6fc82f8fa Merge. 2008-11-19 02:16:45 -06:00
Scott Ehlert 2acf1b08d5 'Relatized' the path passed to FileToKeyValues() native.
This eliminates the annoying warning in L4D:
***VPK: FindFile Attempting to use full path with VPK file!
2008-11-19 02:14:43 -06:00
David Anderson 6ffd39ac77 Merge changes from 1.1 branch.
--HG--
rename : core/systems/ExtensionSys.cpp => core/ExtensionSys.cpp
rename : core/systems/PluginSys.h => core/PluginSys.h
2008-11-18 06:08:48 -08:00
Scott Ehlert 9ae456b9d1 Updated makefiles to link against binaries at l4d directory instead of l4d_demo 2008-11-18 06:00:31 -06:00
Scott Ehlert 5bbeddc134 Oops, removed something I shouldn't have 2008-11-17 22:13:32 -06:00
Scott Ehlert 373fbb6ca3 Removed debugging code from ConVarManager 2008-11-17 22:11:06 -06:00
David Anderson d1405f2ab3 Updated core Makefile. 2008-11-16 18:41:14 -06:00
David Anderson 2ff9b0aada Removed pointless "systems" folder from core.
--HG--
rename : core/systems/ExtensionSys.cpp => core/ExtensionSys.cpp
rename : core/systems/ExtensionSys.h => core/ExtensionSys.h
rename : core/systems/ForwardSys.cpp => core/ForwardSys.cpp
rename : core/systems/ForwardSys.h => core/ForwardSys.h
rename : core/systems/HandleSys.cpp => core/HandleSys.cpp
rename : core/systems/HandleSys.h => core/HandleSys.h
rename : core/systems/LibrarySys.cpp => core/LibrarySys.cpp
rename : core/systems/LibrarySys.h => core/LibrarySys.h
rename : core/systems/PluginInfoDatabase.cpp => core/PluginInfoDatabase.cpp
rename : core/systems/PluginInfoDatabase.h => core/PluginInfoDatabase.h
rename : core/systems/PluginSys.cpp => core/PluginSys.cpp
rename : core/systems/PluginSys.h => core/PluginSys.h
rename : core/systems/ShareSys.cpp => core/ShareSys.cpp
rename : core/systems/ShareSys.h => core/ShareSys.h
2008-11-16 16:06:18 -08:00
Scott Ehlert 43f5d71724 Fixed IndexOfEdict and PEntityOfEntIndex inlines to be in line with updated edict_t structure in SDK 2008-11-14 23:08:24 -06:00
Scott Ehlert 41b61ed36f Fixed tab inconsistency in some build tool source files. 2008-11-14 16:55:09 -06:00
Scott Ehlert 31e30faace Triggering build 2008-11-14 09:58:40 -06:00
Scott Ehlert ff7a2c6b73 Added preliminary support for Left 4 Dead; some things may not yet work. 2008-11-14 09:18:30 -06:00
Scott Ehlert acea705df8 Moved IDA scripts from editor/ida to tools/ida_scripts
--HG--
rename : editor/ida/gcc_fpic.idc => tools/ida_scripts/gcc_fpic.idc
rename : editor/ida/linux_vtable_dump.idc => tools/ida_scripts/linux_vtable_dump.idc
2008-11-14 03:51:57 -06:00
Scott Ehlert 7e3f9ada31 Moved IDA scripts from editor/ida to tools/ida_scripts
--HG--
rename : editor/ida/gcc_fpic.idc => tools/ida_scripts/gcc_fpic.idc
rename : editor/ida/linux_vtable_dump.idc => tools/ida_scripts/linux_vtable_dump.idc
2008-11-14 03:38:59 -06:00
David Anderson 0a956115eb Bumped version on trunk. 2008-11-12 22:47:24 -08:00
David Anderson 30174c07de Forcing build. 2008-11-12 22:41:17 -08:00
David Anderson 8e5c7713fc Forcing build. 2008-11-12 22:34:52 -08:00
David Anderson 7b45342955 Forcing build. 2008-11-12 22:32:04 -08:00
Scott Ehlert 2f0965c14b Fixed Linux build 2008-11-12 23:22:33 -06:00
Scott Ehlert c1c5d2656c The replicate and notify parameters for SetConVarX and ResetConVar are now ignored on Orange Box.
- OB engine automatically replicates and fires server_cvar event notification for changes cvars.
- Added a note about this in comments for affected natives.
2008-11-12 23:14:49 -06:00
David Anderson af2af91300 Take-two at fixing bug 3410. 2008-11-11 02:21:25 -08:00
David Anderson c880919466 Merge. 2008-11-11 01:37:24 -08:00
David Anderson b1646accb9 Attempted to lcase dll dirs in the symstore. 2008-11-11 01:36:15 -08:00
Scott Ehlert 00bb796db2 Version 1.2 of fPIC script
- Now works with GCC 4.3 compiled binaries (like Left 4 Dead)
- Fixed: Redefining alignment blocks as data caused IDA to pop up an annoying warning
2008-11-06 17:07:53 -06:00
Scott Ehlert 6c1259f6e6 Import of IDA script to demangle fPIC on x86 (checkin=dvander). 2008-11-06 00:08:24 -08:00
David Anderson a04521b55a Fixed "nextmap" command being spammable (bug 3391, r=pred). 2008-11-05 21:02:07 -08:00
David Anderson c8b3c82a12 Moved structs.inc out of plugins\include.
--HG--
rename : plugins/include/structs.inc => extensions/structs/structs.inc
2008-11-01 00:02:53 -07:00
David Anderson c1c8a4c988 Backed out structs extension from being in builds - it's not ready to land. 2008-10-31 23:20:40 -07:00
David Anderson 335febca34 Fixed windows offset in structs extension. 2008-10-31 23:15:34 -07:00
David Anderson e191d446a7 Fixed structs extension using the wrong filename. 2008-10-31 22:54:19 -07:00
David Anderson 412ad74aad Fixed gamedata file refcounting bug in the structs extension. 2008-10-31 22:47:13 -07:00
David Anderson e70fc299ac Fixed accidental NULLing of natives in the native name cache but not filled. 2008-10-31 22:35:27 -07:00
David Anderson b3b972caf7 Fixed missing semi-colon in sdktools_stocks.inc (bug 3376). 2008-10-31 08:38:44 -05:00
David Anderson c25017e1a4 Fixed basechat not checking client in-game status for display center text (bug 3372). 2008-10-31 08:35:27 -05:00
David Anderson be1d12f94f Merge. 2008-10-31 08:28:24 -05:00
David Anderson 3c18289465 Fixed race condition where client cookie callbacks could be fired against wrong clients (bug 3375). 2008-10-31 08:28:08 -05:00
David Anderson ed29c837fa Fixed failed timers leaking dangling plugin references (bug 3381). 2008-10-29 01:27:56 -07:00
David Anderson 8d78c74554 Fixed horrendous crash in the JIT from packing change in the debug table (bug 3334, r=me).
I accidentally changed the debug table packing in a commit a while ago.  This explains the nonsense debug output and crashes people have been getting on the 1.1 branch.  Fortunately this is (mostly) detectable via the "debug.natives" table and the JIT will unpack symbols based on that information.
2008-10-27 02:02:14 -05:00
David Anderson e48bba5b4d Fixed leaking relocation table memory in JIT. 2008-10-26 23:50:54 -05:00
David Anderson 547f7aecc1 Fixed crash when using ISourcePawnEngine2::LoadPlugin with a non-existant file. 2008-10-26 23:40:24 -05:00
David Anderson 67ba04bcee Fixed IsClientTimingOut spelling in native export table. 2008-10-24 20:59:26 -05:00
David Anderson a1d84347ed Fixed bounds checking in ReadHandle routine (bug 3359). 2008-10-21 23:52:50 -07:00
David Anderson 253109d1c9 Rewrote querying in client prefs to not use prepared queries (bug 2698, r=pred).
Prepared queries had annoying race conditions and became unusable on connection timeouts.
2008-10-20 03:40:46 -05:00
David Anderson c0c9fc3267 Fixed buffer reallocation in dbi.mysql leaving stale pointers behind and crashing (bug 3352). 2008-10-19 22:57:28 -07:00
Matt Woodrow 918bec36d9 Fixed regression in send/revc calls in the gamedata fetcher 2008-10-20 18:42:22 +13:00
Matt Woodrow 7b8cd751e1 I should get more sleep. 2008-10-19 17:44:19 +13:00
Matt Woodrow 849c4a70ae And again with the build breaking.. 2008-10-19 17:37:21 +13:00
Matt Woodrow c231375e19 Mergesaurus Rex 2008-10-19 17:28:45 +13:00
Matt Woodrow d8babe2a71 Gamedata fetching cleanup - Part 1 (bug 3351 r=dvander) 2008-10-19 17:27:54 +13:00
Matt Woodrow 4e88a5a431 Updated rockthevote to use new OnClientConnected forward (bug 3311) 2008-10-19 16:18:22 +13:00
David Anderson a6579c7bcb Added new OnClientConnected callback with correct pairing intent (bug 3311, r=pred). 2008-10-18 22:14:13 -05:00
David Anderson 5a2f8afd33 Fixed calling the wrong GetError(), causing misleading spew (part of bug 2698). 2008-10-17 02:04:09 -05:00
Matt Woodrow 3c12db8637 Merging like a zip! 2008-10-16 10:55:42 +13:00
Matt Woodrow 07cbe39552 Updated basetriggers to use more translation friendly phrases (bug 3330, r=dvander).
Basetriggers now counts rounds remaining for mp_maxrounds output.
2008-10-16 10:54:23 +13:00
David Anderson 974f31c149 Various clientprefs logging to try and catch bug 2698 in the act. 2008-10-15 01:01:36 -07:00
Matt Woodrow 4a1c565b62 Updated rockthevote to use new MaxClients variable 2008-10-15 20:42:47 +13:00
Matt Woodrow 32f9c46424 Struct Test should compile now 2008-10-15 20:42:26 +13:00
Matt Woodrow 34d2d7760b Fixed bug 3312 - Added Radio Menu Timeout for synergy 2008-10-14 12:31:22 +13:00
David Anderson 2f36e3b231 Deprecated SQL_ConnectEx for SQL_ConnectCustom, which expresses the API intent better (bug 3307, r=pred). 2008-10-13 01:13:39 -05:00
Matt Woodrow b0d6e39035 Merge 2008-10-09 20:19:22 +13:00
Matt Woodrow b7a2f221f2 Fixed a couple of plugin errors with third party mods (bug 3305) 2008-10-09 20:18:16 +13:00
David Anderson 6d2bb90f51 Added radio menu support for Fortress Forever (bug 3260). 2008-10-08 23:53:31 -07:00
David Anderson fa1336623f Added GiveNamedItem/EquipPlayerWeapon back to TF2 (bug 3276, r=bl4nk). 2008-10-08 22:53:49 -07:00
David Anderson 2b65e2496d Added radio menu support for Synergy (bug 3301). 2008-10-08 22:43:57 -07:00
David Anderson 4953b1d889 Added radio menu support for D.I.P.R.I.P. (bug 3304). 2008-10-08 22:41:44 -07:00
Matt Woodrow ed75da0f85 Reworked unavailable nominations showing in the menu (bug 3269)
Fixed a non-const String in mapchooser.inc
2008-10-09 14:24:30 +13:00
Matt Woodrow ff7cb43f6a Build fix attempt one (1) 2008-10-09 13:58:53 +13:00
Matt Woodrow dc3b4a57cc Structs now builds for the old engine (bug 3286) - again. 2008-10-09 13:35:14 +13:00
Matt Woodrow 7009e755fe Backed out changeset: 44b02986c01b
Damn you tortoisehg
2008-10-09 13:33:47 +13:00
Matt Woodrow bba2cfc6f7 Structs now builds for the old engine (bug 3286) 2008-10-09 13:24:44 +13:00
Matt Woodrow 759c76e188 Maps nominated by owner=0 should not be replaced. Fixes sm_nominate_addmap only allowing a single map to be added (bug 3272) 2008-10-08 21:02:01 +13:00
Matt Woodrow db5a0be4ca Backed out changeset: 19331eae67ad 2008-10-08 20:59:56 +13:00
Matt Woodrow 29e57e77f7 Maps nominated by owner=0 should not be replaced. Fixes sm_nominate_addmap only allowing a single map to be added (bug 3272) 2008-10-08 20:58:25 +13:00
David Anderson f50c7469ca Added MaxClients public var to replace GetMaxClients (bug 3283, r=pred).
This is a hard bump of the plugin version number.  1.1 plugins compiled against this include set
will not run against earlier versions of SourceMod.
2008-10-05 15:20:17 -07:00
David Anderson d9af295a29 Corrected case in a nominations phrase. 2008-10-05 04:19:39 -07:00
David Anderson 4147bf7444 Language files are now additive, and are sniffed from translations/[iso code].
This is so translations can be maintained easier without any merging pains on behalf of users or developers.
2008-10-05 04:08:48 -07:00
David Anderson 99e304d6b5 Fixed a bug where SourceMod failed trying to default back to English when missing translations. 2008-10-05 04:06:18 -07:00
David Anderson 4e7000368f Fixed clientprefs race condition on first run (bug 3294, r=pred). 2008-10-05 01:09:58 -05:00
David Anderson 04b7b7b9ff Removed pointless performance warning. 2008-10-04 12:59:21 -07:00
David Anderson 2534fd1ce2 Fixed reverse order of evaluation in mapchooser causing an invalid handle read (bug 3290, r=bl4nk). 2008-09-30 22:45:26 -07:00
David Anderson e10dd226ff Fixed OnConfigsExecuted() not working on listen servers (bug 3287, r=me). 2008-09-29 20:02:19 -07:00
David Anderson b016623fb5 Removed debug spew left in adminmenu.sp. 2008-09-28 15:38:32 -07:00
Matt Woodrow 49d14111e2 Fixed mapchooser not starting a vote if RTV result is "Don't change" (bug 2734, r=bl4nk). 2008-09-27 21:46:07 -07:00
David Anderson f0a11d3cb7 Fixed project file name mismatch in the build tool. 2008-09-27 18:04:10 -07:00
David Anderson 168f42323b Missing regex vc9 project files (this is getting really tiresome). 2008-09-27 17:54:02 -07:00
David Anderson 64e7d0b737 Forgot to commit game.cstrike.ext msvc9 project files. 2008-09-27 17:43:30 -07:00
David Anderson 2e8c0c8f7d Added environment variable for MySQL5 since vcbuild.exe is being a pain. 2008-09-27 17:25:53 -07:00
David Anderson 8f555543cc Switch to vcbuilder.exe since devenv.com is not available in express editions. 2008-09-27 16:19:56 -07:00
David Anderson 88a71ddad4 Migrated to Visual Studio 2008 for default builds (bug 3257). 2008-09-27 14:59:09 -07:00
David Anderson 02e31bb576 Compiler now emits debug info about natives (bug 3282, r=sawce). 2008-09-27 13:46:42 -07:00
David Anderson 32f7bec6c8 Fixed building on GCC and some valgrind warnings. Read .dbg.natives table now. 2008-09-27 15:34:59 -05:00
Matt Woodrow a935e6f90d Merge! 2008-09-26 19:10:40 +12:00
Matt Woodrow f4dba84ae5 Core now detects and handles a changed maxplayers value (bug 2537 and bug 2758) 2008-09-26 19:08:49 +12:00
David Anderson 5cb4acf590 Added some notion of def-use to unfold copy propagation across registers and the eval stack.
At some point we will need to walk the expr tree to fold this back where appropriate, i.e. single use for calls.
2008-09-23 22:00:47 -07:00
David Anderson e83526aa63 Merge. 2008-09-23 21:21:03 -07:00
David Anderson 04021ed8b1 Initial import/sketch of opcode analyzer (bug 3279).
Uses single static assignment to recover expression trees from straight-line byte code.
2008-09-23 21:20:40 -07:00
David Anderson 31a4f40c9a Merge. 2008-09-23 01:17:40 -05:00
David Anderson 4001b0f804 Various chat commands now follow sm_show_activity (bug 2080, r=pred).
Added FormatActivitySource() native to assist in emulating ShowActivity().
2008-09-23 01:17:15 -05:00
David Anderson a838276ec2 Changed functag syntax so public keyword is in the normal place. The old style is still allowed. 2008-09-21 14:56:38 -07:00
David Anderson 6192efc078 Fixed realloc/delete[] mismatch (thank sawce), corrected some whitespace. 2008-09-21 14:05:13 -07:00
Matt Woodrow 4517031861 Updated randomcycle to use the Nextmap API 2008-09-21 14:20:01 +12:00
Matt Woodrow 187ff255bd GCC will not beat me! 2008-09-18 18:42:13 +12:00
Matt Woodrow dec172f0e1 Mergey Mergey 2008-09-18 18:28:17 +12:00
Matt Woodrow a0107299f3 Predcrab - Destroyer of builds strikes again 2008-09-18 18:27:41 +12:00
David Anderson bbbc2ce22c Merge (A la Worms 2, The First of Many!) 2008-09-18 00:15:34 -05:00
David Anderson def0a8a0d6 Attempt at solving this stdout redirection mess for buildbot. 2008-09-18 00:11:24 -05:00
Matt Woodrow 46095d797c Merge 2008-09-18 15:33:50 +12:00
Matt Woodrow 5687a7ba90 Added Struct Abstraction extension (bug 2666 and bug 2663)
--HG--
rename : extensions/structs/structs.txt => gamedata/structs.gamedata.txt
rename : extensions/structs/structs.inc => plugins/include/structs.inc
rename : extensions/structs/structtest.sp => plugins/testsuite/structtest.sp
2008-09-18 15:32:22 +12:00
David Anderson 556c03babf Added CreateDirectory() native and a few permissions macros (bug 3253, r=ds). 2008-09-17 02:07:19 -05:00
David Anderson 09ea2e13aa Fixed SDKTools not cleaning up its handle types on shutdown (but 2753). 2008-09-15 04:28:26 -05:00
David Anderson ef62e3d665 Fixed IHandleSys::RemoveType() not removing the type name from the name cache (bug 2753). 2008-09-15 04:26:58 -05:00
David Anderson fb2f0795c5 Fixed JIT 1.2 not compiling code for the SYSREQ.C opcode (bug 2764). This caused LDuke's TF2Nades to crash because spcomp doesn't seem to peephole optimize some sysreq.c's away for float operators (oddity discovered by sawce). 2008-09-14 23:42:20 -07:00
David Anderson fb44b51d26 Updated version files so I can build again. 2008-09-14 22:16:35 -07:00
David Anderson 8680d07e0a Triggering build. 2008-09-14 19:42:04 -05:00
David Anderson 9d8445b693 Triggering build. 2008-09-14 19:34:33 -05:00
David Anderson 5de80c03db Triggering build. 2008-09-14 19:28:48 -05:00
David Anderson c5df0bf58f Triggering build. 2008-09-14 19:28:03 -05:00
David Anderson 8c1502278b Triggering build. 2008-09-14 18:59:21 -05:00
David Anderson 08e3e3b53d Triggering build. 2008-09-14 18:57:01 -05:00
David Anderson 86591356b0 Triggering build. 2008-09-14 18:52:59 -05:00
David Anderson f62cf04f91 Triggering build. 2008-09-14 18:29:11 -05:00
David Anderson cf621eaf10 Triggering build. 2008-09-14 18:25:44 -05:00
David Anderson b8214a80c2 Cleared out NOTICE.txt. 2008-09-14 18:16:28 -05:00
David Anderson f79c9eec82 Changes to buildbot scripts for Mercurial. 2008-09-14 16:40:49 -05:00
David Anderson 8fcecf3dec Updated versionchanger.pl for Mercurial, FINALLY fixed its whitespace. 2008-09-14 16:26:38 -05:00
Scott Ehlert 326e8ee205 Fixed tags for sourcemod-central
sourcemod-1.0.0 - Orginally tagged by David Anderson <[email protected]> on Mon Mar 17 01:28:54 2008 UTC
2008-09-14 03:43:26 -05:00
Scott Ehlert bda56bf33f Eliminated head: da55a80522cf, a remnant of sourcemod-1.1.0 branch 2008-09-14 03:01:05 -05:00
Scott Ehlert 7439f15d7e Eliminated head for dead branch: refac-jit 2008-09-14 02:59:26 -05:00
Scott Ehlert 7a4967abc9 Eliminated head for dead branch: sourcemod-1.1.0 2008-09-14 02:58:58 -05:00
Scott Ehlert 6749545991 Eliminated head for dead branch: dvander 2008-09-14 02:58:07 -05:00
Scott Ehlert 124c3f4575 Eliminated head for dead branch: faluco 2008-09-14 02:57:14 -05:00
Scott Ehlert 56b77a536f Removed files for dead branch: refac-jit
--HG--
branch : refac-jit
2008-09-14 02:55:49 -05:00
Scott Ehlert e175cce776 Removed files for dead branch: sourcemod-1.1.0
--HG--
branch : sourcemod-1.1.0
2008-09-14 02:55:25 -05:00
Scott Ehlert 097f42a01c Removed files for dead branch: faluco
--HG--
branch : faluco
2008-09-14 02:54:50 -05:00
David Anderson bcf1b092ae Mirrored buildbot/version template changes from branch.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402539
2008-09-14 06:13:25 +00:00
Matt Schubert d707ea0de5 Fixed amb1929 - Banning via console should now work properly
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402533
2008-09-12 20:36:53 +00:00
Matt Woodrow 2c107e3601 Fixed amb1990 - Translator warnings not evaluating format params
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402532
2008-09-09 02:45:29 +00:00
David Anderson 29d1246b8d Fixed another sdktools team native crash, if m_szTeamName wasn't available (bug amb1779, r=pred).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402530
2008-09-08 07:00:34 +00:00
David Anderson 514fc7dfe8 Fixed missing translation for funvotes (bug amb1968).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402528
2008-09-08 06:38:10 +00:00
David Anderson 0691bca512 Added "antiflood.txt" to Core's IPhraseCollection to prevent error spew (bug amb1922).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402527
2008-09-08 06:20:54 +00:00
David Anderson e1f8a0fd68 Fixed the compiler eating too many characters in macro subsitutions (bug amb1938).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402526
2008-09-08 02:13:17 +00:00
David Anderson e141cf74d5 Fixed three bugs with team natives that appeared on INS: bounds checking had wrong binary shortcut order, bounds checking was off by one, error condition was not returned properly. Out-of-range team indexes no longer cause crashes now.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402523
2008-09-07 22:17:12 +00:00
David Anderson 9ca1ca62ea Fixed a nasty compiler bug where if the rhs of a ternary operator was larger than the lhs, the copy length emitted would only fit the lhs. The hier13() function now returns the larger of the lvalue sizes. (bug amb1853)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402521
2008-09-07 09:51:38 +00:00
David Anderson 99d27b979d Triggering rebuild for win32-trunk.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402519
2008-09-07 03:56:45 +00:00
David Anderson 681747d02c Fixed long strings with internal static copybacks causing buffer overflows (bug amb1986).
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402518
2008-09-07 03:24:51 +00:00
David Anderson 1ec936daf6 Testing pushing of build.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402516
2008-09-07 00:18:18 +00:00
David Anderson 8eb6d9ccf5 Added master.cfg from buildbot for safe keeping.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402514
2008-09-06 23:36:04 +00:00
David Anderson d3394453ff Fixed, hopefully, one of the last bugs in the symstore script.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402513
2008-09-06 23:26:52 +00:00
David Anderson 5caeebf807 Bugfixes to buildbot scripts, added symstore script.
Removed soon-to-be-outdated fetchdlls program.

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

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

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

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

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

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

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

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

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

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

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

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402400
2008-07-11 08:18:43 +00:00
David Anderson 5668f23b50 fixed a compat regression, forgot msvc does funky things with overloaded virtual calls
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402399
2008-07-11 06:51:21 +00:00
David Anderson 232f344c41 FindPluginByContext works again
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402398
2008-07-11 05:15:43 +00:00
David Anderson 79cf4e07eb GetContext() now returns 'this' as a hack (shouldn't+can't be accessed anyway)
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402397
2008-07-11 05:14:32 +00:00
David Anderson f9b294d89e updated makefile to actually work
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402396
2008-07-10 05:42:10 +00:00
David Anderson a88d7c1cdc fixed a number of regressions, things are starting to load
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402395
2008-07-10 05:38:54 +00:00
David Anderson 85760603b7 fixed linux build
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402394
2008-07-10 03:38:04 +00:00
Matt Woodrow ea1f5e86c0 Gamedata fetcher now unlocks gamedata files after a successful query
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402393
2008-07-10 01:26:02 +00:00
Matt Woodrow b1072d3b09 Fixed amb1838 - Mapchooser should not instantly start a new vote if the current one was cancelled (and caused a stack overflow)
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402392
2008-07-10 01:11:51 +00:00
Matt Woodrow 81632dda97 Fixed unload crash with tf2 extension.
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402391
2008-07-09 02:03:13 +00:00
Matt Woodrow 80fdbcf8c7 Fixed regression in ForwardSys with ET_LowEvent
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402390
2008-07-08 23:55:29 +00:00
Scott Ehlert bd2361c8ae Bumped IForwardSys
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402388
2008-07-08 21:17:05 +00:00
Scott Ehlert c9a81c0651 - Fixed amb1802: Crash when client was disconnected as a result of false being returned in OnClientConnect and a function that operated on this client was used. A client's connection state was not reset when this happened.
- Removed IForwardFilter due to overall horribleness (should be safe since no one seems to use it). Perhaps it might be back one day?
- Added ET_LowEvent forward exec type which is exactly the same as ET_Event, except that it returns the lowest value rather than the highest

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402386
2008-07-08 09:20:47 +00:00
David Anderson aa096f2385 fixed a few really dumb crash bugs in refac-jit
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402383
2008-07-08 07:59:33 +00:00
Matt Woodrow 53acb70260 Fixed build
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402382
2008-07-07 23:12:21 +00:00
Matt Woodrow 6ef4c4b3ad Fixed amb1828 - Not killing timers properly
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402381
2008-07-07 22:17:55 +00:00
Matt Woodrow 4ac38946f2 Fixed amb1815 - Custom admin menu wasn't escaping input
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402380
2008-07-07 22:11:49 +00:00
David Anderson af54ae6af7 fixed some build issues. deprecated ISourceMod::GetScriptingVM
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402378
2008-07-07 06:33:42 +00:00
David Anderson 2c23544b29 amazingly, core now builds. it probably crashes horribly but i'll test tomorrow.
--HG--
branch : refac-jit
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/refac-jit%402377
2008-07-07 06:25:15 +00:00
David Anderson 5351bbec71 more api for core
sets profiler+debugger now

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401937
2008-03-13 17:08:05 +00:00
David Anderson a64894bbe4 updated to trunk code
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401936
2008-03-13 17:04:25 +00:00
Matt Woodrow 50760d853f Cleaned up a few things in regex extension and updated project files to build on both engines. Linux makefiles probably still won't work.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401925
2008-03-04 23:18:16 +00:00
Matt Woodrow 62b08e923c Import of some basic tf2 stuff. Needs debugging properly.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401855
2008-01-17 00:31:58 +00:00
Matt Woodrow 2f41af814e Initial import of regex extension
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401848
2008-01-10 22:01:36 +00:00
Matt Woodrow d28eca4bb3 Increased max length for list items
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401831
2007-12-28 02:41:52 +00:00
Matt Woodrow 306be48027 Fixed dynamic menu reading userid2 as userid
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401830
2007-12-26 02:41:04 +00:00
Matt Woodrow 4ad308897f Few dynamic menu bug fixes.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401829
2007-12-26 01:16:38 +00:00
Michael McKoy f6b6dff4c0 Don't even bother trying to compile these, it's not finished. Just committing for archiving purposes, this is not intended for 1.0 release.
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401813
2007-12-19 22:19:34 +00:00
Matt Woodrow 3ba7c63862 Initial import of dynamic menu code (amb1039)
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401788
2007-12-10 21:02:00 +00:00
David Anderson 20112fe6cc skeleton tf2 extension for ferret
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401722
2007-11-23 05:27:58 +00:00
David Anderson 3f49d29274 merged trunk back into 1.1.0 branch for "safety"
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401721
2007-11-23 05:10:33 +00:00
David Anderson 0601988e80 branched trunk to 1.1.0
--HG--
branch : sourcemod-1.1.0
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/sourcemod-1.1.0%401681
2007-11-11 20:59:20 +00:00
David Anderson 9eb41bc475 removed local branch
--HG--
branch : dvander
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/dvander%4027
2006-07-15 05:11:30 +00:00
Borja Ferrer 7cd5c96087 identaAaAtion
--HG--
branch : faluco
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/branches/faluco%4017
2006-07-15 01:36:48 +00:00
2416 changed files with 631758 additions and 25359 deletions
+26
View File
@@ -0,0 +1,26 @@
# Binaries
\.dll$
\.dylib$
\.exe$
\.so$
# Files generated by Visual Studio
\.aps$
\.ipch$
\.ncb$
\.opensdf$
\.sdf$
\.suo$
\.user$
# Build directories
/CrazyDebug.*
/Debug.*
/Release.*
# Files generated by Mac OS X Finder
(^|/)\.DS_Store$
# Files generated by Windows Explorer
(^|/)[dD]esktop\.ini$
(^|/)[tT]humbs\.db$
+12
View File
@@ -0,0 +1,12 @@
54539fa4e51f98d7841c853c1370dff6ccd3cdf2 sourcemod-1.0.0
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
+411
View File
@@ -0,0 +1,411 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
import sys
from ambuild.command import SymlinkCommand
class SM:
def __init__(self):
self.compiler = Cpp.Compiler()
#Build SDK info
self.possibleSdks = { }
self.possibleSdks['ep1'] = {'sdk': 'HL2SDK', 'ext': '1.ep1', 'def': '1',
'name': 'EPISODEONE', 'platform': ['windows', 'linux']}
self.possibleSdks['ep2'] = {'sdk': 'HL2SDKOB', 'ext': '2.ep2', 'def': '3',
'name': 'ORANGEBOX', 'platform': ['windows', 'linux']}
self.possibleSdks['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '6',
'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']}
self.possibleSdks['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '7',
'name': 'LEFT4DEAD', 'platform': ['windows', 'linux', 'darwin']}
self.possibleSdks['l4d2'] = {'sdk': 'HL2SDKL4D2', 'ext': '2.l4d2', 'def': '8',
'name': 'LEFT4DEAD2', 'platform': ['windows', 'linux', 'darwin']}
self.possibleSdks['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2',
'name': 'DARKMESSIAH', 'platform': ['windows']}
self.possibleSdks['swarm'] = {'sdk': 'HL2SDK-SWARM', 'ext': '2.swarm', 'def': '9',
'name': 'ALIENSWARM', 'platform': ['windows']}
self.possibleSdks['bgt'] = {'sdk': 'HL2SDK-BGT', 'ext': '2.bgt', 'def': '4',
'name': 'BLOODYGOODTIME', 'platform': ['windows']}
self.possibleSdks['eye'] = {'sdk': 'HL2SDK-EYE', 'ext': '2.eye', 'def': '5',
'name': 'EYE', 'platform': ['windows']}
self.sdkInfo = { }
if AMBuild.mode == 'config':
#Detect compilers
self.compiler.DetectAll(AMBuild)
#Detect variables
envvars = { 'MMSOURCE18': 'mmsource-1.8',
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
'HL2SDKL4D': 'hl2sdk-l4d',
'HL2SDKL4D2': 'hl2sdk-l4d2',
'MYSQL5': 'mysql-5.0'
}
if AMBuild.target['platform'] != 'darwin':
envvars['HL2SDK'] = 'hl2sdk'
envvars['HL2SDKOB'] = 'hl2sdk-ob'
#Dark Messiah is Windows-only
if AMBuild.target['platform'] == 'windows':
envvars['HL2SDK-DARKM'] = 'hl2sdk-darkm'
envvars['HL2SDK-SWARM'] = 'hl2sdk-swarm'
envvars['HL2SDK-BGT'] = 'hl2sdk-bgt'
envvars['HL2SDK-EYE'] = 'hl2sdk-eye'
# Finds if a dict with `key` set to `value` is present on the dict of dicts `dictionary`
def findDictByKey(dictionary, key, value):
for index in dictionary:
elem = dictionary[index]
if elem[key] == value:
return (elem, index)
return None
for i in envvars:
if i in os.environ:
path = os.environ[i]
if not os.path.isdir(path):
raise Exception('Path for {0} was not found: {1}'.format(i, path))
elif i.startswith('HL2SDK'):
(info, sdk) = findDictByKey(self.possibleSdks, 'sdk', i)
self.sdkInfo[sdk] = info
else:
head = os.getcwd()
oldhead = None
while head != None and head != oldhead:
path = os.path.join(head, envvars[i])
if os.path.isdir(path):
break
oldhead = head
head, tail = os.path.split(head)
if i.startswith('HL2SDK'):
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)
if len(self.sdkInfo) < 1:
raise Exception('At least one SDK must be available.')
AMBuild.cache.CacheVariable('sdkInfo', self.sdkInfo)
#Set up defines
cxx = self.compiler.cxx
if isinstance(cxx, Cpp.CompatGCC):
if isinstance(cxx, Cpp.GCC):
self.vendor = 'gcc'
elif isinstance(cxx, Cpp.Clang):
self.vendor = 'clang'
self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp')
self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp')
self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf')
self.compiler.AddToListVar('CDEFINES', '_vsnprintf=vsnprintf')
self.compiler.AddToListVar('CFLAGS', '-pipe')
self.compiler.AddToListVar('CFLAGS', '-fno-strict-aliasing')
if (self.vendor == 'gcc' and cxx.majorVersion >= 4) or self.vendor == 'clang':
self.compiler.AddToListVar('CFLAGS', '-fvisibility=hidden')
self.compiler.AddToListVar('CXXFLAGS', '-fvisibility-inlines-hidden')
self.compiler.AddToListVar('CFLAGS', '-Wall')
self.compiler.AddToListVar('CFLAGS', '-Werror')
self.compiler.AddToListVar('CFLAGS', '-Wno-uninitialized')
self.compiler.AddToListVar('CFLAGS', '-Wno-unused')
self.compiler.AddToListVar('CFLAGS', '-Wno-switch')
self.compiler.AddToListVar('CFLAGS', '-msse')
self.compiler.AddToListVar('CFLAGS', '-m32')
self.compiler.AddToListVar('POSTLINKFLAGS', '-m32')
self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions')
self.compiler.AddToListVar('CXXFLAGS', '-fno-rtti')
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':
self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse')
elif isinstance(cxx, Cpp.MSVC):
self.vendor = 'msvc'
if AMBuild.options.debug == '1':
self.compiler.AddToListVar('CFLAGS', '/MTd')
self.compiler.AddToListVar('POSTLINKFLAGS', '/NODEFAULTLIB:libcmt')
else:
self.compiler.AddToListVar('CFLAGS', '/MT')
self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_DEPRECATE')
self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_WARNINGS')
self.compiler.AddToListVar('CDEFINES', '_CRT_NONSTDC_NO_DEPRECATE')
self.compiler.AddToListVar('CXXFLAGS', '/EHsc')
self.compiler.AddToListVar('CXXFLAGS', '/GR-')
self.compiler.AddToListVar('CFLAGS', '/W3')
self.compiler.AddToListVar('CFLAGS', '/nologo')
self.compiler.AddToListVar('CFLAGS', '/Zi')
self.compiler.AddToListVar('CXXFLAGS', '/TP')
self.compiler.AddToListVar('POSTLINKFLAGS', '/DEBUG')
self.compiler.AddToListVar('POSTLINKFLAGS', '/MACHINE:X86')
self.compiler.AddToListVar('POSTLINKFLAGS', '/SUBSYSTEM:WINDOWS')
self.compiler.AddToListVar('POSTLINKFLAGS', 'kernel32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'user32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'gdi32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'winspool.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'comdlg32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'advapi32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'shell32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'ole32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'oleaut32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'uuid.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'odbc32.lib')
self.compiler.AddToListVar('POSTLINKFLAGS', 'odbccp32.lib')
#Optimization
if AMBuild.options.opt == '1':
self.compiler.AddToListVar('CDEFINES', 'NDEBUG')
if self.vendor == 'gcc' or self.vendor == 'clang':
self.compiler.AddToListVar('CFLAGS', '-O3')
elif self.vendor == 'msvc':
self.compiler.AddToListVar('CFLAGS', '/Ox')
self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:ICF')
self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:REF')
#Debugging
if AMBuild.options.debug == '1':
self.compiler.AddToListVar('CDEFINES', 'DEBUG')
self.compiler.AddToListVar('CDEFINES', '_DEBUG')
if self.vendor == 'gcc' or self.vendor == 'clang':
self.compiler.AddToListVar('CFLAGS', '-g3')
elif self.vendor == 'msvc':
self.compiler.AddToListVar('CFLAGS', '/Od')
self.compiler.AddToListVar('CFLAGS', '/RTC1')
#Platform-specifics
if AMBuild.target['platform'] == 'linux':
self.compiler.AddToListVar('CDEFINES', '_LINUX')
if self.vendor == 'gcc':
self.compiler.AddToListVar('POSTLINKFLAGS', '-static-libgcc')
if self.vendor == 'clang':
self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
elif AMBuild.target['platform'] == 'darwin':
self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
# For OS X dylib versioning
import re
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
productContents = productFile.read()
productFile.close()
m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
if m == None:
self.version = '1.0.0'
else:
major, minor, release = m.groups()
self.version = '{0}.{1}.{2}'.format(major, minor, release)
AMBuild.cache.CacheVariable('version', self.version)
elif AMBuild.target['platform'] == 'windows':
self.compiler.AddToListVar('CDEFINES', 'WIN32')
self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
#Finish up
self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD')
self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD')
self.compiler.AddToListVar('CINCLUDES',
os.path.join(AMBuild.outputFolder, 'includes'))
self.compiler.ToConfig(AMBuild, 'compiler')
AMBuild.cache.CacheVariable('vendor', self.vendor)
self.targetMap = { }
AMBuild.cache.CacheVariable('targetMap', self.targetMap)
else:
self.sdkInfo = AMBuild.cache['sdkInfo']
self.compiler.FromConfig(AMBuild, 'compiler')
self.targetMap = AMBuild.cache['targetMap']
if AMBuild.target['platform'] == 'windows':
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
self.compiler.AddToListVar('RCINCLUDES',
os.path.join(AMBuild.outputFolder, 'includes'))
self.mmsPath = AMBuild.cache['MMSOURCE18']
def DefaultCompiler(self):
return self.compiler.Clone()
def JobMatters(self, jobname):
file = sys._getframe().f_code.co_filename
if AMBuild.mode == 'config':
self.targetMap[jobname] = file
return True
if len(AMBuild.args) == 0:
return True
if not jobname in AMBuild.args:
return False
def DefaultExtCompiler(self, path):
compiler = self.DefaultCompiler()
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path, 'sdk'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'extensions'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn'))
return compiler
def AutoVersion(self, folder, binary):
if AMBuild.target['platform'] == 'windows':
env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"', 'SM_GENERATED_BUILD']}
binary.AddResourceFile(os.path.join(folder, 'version.rc' ), env)
elif AMBuild.target['platform'] == 'darwin' and isinstance(binary, Cpp.LibraryBuilder):
binary.compiler['POSTLINKFLAGS'].extend(['-compatibility_version', '1.0.0'])
binary.compiler['POSTLINKFLAGS'].extend(['-current_version', AMBuild.cache['version']])
else:
return
def PreSetupHL2Job(self, job, builder, sdk):
info = self.sdkInfo[sdk]
sdkPath = AMBuild.cache[info['sdk']]
if AMBuild.target['platform'] == 'linux':
if sdk == 'ep1':
staticLibs = os.path.join(sdkPath, 'linux_sdk')
else:
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
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)
try:
os.lstat(link)
except:
job.AddCommand(SymlinkCommand(link, target))
else:
for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']:
link = os.path.join(workFolder, i)
target = os.path.join(staticLibs, i)
try:
os.lstat(link)
except:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'darwin':
staticLibs = os.path.join(sdkPath, 'lib', 'mac')
workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']:
link = os.path.join(workFolder, i)
target = os.path.join(staticLibs, i)
try:
os.lstat(link)
except:
job.AddCommand(SymlinkCommand(link, target))
elif AMBuild.target['platform'] == 'windows':
libs = ['tier0', 'tier1', 'vstdlib', 'mathlib']
if sdk == 'swarm':
libs.append('interfaces')
for lib in libs:
libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
builder.RebuildIfNewer(libPath)
builder['POSTLINKFLAGS'].append(libPath)
def PostSetupHL2Job(self, job, builder, sdk):
if AMBuild.target['platform'] in ['linux', 'darwin']:
builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
compiler = self.DefaultExtCompiler(path)
mms = 'core'
if sdk == 'ep1':
mms += oldMms
compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms))
compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms, 'sourcehook'))
info = self.possibleSdks
compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info])
paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'],
['public', 'tier0'], ['public', 'tier1']]
if sdk == 'ep1' or sdk == 'darkm':
paths.append(['public', 'dlls'])
paths.append(['game_shared'])
else:
paths.append(['public', 'game', 'server'])
paths.append(['public', 'toolframework'])
paths.append(['game', 'shared'])
paths.append(['common'])
info = self.sdkInfo[sdk]
sdkPath = AMBuild.cache[info['sdk']]
compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def'])
if sdk == 'swarm' and AMBuild.target['platform'] == 'windows':
compiler['CDEFINES'].extend(['COMPILER_MSVC', 'COMPILER_MSVC32'])
if sdk == 'ep1':
if AMBuild.target['platform'] == 'linux':
staticLibs = os.path.join(sdkPath, 'linux_sdk')
else:
if AMBuild.target['platform'] == 'linux':
staticLibs = os.path.join(sdkPath, 'lib', 'linux')
elif AMBuild.target['platform'] == 'darwin':
staticLibs = os.path.join(sdkPath, 'lib', 'mac')
for i in paths:
compiler['CXXINCLUDES'].append(os.path.join(sdkPath, *i))
if not noLink:
if AMBuild.target['platform'] == 'linux':
compiler['POSTLINKFLAGS'][0:0] = ['-lm']
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:
compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
elif AMBuild.target['platform'] == 'darwin':
compiler['POSTLINKFLAGS'][0:0] = ['libtier0.dylib']
compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.dylib']
return compiler
sm = SM()
globals = {
'SM': sm
}
AMBuild.Include(os.path.join('tools', 'buildbot', 'Versioning'), globals)
FileList = [
['loader', 'AMBuilder'],
['core', 'AMBuilder'],
['core', 'logic', 'AMBuilder'],
['extensions', 'bintools', 'AMBuilder'],
['extensions', 'clientprefs', 'AMBuilder'],
['extensions', 'cstrike', 'AMBuilder'],
['extensions', 'curl', 'AMBuilder'],
['extensions', 'geoip', 'AMBuilder'],
['extensions', 'mysql', 'AMBuilder'],
['extensions', 'sdktools', 'AMBuilder'],
['extensions', 'topmenus', 'AMBuilder'],
['extensions', 'updater', 'AMBuilder'],
['extensions', 'sqlite', 'AMBuilder'],
['extensions', 'regex', 'AMBuilder'],
['extensions', 'tf2', 'AMBuilder'],
['sourcepawn', 'jit', 'AMBuilder'],
['sourcepawn', 'compiler', 'AMBuilder'],
['plugins', 'AMBuilder'],
['tools', 'buildbot', 'PackageScript']
]
for parts in FileList:
AMBuild.Include(os.path.join(*parts), globals)
+3 -19
View File
@@ -1,21 +1,5 @@
We now use svn:keywords "Id" on all .c/.cpp/.h/.sp/.inc files. Please make sure your client is configured properly.
WINDOWS:
Open your Application Data folder.
Windows XP/2000: C:\Documents and Settings\<user>\Application Data
Windows Vista: C:\Users\<user>\AppData\Roaming
CONFIGURE YOUR IDENTITY FOR MERCURIAL!
IF YOU ARE A DEVELOPER WITH PUSH ACCESS, DO IT NOW KPLZTHX.
Now go to Subversion. Open the "config" file with a text editor.
LINUX:
Open ~/.subversion/config with your favorite text editor.
Under [miscellany], uncomment this line:
# enable-auto-props = yes
Under [auto-props], add these lines:
*.c = svn:keywords=Id
*.cpp = svn:keywords=Id
*.h = svn:keywords=Id
*.sp = svn:keywords=Id
*.inc = svn:keywords=Id
http://wiki.alliedmods.net/Mercurial_Tutorial#Identity
+765
View File
@@ -0,0 +1,765 @@
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]
URL: http://wiki.alliedmods.net/SourceMod_1.3.6_Release_Notes
User Changes:
- Updated support for latest Left 4 Dead 1 (bug 4681).
Developer Changes:
- Updated TF2 custom kill defines (bug 4682).
----------------------------
SourceMod 1.3.5 [2010-10-17]
URL: http://wiki.alliedmods.net/SourceMod_1.3.5_Release_Notes
User Changes:
- Updated support for CS:S, Garry's Mod, DoD:S, TF2, HL2DM.
- Added support for Firearms: Source (bug 4537).
- Added support for Fistful of Frags (bug 3883).
- Added support for Alien Swarm (bug 4530).
- Fixed living players hearing dead players if alltalk is disabled while deadtalk is on (bug 4533, thanks Zach Callear).
- Fixed timeleft not getting reset on Game_Commencing in CS:S (bug 4557).
- Fixed PlayerRunCmd being hooked when not used (bug 3990).
- Fixed errors and missing effects caused by missing sprites on L4D2 (bug 4512).
- Fixed 'sm plugins' public command skipping plugins in recommended listing (bug 4501).
- Fixed corruption with large database.cfg files (bug 4286).
Developer Changes:
- Added TF2 object stocks (bug 4536).
- Added TF2_MakeBleed native to TF2 ext (bug 4542).
- Added support for logical entities in Synergy (bug 4534).
- Updated TF2 conditions enum and defines (bug 4526).
- Fixed potential crash with IMemUtils::FindPattern on Linux (bug 4554).
----------------------------
SourceMod 1.3.4 [2010-07-18]
URL: http://wiki.alliedmods.net/SourceMod_1.3.4_Release_Notes
User Changes:
- Support for latest TF update (bug 4506).
- Support for latest L4D2 update (bug 4509).
Developer Changes:
- Added FindFlagChar native (bug 3776).
- Added GetConVarDefault native (bug 4502).
- Added forward for TF's GetHoliday function (bug 4462).
----------------------------
SourceMod 1.3.3 [2010-06-23]
URL: http://wiki.alliedmods.net/SourceMod_1.3.3_Release_Notes
User Changes:
- Added support for CS:S on Orange Box
- Added gamedata for Resistance and Liberation (bug 4418).
- Updated gamedata for SourceForts, Empires, Obsidian Conflict, Zombie Master.
- Fixed memory corruption and leaks with some voice functionality (bug 4415).
- Fixed UI bug in sm_motd (bug 4460).
Developer Changes:
- Added new player condition (TFCond_CritCola, bug 4447).
- Fixed clientprefs deleting cookies twice in rare cases (bug 4412).
- Fixed OnClientConnected forward not firing for bots (bug 4443).
- Fixed sm_dump_datamaps crash (bug 4424).
- Fixed switch case comparisons failing with large numbers (bug 4457).
- Fixed rare crash in output hooks (bug 4422).
- Fixed bug with dynamically sized arrays being sliced (bug 4428).
- Fixed SendConVarValue() on TF2, DOD:S, L4D, and L4D2 (bug 4273).
- Fixed TF2 natives not being marked optional (bug 4389).
----------------------------
SourceMod 1.3.2 [2010-05-02]
URL: http://wiki.alliedmods.net/SourceMod_1.3.2_Release_Notes
User Changes:
- Support for recent TF, DoD, and L4D2 updates (bug 4356, bug 4361, bug 4371, bug 4374, bug 4375).
- Fixed rare crash when replicating cvars to clients (bug 4315).
- Lots of extra game support for Insurgency, ZPS, CSProMod, PVKII, and FortressForever (thanks
Nicholas "psychonic" hastings).
Developer Changes:
- Added TF functions for stunning, conditions, regeneration, and power play (bug 4166, bug 4331).
----------------------------
SourceMod 1.3.1 [2010-02-09]
URL: http://wiki.alliedmods.net/SourceMod_1.3.1_Release_Notes
User Changes:
- Added extended support for CSProMod (bug 4255).
- Fixed client disconnect crash on many third party games (bug 4231).
- Improved support for Battlegrounds 2 (bug 4146).
- Improved support for Insurgency (bug 4180).
- Improved support for Garry's Mod (bug 4230, bug 4268).
- Improved support for Synergy (bug 4235).
- Updated Day of Defeat support for 20010123 update (bug 4262).
- Fixed Webternet extension not loading on Windows 2000 (bug 4234).
Developer Changes:
- Fixed compiler complaints when using |any| tag on array arguments (bug 4274).
- Fixed GetClientCookieTime not being exported (bug 4237).
- Fixed potential crash in entity handling code (bug 4249).
----------------------------
SourceMod 1.3.0 [2010-01-15]
URL: http://wiki.alliedmods.net/SourceMod_1.3.0_Release_Notes
Major Features:
* Left 4 Dead 2 support
* Non-networked entity support
User Changes:
- Added Left 4 Dead 2 support (bug 4075).
- Added much richer voting progress feedback (bug 1997).
- Improved support for various third-party games (Nicholas "psychonic" Hastings).
- Added @spec target (bug 2718).
- Added sm_resetcvar command (bug 3636).
- Added "motd" chat trigger (bug 2694).
- Updated GeoIP to OCT-2009.
- Fixed rare map vote error (bug 3905).
- Fixed small leak in the nominations plugin (bug 4104).
- Fixed last client being excluded from some command effects (bug 3984).
- Fixed crashes in plugin [|un|re]loading (bug 4034, bug 4038, bug 4044, bug 4153).
- Special target "@me" is now filtered for certain statuses properly (bug 4000).
- Improved non-admin to admin chat (bug 3844).
- Removed "auto.*" extension folders (bug 3949).
Developer Changes:
- Added non-networked entity support (bug 2459).
- Added improved random number generator (bug 3831).
- Added GetClientCookieTime native (bug 3736).
- Added AskPluginLoad2 callback (bug 3716).
- Added PlayerRunCmd callback (bug 3289).
- Added PointOutsideWorld native (bug 3906).
- Added API for "blanket" command hooks (bug 4015).
- Added ability to test for SourceMod features (bug 4021).
- Added ability to change broadcast status on hooked events (bug 3886).
- OnClientCommand no longer receives unconnected clients (bug 3732).
- Fixed various bugs in client listening API (bug 3818).
- Fixed crash in BanClient (bug 3912).
- Fixed various crashes in self-removing callbacks (bug 4059).
- Fixed rare HUD text crash on TF (bug 4016).
- Fixed OnConfigsExecuted not running on EP1 games with large configs (bug 3828).
- Fixed entity output hooks not working (bug 3988).
- Gamedata folder matches are now case-insensitive (bug 3913).
- Blocked plugins from hooking "sm" command (bug 4013).
----------------------------
SourceMod 1.2.4 [2009-10-03]
URL: http://wiki.alliedmods.net/SourceMod_1.2.4_Release_Notes
- Updated for L4D changes (bugs 4032, 4033, 4035).
- Updated GeoLite Country database for GeoIP extension.
- Fixed crash when block-loading more than eight plugins (bug 4034).
- Fixed rare crash in hudtext code on TF (bug 4016).
- Fixed crash when reloading a blocked plugin failed (bug 4038).
- Fixed Huntsman not firing critical callback on TF (bug 3927).
- Registering the "sm" command no longer has any effect (bug 4013).
- Fixed translation bug in extension API (bug 4010).
----------------------------
SourceMod 1.2.3 [2009-08-28]
URL: http://wiki.alliedmods.net/SourceMod_1.2.3_Release_Notes
- Fix extension filename lookup. (bug 3975).
----------------------------
SourceMod 1.2.2 [2009-08-28]
URL: http://wiki.alliedmods.net/SourceMod_1.2.2_Release_Notes
- Removed auto folders. (bug 3949).
- Added PointOutsideWorld native to sdktools. (bug 3906).
- Added "motd" chat trigger to basetriggers. (bug 2694).
- Added manual extension reloading command to root console menu. (bug 3934)
- Fixed 'list' type custom menu entries overwriting admin restrictions. (bug 3783).
- Added sm_resetcvar command to basecommands. (bug 3636).
- Updated gamedata for DOD:S. (bug 3948).
- Updated gamedata for TF2. (bug 3948).
- Added new .ep2v build config for valve OB based games. (bug 3948).
- Fixed incorrect escaping in clientprefs SQLite queries. (bug 3904)
- Updated gamedata for Synergy. (bug 3315).
- Upgraded to pcre-7.9 (bug 3923).
- Switched Insurgency chat printing to SayText. (bug 3738).
- Updated gamedata for Insurgency. (bug 3511).
- Updated gamedata for ZM. (bug 3746).
- Updated gamedata for Empires. (bug 3500).
- Updated gamedata for ZPS. (bug 3877).
- Updated gamedata for AoC. (bug 3891).
- Fixed RemovePlayerDisguise signature for TF2. (bug 3892).
----------------------------
SourceMod 1.2.1 [2009-05-31]
URL: http://wiki.alliedmods.net/SourceMod_1.2.1_Release_Notes
- Updated SDKTools for latest Team Fortress update.
- Added L4D handling to GuessSDKVersion() (bug 3842).
- Updated Zombie Panic Source offsets (bug 3632).
- Fixed crash when clientprefs saw disconnect from 64th client (bug 3821).
- Fixed Plugin_Handled acting like a Stop in usermsg hooks (bug 3685).
- Fixed early tv_enable causing crashes (bug 3766).
- Fixed unhook event crash (bug 3814).
- Fixed compiler reading uninitialized strings while processing varargs (bug 3811).
- Fixed compiler choosing whether to emit stradjust.pri on dynamic arrays based on uninitialized memory (bug 3810).
- Fixed Windows L4D CreateFakeClient signature (bug 3792).
- Fixed sm_slap for EP1 games (bug 3768).
- Fixed casting problems in TextParsers breaking TrimString for non-ASCII characters (bug 3800).
- Fixed OnClientConnect rejectmsg handling, improved doc (bug 3690).
- Fixed clientprefs not loading cookies for clients on late load (bug 3735).
- Fixed GetCommandFlags on original engine games (bug 3759).
- Fixed compiler asserting when returning a string literal (bug 3836).
- Fixed compiler erroring when tagging functions for string return (bug 3837).
- Fixed compiler not handling constant chained relational operators correctly (bug 3838).
- Fixed revote bug and inflexibilities in RedrawClientVoteMenu (bug 3834).
- Fixed auto update URL being set too late (bug 3699).
- Disabled nextmap in Synergy and Dystopia (bug 3687, bug 3741).
- Removed unnecessary SSE optimizations from msvc9 project files (bug 3756).
- Removed short-lived tag system (bug 3751).
- Removed the alive check from sm_rename. (bug 3698).
- Switched FortressForever to Valve menus (bug 3819).
----------------------------
SourceMod 1.2.0 [2009-03-05]
URL: http://wiki.alliedmods.net/SourceMod_1.2.0_Release_Notes
Major Features:
* Left 4 Dead Support
* Dark Messiah Support
* New and Improved Updater
Changes:
- Added Left 4 Dead support (bug 3414).
- Added Dark Messiah game support (requires Metamod:Source 1.7.1 or higher).
- Added sm_name command (bug 2150).
- Added extension-level dynamic hooking to bintools (bug 2616).
- Added client validation API to replace passing userids asynchronously.
- Added cURL extension, available to other extensions (bug 3560).
- Added parsing of custom gamedata files (bug 3644).
- Added case insensitivity search to ReplaceString (bug 3639, Fyren).
- Added more detail to certain player-oriented menu titles (bug 2740, Fyren).
- Added sv_tags API (bug 3677).
- Greatly improved admin-sql-prefetch performance for large tables (bug 3354, FLOOR_MASTER).
- Exposed IServer address to extensions (bug 3545).
- New gamedata organization; files are now smaller and per-game (bug 3546).
- Split sound functions into a new plugin, sounds.smx.
- Fixed slap and slay on Insurgency (bug 2560).
- Fixed blank admins being created from invalid admin file lines (bug 3431).
- Fixed basetriggers not working on Insurgency (bug 3497).
- Fixed client preferences missing some clients (bug 3616).
- Improved database fallback mechanism in clientprefs (bug 3564).
- Improved timer handling in funcommands (bug 3498).
- Improved compile.sh to take filenames (bug 3550, jonasfietz).
- sm_kick now shows the kick reason when available.
- Fixed MsgPostHook (ex MsgSentNotify) callbacks not firing on intercept hook (bug 3631).
- Note: SourceMod now adds "sourcemod" to the sv_tags cvar.
----------------------------
SourceMod 1.1.2 [2009-02-26]
URL: http://wiki.alliedmods.net/SourceMod_1.1.2_Release_Notes
Changes:
- Fixed critical hits being permanently disabled (bug 2674)
----------------------------
SourceMod 1.1.1 [2009-02-25]
URL: http://wiki.alliedmods.net/SourceMod_1.1.1_Release_Notes
Changes:
- Added Age of Chivalry support (bug 3366, IceMatrix).
- Added Obsidian Conflict support (bug 2699, The DOO).
- Fixed compatibility issues with latest TF2 update.
- Fixed crash when an event handler fired an event of the same name (bug 3468).
- Fixed rare crash in the event manager on post hooks (bug 3548).
- Fixed formatting error with zero precision floats (bug 3447).
- Fixed various Insurgency offsets (bug 3544).
- Fixed admin menu (topmenu) categories being selectable when not usable (bug 3256).
- Fixed sm_sql_addgroup not working (bug 3578).
- Fixed memory leak when events were hooked as EventHookMode_Post.
- Fixed nextmap trigger showing wrong output with end-of-map voting disabled and sm_trigger_show set to zero (bug 3597, mr.e.unk).
----------------------------
SourceMod 1.1.0 [2008-12-28]
URL: http://wiki.alliedmods.net/SourceMod_1.1.0_Release_Notes
Major features:
* New map management plugins.
* New reserved slot type.
* GameData updates are retrieved remotely
* Client Preferences extension for per-client "cookies"
* New incremental and independent JIT
Changes:
- Added new client preferences extension (API in clientprefs.inc, bug 1925).
- Added new gamedata auto-update functionality (bug 2602).
- Revamped and greatly expanded map management plugins and their functionality (bug 2201).
- Debug mode is now always on; as there is no longer a performance loss, there is no non-debug mode.
- The timeleft trigger can now handle mp_winlimit, mp_fraglimit, and mp_maxrounds (bug 2344).
- Translations can now be in separate files and placed in language-unique folders.
- The leading "STEAM_0:" or "STEAM_1:" in SteamIDs can now be omitted from admin files.
- Added sm_revote command so clients can participate in a vote that fell off their screen (bug 2156).
- Added Core API for creating stack structures (adt_stack.inc, bug 2441).
- Added API for extending mapchooser (mapchooser.inc, bug 2201).
- Added Core API for map transition control and history (nextmap.inc).
- Added TF2 forward for overriding how critical hits are calculated.
- Added SetClientInfo() native for modifying how a server sees a client's setinfo properties.
- Added CreateDirectory() native (bug 3253).
- Added "magic" MaxClients variable to replace slower GetMaxClients() call.
- Added support for three-letter language codes (bug 3526).
- Functions to control client versus client mic listening now work as described (bug 2498).
- Fixed SDKTools not being reloadable, and fixed a related bug in Handle type removal (bug 2753).
- Rewrote internal translation handling. Extensions now have access to an ITranslator API (bug 2535).
- Rewrote internal handling of dependencies (especially relating to native providers) (bug 2466).
- Added user config hooks to IGameConfigManager, for parsing user-defined sections.
- Revamped SourcePawn API. Removed and deprecated many structures and functions accidentally exposed publicly.
- Revamped SourcePawn structure, it is now separable from SourceMod for other projects.
- Renamed basefuncommands.phrases.txt to funcommands.phrases.txt (bug 2485).
- Renamed basefunvotes.phrases.txt to funvotes.phrases.txt (bug 2485).
- Added IDBDriver API call for extensions to handle IDBDriver dependencies properly.
- Usermessage natives now validate clients to prevent crashing.
- Fixed OnConfigsExecuted not working on listen servers.
- Fixed out-of-handle conditions in CreateTimer() causing crashes (bug 3381).
- Fixed accessing invalid Handles causing crashes (bug 3359).
- Fixed memory corruption with MySQL + FetchString (bug 3352).
- Fixed ReadFileString ignoring its fourth parameter (bug 3459).
- Fixed sm_sql_addadmin reading the immunity field as a password (bug 3395).
- Fixed ReadFile sign-extending instead of zero-extending (bug 3449).
----------------------------
SourceMod 1.0.4 [2008-09-14]
Changes:
- Fixed amb1986: Format() with very long strings could crash if the input and output buffers overlapped.
- Fixed amb1938: The compiler ate too many characters in preprocessor macros.
- Fixed amb1935: Topmenu child names were not uncached when a category was deleted.
- Fixed amb1929: Banning via the console threw a runtime error.
- Fixed amb1918: Ban menu should compare userids, not client indexes
- Fixed amb1916: Threaded query delay is now 50ms instead of 500ms.
- Fixed amb1899: Duplicate maps in auto generated maplists.
- Fixed amb1891: Basechat didn't check for blank message in private says.
- Fixed amb1853: Ternary operators with string assignments could chop strings off.
- Fixed amb1815: Custom admin menu wasn't escaping input.
- Fixed amb1808: KickClient() is now delayed to prevent crashes, use KickClientEx for old functionality.
- Fixed amb1802: Possible crash when a client disconnected.
- Fixed amb1801: Improved bot detection, and fixed bots crashing if inside an OrangeBox server.cfg.
- Fixed amb1780: admin-sql-threaded had a debug spew turned on.
- Fixed amb1779: Crash in GetTeamName() on mods that don't support it.
- Fixed amb1763: Function call status is now cleared on a new function call.
- Fixed amb1749: Updated and improved DoD:S SDKTools coverage.
- Fixed team native crashes in SDKTools for mods like Insurgency.
- Fixed various file handle leaks.
----------------------------
SourceMod 1.0.3 [2008-06-21]
Changes:
- Fixed SDKTools compatibility for latest TF2 update.
- Fixed amb1750: OnAutoConfigsBuffered() inserted before "exec server.cfg".
- Fixed a logic bug where OnConfigsExecuted() could be executed before "exec server.cfg" finished.
- Fixed a rare crash in the event manager that manifested on Zombie Panic! Source.
----------------------------
SourceMod 1.0.2 [2008-05-31]
Changes:
- The admin menu is now user-modifiable (the "Dynamic Admin Menu").
- Added a TF2 extension with Team Fortress functions.
- Added a RegEx extension with regular expression functions.
- Added functions to SDKTools for hooking entity outputs.
- Added preliminary support for the DoD:S Orange Box beta.
- Added a forward for map config plugins for preventing race conditions.
- Added a %b format specifier for binary printing.
- Added sm_dump_datamaps command (SDKTools) for enumerating datamap properties.
- Added sm_dump_admcache command for debugging the admin cache.
- Added amb1715 - TraceHull functions to SDKTools (complementing TraceRay).
- Added amb1694 - FindCharInString() function.
- Added amb1685 - GetTickInterval() function.
- Added amb1620 - ActivateEntity() function to SDKTools (for Orange Box particle system).
- Added amb1610 - StripQuotes() function.
- Added amb1558 - Compiler now has __BINARY_PATH__ and __BINARY_FILE__ macros.
- Fixed amb1686 - ReplaceString* with an empty search string crashed; it now throws an error.
- Fixed amb1684 - Blank passwords required an empty but set password.
- Fixed amb1595 - Extension load failures did not show a platform error message.
- Fixed amb1583 - MySQL string fetch from prepared queries returned corrupted data.
- Fixed amb1358 - Timeleft did not reset on TF2 restarts.
- Fixed cases where the JIT was too cautious in space optimizations.
- Fixed TF2/Cstrike extensions being loadable on incompatible games.
- Fixed various documentation inconsistencies and typos.
- Fixed internal bugs with file extension handling.
Notes:
There is a possible compatibility regression from amb1684. SetAdminPassword()
has been modified to remove any set password when given an empty string. Previously,
a blank password ("") would force an admin to use "setinfo" to set an empty password,
but this functionality was deemed unuseful and unintended. Blank passwords now
remove any set password.
----------------------------
SourceMod 1.0.1 [2008-05-20]
Changes:
- Fixed SDKTools compatibility for latest TF2 update.
- Removed GivePlayerItem from TF2 (TF2 update broke functionality).
- Fixed amb1688: GivePlayerItem offset was wrong for DoD:S Linux.
- Fixed amb1657: Server console did not see admin version of sm_who.
- Fixed amb1648: Stack corruption from GetClientEyeAngles() on Windows.
- Fixed amb1646: NetFlow_Both did not work for client network statistics.
- Fixed amb1601: Vote FF menu reading from sv_alltalk cvar instead of mp_friendlyfire.
- Fixed amb1591: Fixed listen server crashes on mods like IOS:S which pre-add more than one bot.
- Fixed amb1586: GetTeamName() could crash the server if called on load.
- Fixed mapchooser's round counting for TF2.
- Fixed a bug where an RTE on plugin load would throw a message referring to the plugin as "-1".
- Symbols are no longer stripped on Linux.
- Minor SourceMod SDK fixes.
Notes:
The extension interface version has been bumped. Any extensions compiled against 1.0.1 will require 1.0.1 or higher to run. Extensions against 1.0.0 will continue to run normally.
+12
View File
@@ -0,0 +1,12 @@
// Custom admin menu commands.
// For more information:
//
// http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
//
// Note: This file must be in Valve KeyValues format (no multiline comments)
//
"Commands"
{
}
+20
View File
@@ -0,0 +1,20 @@
/* Add group options to be added to 'group' or 'groupplayer' type submenus
* The left side is the name that will show in the menu, right is the command that will be fired
*
* For more information: http://wiki.alliedmods.net/Custom_Admin_Menu_%28SourceMod%29
*/
Groups
{
"All" "@all"
"Bots" "@bots"
"Alive" "@alive"
"Dead" "@dead"
"Humans" "@humans"
"Current aim" "@aim"
/* You can enable these if you are using Counter-Strike Source and running the cstrike extension */
// "Terrorists" "@t"
// "Counter-Terrorists" "@ct"
}
+3 -3
View File
@@ -16,7 +16,7 @@
// "@Full Admins"
//
// You can also specify immunity values. Two examples:
// "83:abcdefg" //Immunity is 83, flags are abcefgh
// "83:abcdefgh" //Immunity is 83, flags are abcdefgh
// "6:@Full Admins" //Immunity is 6, group is "Full Admins"
//
// Immunity values can be any number. An admin cannot target an admin with
@@ -37,9 +37,9 @@
////////////////////////////////
// Examples: (do not put // in front of real lines, as // means 'comment')
//
// "STEAM_0:1:16" "bce" //kick, ban, slay for this steam ID, no immunity
// "STEAM_0:1:16" "bce" //generic, kick, unban for this steam ID, no immunity
// "!127.0.0.1" "99:z" //all permissions for this ip, immunity value is 99
// "BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, kick, ban
// "BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, generic, kick
//
////////////////////////////////
+1
View File
@@ -1,6 +1,7 @@
//This file unloads all plugins, re-loads a few "safe" ones, and then prevents
//any more plugins from being loaded.
sm plugins unload_all
sm plugins load_unlock
sm plugins load basebans.smx
sm plugins load basecommands.smx
sm plugins load admin-flatfile.smx
+28 -3
View File
@@ -80,21 +80,21 @@ sm_reserve_type 0
sm_reserved_slots 0
// Specifies whether or not reserved slots will be hidden (subtracted from max
// slot count). Valid values are 0 (visible) or 1 (hidden).
// slot count). Valid values are 0 (Visible) or 1 (Hidden).
// --
// Requires: reservedslots.smx
// Default: 0
sm_hide_slots 0
// Specifies whether or not non-admins can send messages to admins using
// say_team @<message>. Valid values are 0 (disabled) or 1 (enabled)
// say_team @<message>. Valid values are 0 (Disabled) or 1 (Enabled)
// --
// Requires: basechat.smx
// Default: 1
sm_chat_mode 1
// Specifies whether or not "timeleft" will automaticly be triggered every
// x seconds. Valid values are 0 (disabled) to 1800 seconds.
// x seconds. Valid values are 0 (Disabled) to 1800 seconds.
// --
// Requires: basetriggers.smx
// Default: 0
@@ -107,3 +107,28 @@ sm_timeleft_interval 0
// Requires: basetriggers.smx
// Default: 1
sm_trigger_show 1
// Specifies whether or not to display vote progress to clients in the
// "hint" box (near the bottom of the screen in most games).
// Valid values are 0 (Disabled) or 1 (Enabled).
// --
// Default: 0
sm_vote_progress_hintbox 0
// Specifies whether or not to display vote progress to clients in the
// chat area. Valid values are 0 (Disabled) or 1 (Enabled).
// --
// Default: 0
sm_vote_progress_chat 0
// Specifies whether or not to display vote progress in the server console.
// Valid values are 0 (Disabled) or 1 (Enabled).
// --
// Default: 0
sm_vote_progress_console 0
// Specifies whether or not to display vote progress to clients in the
// client console. Valid values are 0 (Disabled) or 1 (Enabled).
// --
// Default: 0
sm_vote_progress_client_console 0
+37 -8
View File
@@ -4,14 +4,6 @@
*/
"Core"
{
/**
* Relative path to SourceMod's base directory. This is relative to the game/mod directory.
* Only change this if you have installed SourceMod in a non-default location.
*
* The default value is "addons/sourcemod"
*/
"BasePath" "addons/sourcemod"
/**
* This option determines if SourceMod logging is enabled.
*
@@ -88,4 +80,41 @@
* "off" - Translate using default server's language
*/
"AllowClLanguageVar" "On"
/**
* Enables or Disables SourceMod's automatic gamedata updating.
*
* The default value is "no". A value of "yes" will block the Auto Updater.
*/
"DisableAutoUpdate" "no"
/**
* If set to yes, a successful gamedata update will attempt to restart SourceMod.
* SourceMod is unloaded and reloaded, and the map is changed to the current map.
* Since gamedata updates occur when the server loads, impact should be minimal.
* But to be safe, this option is disabled by default.
*/
"ForceRestartAfterUpdate" "no"
/**
* URL to use for retrieving update information.
* SSL is not yet supported.
*/
"AutoUpdateURL" "http://update.sourcemod.net/update/"
/**
* Whether to show debug spew.
* 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"
}
+13
View File
@@ -2,6 +2,8 @@
{
"driver_default" "mysql"
// When specifying "host", you may use an IP address, a hostname, or a socket file path
"default"
{
"driver" "default"
@@ -18,4 +20,15 @@
"driver" "sqlite"
"database" "sourcemod-local"
}
"clientprefs"
{
"driver" "sqlite"
"host" "localhost"
"database" "clientprefs-sqlite"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}
}
Binary file not shown.
-2
View File
@@ -1,6 +1,4 @@
"Languages"
{
"en" "English"
"es" "Español"
}
+2 -2
View File
@@ -51,8 +51,8 @@
"target" "default"
}
/* For the "randomcycle" plugin */
"rockthevote"
/* For the "nominations" plugin */
"nominations"
{
"target" "default"
}
+2 -4
View File
@@ -6,14 +6,13 @@
* Available properties for plugins are:
* "pause" - Whether or not the plugin should load paused - "yes" or "no" (default)
* "lifetime" - Lifetime of the plugin. Options:
* "mapsync" - Plugins should be reloaded on mapchange if changed (default)
* "global" - Plugin will never be unloaded or updated
* "mapsync" - Plugins should be reloaded on mapchange if changed (default)
* "global" - Plugin will never be unloaded or updated
* "blockload" - Plugin will always be blocked from loading. Implicit (automatic) loads
* produce no error, but explicit (manual) loads will show an error message.
* (Options are one of "yes" or "no")
*
* You can also have an "Options" section declaring options to pass onto the JIT:
* "debug" - Whether or not to load the plugin in debug mode
* "profile" - Bit flags for profiling level. Add flags together to reach a value.
* WARNING: Profiler is _ALPHA_ software! Use it at your own risk for
* development cycles only (not production setups).
@@ -32,7 +31,6 @@
"Options"
{
"debug" "no"
}
}
}
@@ -0,0 +1,17 @@
CREATE TABLE sm_cookies
(
id INTEGER unsigned NOT NULL auto_increment,
name varchar(30) NOT NULL UNIQUE,
description varchar(255),
access INTEGER,
PRIMARY KEY (id)
);
CREATE TABLE sm_cookie_cache
(
player varchar(65) NOT NULL,
cookie_id int(10) NOT NULL,
value varchar(100),
timestamp int NOT NULL,
PRIMARY KEY (player, cookie_id)
);
@@ -0,0 +1,16 @@
CREATE TABLE sm_cookies
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name varchar(30) NOT NULL UNIQUE,
description varchar(255),
access INTEGER
);
CREATE TABLE sm_cookie_cache
(
player varchar(65) NOT NULL,
cookie_id int(10) NOT NULL,
value varchar(100),
timestamp int,
PRIMARY KEY (player, cookie_id)
);
+10
View File
@@ -0,0 +1,10 @@
# vim: set ts=2 sw=2 tw=99 noet:
import sys
import ambuild.runner as runner
run = runner.Runner()
run.options.add_option('--enable-debug', action='store_const', const='1', dest='debug',
help='Enable debugging symbols')
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
help='Enable optimization')
run.Configure(sys.path[0])
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+78
View File
@@ -0,0 +1,78 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
for i in SM.sdkInfo:
sdk = SM.sdkInfo[i]
if AMBuild.target['platform'] not in sdk['platform']:
continue
name = 'sourcemod.' + sdk['ext']
compiler = SM.DefaultHL2Compiler('core', i)
extension = AMBuild.AddJob(name)
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
SM.PreSetupHL2Job(extension, binary, i)
files = [
'AdminCache.cpp',
'ExtensionSys.cpp',
'MenuStyle_Valve.cpp',
'logic_bridge.cpp',
'smn_entities.cpp',
'sm_stringutil.cpp',
'ADTFactory.cpp',
'ForwardSys.cpp',
'MenuVoting.cpp',
'smn_events.cpp',
'smn_menus.cpp',
'sm_trie.cpp',
'CDataPack.cpp',
'frame_hooks.cpp',
'NativeInvoker.cpp',
'smn_fakenatives.cpp',
'smn_nextmap.cpp',
'sourcemm_api.cpp',
'ChatTriggers.cpp',
'NativeOwner.cpp',
'smn_filesystem.cpp',
'smn_player.cpp',
'sourcemod.cpp',
'concmd_cleaner.cpp',
'HalfLife2.cpp',
'NextMap.cpp',
'ConCmdManager.cpp',
'HandleSys.cpp',
'ConVarManager.cpp',
'LibrarySys.cpp',
'PlayerManager.cpp',
'TimerSys.cpp',
'CoreConfig.cpp',
'Logger.cpp',
'PluginInfoDatabase.cpp',
'smn_bitbuffer.cpp',
'smn_halflife.cpp',
'PluginSys.cpp',
'smn_console.cpp',
'UserMessages.cpp',
'Database.cpp',
'MenuManager.cpp',
'smn_core.cpp',
'smn_hudtext.cpp',
'smn_usermsgs.cpp',
'DebugReporter.cpp',
'MenuStyle_Base.cpp',
'ShareSys.cpp',
'smn_database.cpp',
'smn_keyvalues.cpp',
'smn_vector.cpp',
'EventManager.cpp',
'MenuStyle_Radio.cpp',
'sm_autonatives.cpp',
'sm_srvcmds.cpp',
'ConsoleDetours.cpp'
]
binary.AddSourceFiles('core', files)
SM.PostSetupHL2Job(extension, binary, i)
SM.AutoVersion('core', binary)
binary.SendToJob()
+374 -8
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -41,12 +41,14 @@
#include "sourcemod.h"
#include "sm_stringutil.h"
#include "sourcemm_api.h"
#include "sm_srvcmds.h"
#define LEVEL_STATE_NONE 0
#define LEVEL_STATE_LEVELS 1
#define LEVEL_STATE_FLAGS 2
AdminCache g_Admins;
char g_ReverseFlags[26];
AdminFlag g_FlagLetters[26];
bool g_FlagSet[26];
@@ -160,8 +162,6 @@ private:
c -= (unsigned)'a';
assert(c >= 0 && c < 26);
if (!g_Admins.FindFlag(key, &g_FlagLetters[c]))
{
ParseError(states, "Unrecognized admin level \"%s\"", key);
@@ -299,8 +299,23 @@ void AdminCache::OnSourceModAllInitialized()
void AdminCache::OnSourceModLevelChange(const char *mapName)
{
int i;
AdminFlag flag;
/* For now, we only read these once per level. */
s_FlagReader.LoadLevels();
for (i = 0; i < 26; i++)
{
if (FindFlag('a' + i, &flag))
{
g_ReverseFlags[flag] = 'a' + i;
}
else
{
g_ReverseFlags[flag] = '?';
}
}
}
void AdminCache::OnSourceModShutdown()
@@ -434,7 +449,9 @@ AdminId AdminCache::CreateAdmin(const char *name)
assert(pUser->magic == USR_MAGIC_UNSET);
id = m_FreeUserList;
m_FreeUserList = pUser->next_user;
} else {
}
else
{
id = m_pMemory->CreateMem(sizeof(AdminUser), (void **)&pUser);
pUser->grp_size = 0;
pUser->grp_table = -1;
@@ -454,19 +471,28 @@ AdminId AdminCache::CreateAdmin(const char *name)
{
m_FirstUser = id;
m_LastUser = id;
} else {
}
else
{
AdminUser *pPrev = (AdminUser *)m_pMemory->GetAddress(m_LastUser);
pPrev->next_user = id;
pUser->prev_user = m_LastUser;
m_LastUser = id;
}
/* Since we always append to the tail, we should invalidate their next */
pUser->next_user = -1;
if (name && name[0] != '\0')
{
int nameidx = m_pStrings->AddString(name);
pUser = (AdminUser *)m_pMemory->GetAddress(id);
pUser->nameidx = nameidx;
}
else
{
pUser->nameidx = -1;
}
return id;
}
@@ -1144,6 +1170,11 @@ bool AdminCache::GetMethodIndex(const char *name, unsigned int *_index)
bool AdminCache::BindAdminIdentity(AdminId id, const char *auth, const char *ident)
{
if (ident[0] == '\0')
{
return false;
}
AdminUser *pUser = (AdminUser *)m_pMemory->GetAddress(id);
if (!pUser || pUser->magic != USR_MAGIC_SET)
{
@@ -1156,6 +1187,12 @@ bool AdminCache::BindAdminIdentity(AdminId id, const char *auth, const char *ide
return false;
}
/* If the id was a steam id strip off the STEAM_*: part */
if (strcmp(auth, "steam") == 0 && strncmp(ident, "STEAM_", 6) == 0)
{
ident += 8;
}
if (sm_trie_retrieve(pTable, ident, NULL))
{
return false;
@@ -1178,6 +1215,12 @@ AdminId AdminCache::FindAdminByIdentity(const char *auth, const char *identity)
return INVALID_ADMIN_ID;
}
/* If the id was a steam id strip off the STEAM_*: part */
if (strcmp(auth, "steam") == 0 && strncmp(identity, "STEAM_", 6) == 0)
{
identity += 8;
}
void *object;
if (!sm_trie_retrieve(pTable, identity, &object))
{
@@ -1412,6 +1455,12 @@ void AdminCache::SetAdminPassword(AdminId id, const char *password)
return;
}
if (password[0] == '\0')
{
pUser->password = -1;
return;
}
int i_password = m_pStrings->AddString(password);
pUser = (AdminUser *)m_pMemory->GetAddress(id);
pUser->password = i_password;
@@ -1587,7 +1636,9 @@ bool AdminCache::CanAdminTarget(AdminId id, AdminId target)
bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
{
if (c < 'a' || c > 'z')
if (c < 'a'
|| c > 'z'
|| !g_FlagSet[(unsigned)c - (unsigned)'a'])
{
return false;
}
@@ -1600,6 +1651,21 @@ bool AdminCache::FindFlag(char c, AdminFlag *pAdmFlag)
return true;
}
bool AdminCache::FindFlagChar(AdminFlag flag, char *c)
{
if (!g_FlagSet[flag])
{
return false;
}
if (c)
{
*c = g_ReverseFlags[flag];
}
return true;
}
FlagBits AdminCache::ReadFlagString(const char *flags, const char **end)
{
FlagBits bits = 0;
@@ -1653,7 +1719,7 @@ bool AdminCache::CanAdminUseCommand(int client, const char *cmd)
}
}
return g_ConCmds.CheckCommandAccess(client, cmd, bits);
return g_ConCmds.CheckClientCommandAccess(client, cmd, bits);
}
unsigned int AdminCache::SetGroupImmunityLevel(GroupId gid, unsigned int level)
@@ -1728,5 +1794,305 @@ bool AdminCache::CheckAccess(int client, const char *cmd, FlagBits flags, bool o
GetCommandOverride(cmd, Override_Command, &bits);
}
return g_ConCmds.CheckCommandAccess(client, cmd, bits) ? 1 : 0;
return g_ConCmds.CheckClientCommandAccess(client, cmd, bits) ? 1 : 0;
}
void iterator_glob_basic_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\"%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_glob_grp_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_group_basic_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\t\t\"%s\"\t\t\"%s\"\n", key, flagstr);
}
void iterator_group_grp_override(Trie *pTrie, const char *key, void **value, void *data)
{
FILE *fp;
int flags;
char flagstr[64];
fp = (FILE *)data;
flags = (int)*value;
g_Admins.FillFlagString(flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t\t\t\"@%s\"\t\t\"%s\"\n", key, flagstr);
}
void AdminCache::DumpCache(FILE *fp)
{
int *itable;
AdminId aid;
GroupId gid;
char flagstr[64];
unsigned int num;
AdminUser *pAdmin;
AdminGroup *pGroup;
char name_buffer[512];
fprintf(fp, "\"Groups\"\n{\n");
num = 0;
gid = m_FirstGroup;
while (gid != INVALID_GROUP_ID
&& (pGroup = GetGroup(gid)) != NULL)
{
num++;
FillFlagString(pGroup->addflags, flagstr, sizeof(flagstr));
fprintf(fp, "\t/* num = %d, gid = 0x%X */\n", num, gid);
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pGroup->nameidx));
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pGroup->immunity_level);
if (pGroup->immune_table != -1
&& (itable = (int *)m_pMemory->GetAddress(pGroup->immune_table)) != NULL)
{
AdminGroup *pAltGroup;
const char *gname, *mod;
for (int i = 1; i <= itable[0]; i++)
{
if ((pAltGroup = GetGroup(itable[i])) == NULL)
{
/* Assume the rest of the table is corrupt */
break;
}
gname = GetString(pAltGroup->nameidx);
if (atoi(gname) != 0)
{
mod = "@";
}
else
{
mod = "";
}
fprintf(fp, "\t\t\"immunity\"\t\t\"%s%s\"\n", mod, gname);
}
}
fprintf(fp, "\n\t\t\"Overrides\"\n\t\t{\n");
if (pGroup->pCmdGrpTable != NULL)
{
sm_trie_bad_iterator(pGroup->pCmdGrpTable,
name_buffer,
sizeof(name_buffer),
iterator_group_grp_override,
fp);
}
if (pGroup->pCmdTable != NULL)
{
sm_trie_bad_iterator(pGroup->pCmdTable,
name_buffer,
sizeof(name_buffer),
iterator_group_basic_override,
fp);
}
fprintf(fp, "\t\t}\n");
fprintf(fp, "\t}\n");
if ((gid = pGroup->next_grp) != INVALID_GROUP_ID)
{
fprintf(fp, "\n");
}
}
fprintf(fp, "}\n\n");
fprintf(fp, "\"Admins\"\n{\n");
num = 0;
aid = m_FirstUser;
while (aid != INVALID_ADMIN_ID
&& (pAdmin = GetUser(aid)) != NULL)
{
num++;
FillFlagString(pAdmin->flags, flagstr, sizeof(flagstr));
fprintf(fp, "\t/* num = %d, aid = 0x%X, serialno = 0x%X*/\n", num, aid, pAdmin->serialchange);
if (pAdmin->nameidx != -1)
{
fprintf(fp, "\t\"%s\"\n\t{\n", GetString(pAdmin->nameidx));
}
else
{
fprintf(fp, "\t\"\"\n\t{\n");
}
if (pAdmin->auth.identidx != -1)
{
fprintf(fp, "\t\t\"auth\"\t\t\t\"%s\"\n", GetMethodName(pAdmin->auth.index));
fprintf(fp, "\t\t\"identity\"\t\t\"%s\"\n", GetString(pAdmin->auth.identidx));
}
if (pAdmin->password != -1)
{
fprintf(fp, "\t\t\"password\"\t\t\"%s\"\n", GetString(pAdmin->password));
}
fprintf(fp, "\t\t\"flags\"\t\t\t\"%s\"\n", flagstr);
fprintf(fp, "\t\t\"immunity\"\t\t\"%d\"\n", pAdmin->immunity_level);
if (pAdmin->grp_count != 0
&& pAdmin->grp_table != -1
&& (itable = (int *)m_pMemory->GetAddress(pAdmin->grp_table)) != NULL)
{
unsigned int i;
for (i = 0; i < pAdmin->grp_count; i++)
{
if ((pGroup = GetGroup(itable[i])) == NULL)
{
/* Assume the rest of the table is corrupt */
break;
}
fprintf(fp, "\t\t\"group\"\t\t\t\"%s\"\n", GetString(pGroup->nameidx));
}
}
fprintf(fp, "\t}\n");
if ((aid = pAdmin->next_user) != INVALID_ADMIN_ID)
{
fprintf(fp, "\n");
}
}
fprintf(fp, "}\n\n");
fprintf(fp, "\"Overrides\"\n{\n");
if (m_pCmdGrpOverrides != NULL)
{
sm_trie_bad_iterator(m_pCmdGrpOverrides,
name_buffer,
sizeof(name_buffer),
iterator_glob_grp_override,
fp);
}
if (m_pCmdOverrides != NULL)
{
sm_trie_bad_iterator(m_pCmdOverrides,
name_buffer,
sizeof(name_buffer),
iterator_glob_basic_override,
fp);
}
fprintf(fp, "}\n");
}
AdminGroup *AdminCache::GetGroup(GroupId gid)
{
AdminGroup *pGroup;
pGroup = (AdminGroup *)m_pMemory->GetAddress(gid);
if (!pGroup || pGroup->magic != GRP_MAGIC_SET)
{
return NULL;
}
return pGroup;
}
AdminUser *AdminCache::GetUser(AdminId aid)
{
AdminUser *pAdmin;
pAdmin = (AdminUser *)m_pMemory->GetAddress(aid);
if (!pAdmin || pAdmin->magic != USR_MAGIC_SET)
{
return NULL;
}
return pAdmin;
}
const char *AdminCache::GetMethodName(unsigned int index)
{
List<AuthMethod>::iterator iter;
for (iter=m_AuthMethods.begin();
iter!=m_AuthMethods.end();
iter++)
{
if (index-- == 0)
{
return (*iter).name.c_str();
}
}
return NULL;
}
const char *AdminCache::GetString(int idx)
{
return m_pStrings->GetString(idx);
}
size_t AdminCache::FillFlagString(FlagBits bits, char *buffer, size_t maxlen)
{
size_t pos;
unsigned int i, num_flags;
AdminFlag flags[AdminFlags_TOTAL];
num_flags = FlagBitsToArray(bits, flags, AdminFlags_TOTAL);
pos = 0;
for (i = 0; pos < maxlen && i < num_flags; i++)
{
if (FindFlagChar(flags[i], &buffer[pos]))
{
pos++;
}
}
buffer[pos] = '\0';
return pos;
}
CON_COMMAND(sm_dump_admcache, "Dumps the admin cache for debugging")
{
FILE *fp;
char buffer[PLATFORM_MAX_PATH];
g_SourceMod.BuildPath(Path_SM, buffer, sizeof(buffer), "data/admin_cache_dump.txt");
if ((fp = fopen(buffer, "wt")) == NULL)
{
g_RootMenu.ConsolePrint("Could not open file for writing: %s", buffer);
return;
}
g_Admins.DumpCache(fp);
g_RootMenu.ConsolePrint("Admin cache dumped to: %s", buffer);
fclose(fp);
}
+8 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -153,6 +153,7 @@ public: //IAdminSystem
bool FindFlag(const char *str, AdminFlag *pFlag);
bool FindFlag(char c, AdminFlag *pAdmFlag);
FlagBits ReadFlagString(const char *flags, const char **end);
size_t FillFlagString(FlagBits bits, char *buffer, size_t maxlen);
unsigned int GetAdminSerialChange(AdminId id);
bool CanAdminUseCommand(int client, const char *cmd);
const char *GetGroupName(GroupId gid);
@@ -164,8 +165,13 @@ public: //IAdminSystem
const char *cmd,
FlagBits flags,
bool override_only);
bool FindFlagChar(AdminFlag flag, char *c);
public:
bool IsValidAdmin(AdminId id);
void DumpCache(FILE *fp);
AdminGroup *GetGroup(GroupId gid);
AdminUser *GetUser(AdminId id);
const char *GetString(int idx);
private:
void _UnsetCommandOverride(const char *cmd);
void _UnsetCommandGroupOverride(const char *group);
@@ -174,6 +180,7 @@ private:
void DumpCommandOverrideCache(OverrideType type);
Trie *GetMethodByIndex(unsigned int index);
bool GetMethodIndex(const char *name, unsigned int *_index);
const char *GetMethodName(unsigned int index);
void NameFlag(const char *str, AdminFlag flag);
public:
BaseStringTable *m_pStrings;
+2 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -29,7 +29,7 @@
* Version: $Id$
*/
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "CDataPack.h"
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+12 -49
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,14 +34,14 @@
#include "sm_stringutil.h"
#include "ConCmdManager.h"
#include "PlayerManager.h"
#include "Translator.h"
#include "HalfLife2.h"
#include "logic_bridge.h"
/* :HACKHACK: We can't SH_DECL here because ConCmdManager.cpp does.
* While the OB build only runs on MM:S 1.6.0+ (SH 5+), the older one
* can technically be compiled against any MM:S version after 1.4.2.
*/
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
extern bool __SourceHook_FHRemoveConCommandDispatch(void *, bool, class fastdelegate::FastDelegate1<const CCommand &, void>);
extern int __SourceHook_FHAddConCommandDispatch(void *, ISourceHook::AddHookMode, bool, class fastdelegate::FastDelegate1<const CCommand &, void>);
#else
@@ -53,11 +53,10 @@ extern int __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate
#elif SH_IMPL_VERSION == 3
extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
#endif //SH_IMPL_VERSION
#endif //ORANGEBOX_BUILD
#endif //SE_ORANGEBOX
ChatTriggers g_ChatTriggers;
bool g_bSupressSilentFails = false;
CPhraseFile *g_pFloodPhrases = NULL;
ChatTriggers::ChatTriggers() : m_pSayCmd(NULL), m_bWillProcessInPost(false),
m_bTriggerWasSilent(false), m_ReplyTo(SM_REPLY_CONSOLE)
@@ -114,39 +113,13 @@ void ChatTriggers::OnSourceModAllInitialized()
void ChatTriggers::OnSourceModAllInitialized_Post()
{
unsigned int file_id;
file_id = g_Translator.FindOrAddPhraseFile("antiflood.phrases.txt");
g_pFloodPhrases = g_Translator.GetFileByIndex(file_id);
logicore.AddCorePhraseFile("antiflood.phrases");
}
void ChatTriggers::OnSourceModGameInitialized()
{
unsigned int total = 2;
ConCommandBase *pCmd = icvar->GetCommands();
const char *name;
while (pCmd)
{
if (pCmd->IsCommand())
{
name = pCmd->GetName();
if (!m_pSayCmd && strcmp(name, "say") == 0)
{
m_pSayCmd = (ConCommand *)pCmd;
if (--total == 0)
{
break;
}
} else if (!m_pSayTeamCmd && strcmp(name, "say_team") == 0) {
m_pSayTeamCmd = (ConCommand *)pCmd;
if (--total == 0)
{
break;
}
}
}
pCmd = const_cast<ConCommandBase *>(pCmd->GetNext());
}
m_pSayCmd = FindCommand("say");
m_pSayTeamCmd = FindCommand("say_team");
if (m_pSayCmd)
{
@@ -177,7 +150,7 @@ void ChatTriggers::OnSourceModShutdown()
g_Forwards.ReleaseForward(m_pDidFloodBlock);
}
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void ChatTriggers::OnSayCommand_Pre(const CCommand &command)
{
#else
@@ -216,18 +189,8 @@ void ChatTriggers::OnSayCommand_Pre()
{
char buffer[128];
/* :TODO: log an error? */
if (g_Translator.CoreTransEx(g_pFloodPhrases,
client,
buffer,
sizeof(buffer),
"Flooding the server",
NULL,
NULL)
!= Trans_Okay)
{
if (!logicore.CoreTranslate(buffer, sizeof(buffer), "%T", 2, NULL, "Flooding the server", &client))
UTIL_Format(buffer, sizeof(buffer), "You are flooding the server!");
}
/* :TODO: we should probably kick people who spam too much. */
@@ -272,7 +235,7 @@ void ChatTriggers::OnSayCommand_Pre()
/**
* Test if this is actually a command!
*/
if (!PreProcessTrigger(engine->PEntityOfEntIndex(client), args, is_quoted))
if (!PreProcessTrigger(PEntityOfEntIndex(client), args, is_quoted))
{
CPlayer *pPlayer;
if (is_silent
@@ -304,7 +267,7 @@ void ChatTriggers::OnSayCommand_Pre()
RETURN_META(MRES_IGNORED);
}
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void ChatTriggers::OnSayCommand_Post(const CCommand &command)
#else
void ChatTriggers::OnSayCommand_Post()
@@ -320,7 +283,7 @@ void ChatTriggers::OnSayCommand_Post()
/* Execute the cached command */
int client = g_ConCmds.GetCommandClient();
unsigned int old = SetReplyTo(SM_REPLY_CHAT);
serverpluginhelpers->ClientCommand(engine->PEntityOfEntIndex(client), m_ToExecute);
serverpluginhelpers->ClientCommand(PEntityOfEntIndex(client), m_ToExecute);
SetReplyTo(old);
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -54,7 +54,7 @@ public: //SMGlobalClass
char *error,
size_t maxlength);
private: //ConCommand
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnSayCommand_Pre(const CCommand &command);
void OnSayCommand_Post(const CCommand &command);
#else
+93 -63
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,13 +34,13 @@
#include "AdminCache.h"
#include "sm_stringutil.h"
#include "PlayerManager.h"
#include "Translator.h"
#include "HalfLife2.h"
#include "ChatTriggers.h"
#include "logic_bridge.h"
ConCmdManager g_ConCmds;
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#else
SH_DECL_HOOK0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
@@ -205,7 +205,7 @@ void ConCmdManager::OnPluginDestroyed(IPlugin *plugin)
delete pList;
}
}
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CommandCallback(const CCommand &command)
{
#else
@@ -226,49 +226,78 @@ void ConCmdManager::SetCommandClient(int client)
m_CmdClient = client + 1;
}
ConCmdInfo *ConCmdManager::FindInTrie(const char *name)
{
ConCmdInfo *pInfo;
if (!sm_trie_retrieve(m_pCmds, name, (void **)&pInfo))
return NULL;
return pInfo;
}
ConCmdList::iterator ConCmdManager::FindInList(const char *cmd)
{
List<ConCmdInfo *>::iterator iter = m_CmdList.begin();
while (iter != m_CmdList.end())
{
if (strcasecmp((*iter)->pCmd->GetName(), cmd) == 0)
break;
iter++;
}
return iter;
}
ResultType ConCmdManager::DispatchClientCommand(int client, const char *cmd, int args, ResultType type)
{
ConCmdInfo *pInfo;
if (sm_trie_retrieve(m_pCmds, cmd, (void **)&pInfo))
if ((pInfo = FindInTrie(cmd)) == NULL)
{
cell_t result = type;
cell_t tempres = result;
List<CmdHook *>::iterator iter;
CmdHook *pHook;
for (iter=pInfo->conhooks.begin();
iter!=pInfo->conhooks.end();
iter++)
ConCmdList::iterator item = FindInList(cmd);
if (item == m_CmdList.end())
return type;
pInfo = *item;
}
cell_t result = type;
cell_t tempres = result;
List<CmdHook *>::iterator iter;
CmdHook *pHook;
for (iter=pInfo->conhooks.begin();
iter!=pInfo->conhooks.end();
iter++)
{
pHook = (*iter);
if (!pHook->pf->IsRunnable())
{
pHook = (*iter);
if (!pHook->pf->IsRunnable())
continue;
}
if (pHook->pAdmin && !CheckAccess(client, cmd, pHook->pAdmin))
{
if (result < Pl_Handled)
{
continue;
result = Pl_Handled;
}
if (pHook->pAdmin && !CheckAccess(client, cmd, pHook->pAdmin))
continue;
}
pHook->pf->PushCell(client);
pHook->pf->PushCell(args);
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
{
if (tempres > result)
{
if (result < Pl_Handled)
{
result = Pl_Handled;
}
continue;
result = tempres;
}
pHook->pf->PushCell(client);
pHook->pf->PushCell(args);
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
if (result == Pl_Stop)
{
if (tempres > result)
{
result = tempres;
}
if (result == Pl_Stop)
{
break;
}
break;
}
}
type = (ResultType)result;
}
type = (ResultType)result;
return type;
}
@@ -293,10 +322,20 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
*/
const char *cmd = g_HL2.CurrentCommandName();
ConCmdInfo *pInfo;
if (!sm_trie_retrieve(m_pCmds, cmd, (void **)&pInfo))
ConCmdInfo *pInfo = FindInTrie(cmd);
if (pInfo == NULL)
{
return;
/* Unfortunately, we now have to do a slow lookup because Valve made client commands
* case-insensitive. We can't even use our sortedness.
*/
if (client == 0 && !engine->IsDedicatedServer())
return;
ConCmdList::iterator item = FindInList(cmd);
if (item == m_CmdList.end())
return;
pInfo = *item;
}
/* This is a hack to prevent say triggers from firing on messages that were
@@ -379,14 +418,14 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
/* On a listen server, sometimes the server host's client index can be set as 0.
* So index 1 is passed to the command callback to correct this potential problem.
*/
if (client == 0 && !engine->IsDedicatedServer())
if (!engine->IsDedicatedServer())
{
pHook->pf->PushCell(1);
} else {
pHook->pf->PushCell(client);
client = g_Players.ListenClient();
}
pHook->pf->PushCell(client);
pHook->pf->PushCell(args);
if (pHook->pf->Execute(&tempres) == SP_ERROR_NONE)
{
if (tempres > result)
@@ -411,7 +450,7 @@ void ConCmdManager::InternalDispatch(const CCommand &command)
}
}
bool ConCmdManager::CheckCommandAccess(int client, const char *cmd, FlagBits cmdflags)
bool ConCmdManager::CheckClientCommandAccess(int client, const char *cmd, FlagBits cmdflags)
{
if (cmdflags == 0 || client == 0)
{
@@ -432,7 +471,11 @@ bool ConCmdManager::CheckCommandAccess(int client, const char *cmd, FlagBits cmd
return false;
}
AdminId adm = player->GetAdminId();
return CheckAdminCommandAccess(player->GetAdminId(), cmd, cmdflags);
}
bool ConCmdManager::CheckAdminCommandAccess(AdminId adm, const char *cmd, FlagBits cmdflags)
{
if (adm != INVALID_ADMIN_ID)
{
FlagBits bits = g_Admins.GetAdminFlags(adm, Access_Effective);
@@ -485,17 +528,16 @@ bool ConCmdManager::CheckCommandAccess(int client, const char *cmd, FlagBits cmd
bool ConCmdManager::CheckAccess(int client, const char *cmd, AdminCmdInfo *pAdmin)
{
if (CheckCommandAccess(client, cmd, pAdmin->eflags))
if (CheckClientCommandAccess(client, cmd, pAdmin->eflags))
{
return true;
}
edict_t *pEdict = engine->PEntityOfEntIndex(client);
edict_t *pEdict = PEntityOfEntIndex(client);
/* If we got here, the command failed... */
char buffer[128];
if (g_Translator.CoreTrans(client, buffer, sizeof(buffer), "No Access", NULL, NULL)
!= Trans_Okay)
if (!logicore.CoreTranslate(buffer, sizeof(buffer), "%T", 2, NULL, "No Access", &client))
{
UTIL_Format(buffer, sizeof(buffer), "You do not have access to this command");
}
@@ -871,25 +913,13 @@ ConCmdInfo *ConCmdManager::AddOrFindCommand(const char *name, const char *descri
ConCmdInfo *pInfo;
if (!sm_trie_retrieve(m_pCmds, name, (void **)&pInfo))
{
ConCmdList::iterator item = FindInList(name);
if (item != m_CmdList.end())
return *item;
pInfo = new ConCmdInfo();
/* Find the commandopan */
ConCommandBase *pBase = icvar->GetCommands();
ConCommand *pCmd = NULL;
while (pBase)
{
if (strcmp(pBase->GetName(), name) == 0)
{
/* Don't want to return convar with same name */
if (!pBase->IsCommand())
{
return NULL;
}
pCmd = (ConCommand *)pBase;
break;
}
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
}
ConCommand *pCmd = FindCommand(name);
if (!pCmd)
{
+14 -4
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -92,13 +92,15 @@ struct ConCmdInfo
bool is_admin_set; /**< Whether or not admin info is set */
};
typedef List<ConCmdInfo *> ConCmdList;
class ConCmdManager :
public SMGlobalClass,
public IRootConsoleCommand,
public IPluginsListener,
public IConCommandTracker
{
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
friend void CommandCallback(const CCommand &command);
#else
friend void CommandCallback();
@@ -128,7 +130,8 @@ public:
void UpdateAdminCmdFlags(const char *cmd, OverrideType type, FlagBits bits, bool remove);
bool LookForSourceModCommand(const char *cmd);
bool LookForCommandAdminFlags(const char *cmd, FlagBits *pFlags);
bool CheckCommandAccess(int client, const char *cmd, FlagBits flags);
bool CheckClientCommandAccess(int client, const char *cmd, FlagBits flags);
bool CheckAdminCommandAccess(AdminId adm, const char *cmd, FlagBits flags);
private:
void InternalDispatch(const CCommand &command);
ResultType RunAdminCommand(ConCmdInfo *pInfo, int client, int args);
@@ -139,6 +142,12 @@ private:
void RemoveConCmds(List<CmdHook *> &cmdlist);
void RemoveConCmds(List<CmdHook *> &cmdlist, IPluginContext *pContext);
bool CheckAccess(int client, const char *cmd, AdminCmdInfo *pAdmin);
// Case insensitive
ConCmdList::iterator FindInList(const char *name);
// Case sensitive
ConCmdInfo *FindInTrie(const char *name);
public:
inline int GetCommandClient()
{
@@ -151,7 +160,7 @@ public:
private:
Trie *m_pCmds; /* command lookup */
Trie *m_pCmdGrps; /* command group lookup */
List<ConCmdInfo *> m_CmdList; /* command list */
ConCmdList m_CmdList; /* command list */
int m_CmdClient; /* current client */
BaseStringTable m_Strings; /* string table */
};
@@ -159,3 +168,4 @@ private:
extern ConCmdManager g_ConCmds;
#endif // _INCLUDE_SOURCEMOD_CONCMDMANAGER_H_
+89
View File
@@ -0,0 +1,89 @@
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_CON_COMMAND_BASE_ITERATOR_H_
#define _INCLUDE_SOURCEMOD_CON_COMMAND_BASE_ITERATOR_H_
#if SOURCE_ENGINE >= SE_LEFT4DEAD
class ConCommandBaseIterator
{
public:
inline ConCommandBaseIterator() : iter(icvar)
{
iter.SetFirst();
}
inline bool IsValid()
{
return iter.IsValid();
}
inline void Next()
{
iter.Next();
}
inline ConCommandBase *Get()
{
return iter.Get();
}
private:
ICvar::Iterator iter;
};
#else
class ConCommandBaseIterator
{
public:
inline ConCommandBaseIterator()
{
iter = icvar->GetCommands();
}
inline bool IsValid()
{
return iter != NULL;
}
inline void Next()
{
iter = const_cast<ConCommandBase *>(iter->GetNext());
}
inline ConCommandBase *Get()
{
return iter;
}
private:
ConCommandBase *iter;
};
#endif
#endif /* _INCLUDE_SOURCEMOD_CON_COMMAND_BASE_ITERATOR_H_ */
+103 -30
View File
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -25,8 +25,6 @@
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "ConVarManager.h"
@@ -41,23 +39,59 @@
ConVarManager g_ConVarManager;
#if !defined ORANGEBOX_BUILD
#if SOURCE_ENGINE <= SE_DARKMESSIAH
#define CallGlobalChangeCallbacks CallGlobalChangeCallback
#endif
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK3_void(ICvar, CallGlobalChangeCallbacks, SH_NOATTRIB, false, ConVar *, const char *, float);
#else
SH_DECL_HOOK2_void(ICvar, CallGlobalChangeCallbacks, SH_NOATTRIB, false, ConVar *, const char *);
#endif
#if SOURCE_ENGINE != SE_DARKMESSIAH
SH_DECL_HOOK5_void(IServerGameDLL, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
SH_DECL_HOOK5_void(IServerPluginCallbacks, OnQueryCvarValueFinished, SH_NOATTRIB, 0, QueryCvarCookie_t, edict_t *, EQueryCvarValueStatus, const char *, const char *);
#endif
const ParamType CONVARCHANGE_PARAMS[] = {Param_Cell, Param_String, Param_String};
typedef List<const ConVar *> ConVarList;
KTrie<ConVarInfo *> convar_cache;
class ConVarReentrancyGuard
{
ConVar *cvar;
ConVarReentrancyGuard *up;
public:
static ConVarReentrancyGuard *chain;
ConVarReentrancyGuard(ConVar *cvar)
: cvar(cvar), up(chain)
{
chain = this;
}
~ConVarReentrancyGuard()
{
assert(chain == this);
chain = up;
}
static bool IsCvarInChain(ConVar *cvar)
{
ConVarReentrancyGuard *guard = chain;
while (guard != NULL)
{
if (guard->cvar == cvar)
return true;
guard = guard->up;
}
return false;
}
};
ConVarReentrancyGuard *ConVarReentrancyGuard::chain = NULL;
ConVarManager::ConVarManager() : m_ConVarType(0), m_bIsDLLQueryHooked(false), m_bIsVSPQueryHooked(false)
{
}
@@ -84,7 +118,7 @@ void ConVarManager::OnSourceModAllInitialized()
/**
* Episode 2 has this function by default, but the older versions do not.
*/
#if !defined ORANGEBOX_BUILD
#if SOURCE_ENGINE == SE_EPISODEONE
if (g_SMAPI->GetGameDLLVersion() >= 6)
{
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, OnQueryCvarValueFinished, gamedll, this, &ConVarManager::OnQueryCvarValueFinished, false);
@@ -94,6 +128,8 @@ void ConVarManager::OnSourceModAllInitialized()
SH_ADD_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
g_PluginSys.AddPluginsListener(this);
/* Add the 'convars' option to the 'sm' console command */
g_RootMenu.AddRootConsoleCommand("cvars", "View convars created by a plugin", this);
}
@@ -141,6 +177,7 @@ void ConVarManager::OnSourceModShutdown()
}
convar_cache.clear();
#if SOURCE_ENGINE != SE_DARKMESSIAH
/* Unhook things */
if (m_bIsDLLQueryHooked)
{
@@ -152,12 +189,15 @@ void ConVarManager::OnSourceModShutdown()
SH_REMOVE_HOOK_MEMFUNC(IServerPluginCallbacks, OnQueryCvarValueFinished, vsp_interface, this, &ConVarManager::OnQueryCvarValueFinished, false);
m_bIsVSPQueryHooked = false;
}
#endif
SH_REMOVE_HOOK_STATICFUNC(ICvar, CallGlobalChangeCallbacks, icvar, OnConVarChanged, false);
/* Remove the 'convars' option from the 'sm' console command */
g_RootMenu.RemoveRootConsoleCommand("cvars", this);
g_PluginSys.RemovePluginsListener(this);
/* Remove the 'ConVar' handle type */
g_HandleSys.RemoveType(m_ConVarType, g_pCoreIdent);
}
@@ -176,7 +216,7 @@ void ConVarManager::OnSourceModVSPReceived()
}
/* For later MM:S versions, use the updated API, since it's cleaner. */
#if defined METAMOD_PLAPI_VERSION
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
int engine = g_SMAPI->GetSourceEngineBuild();
if (engine == SOURCE_ENGINE_ORIGINAL || vsp_version < 2)
{
@@ -189,8 +229,10 @@ void ConVarManager::OnSourceModVSPReceived()
}
#endif
#if SOURCE_ENGINE != SE_DARKMESSIAH
SH_ADD_HOOK_MEMFUNC(IServerPluginCallbacks, OnQueryCvarValueFinished, vsp_interface, this, &ConVarManager::OnQueryCvarValueFinished, false);
m_bIsVSPQueryHooked = true;
#endif
}
bool convar_cache_lookup(const char *name, ConVarInfo **pVar)
@@ -246,12 +288,23 @@ void ConVarManager::OnUnlinkConCommandBase(ConCommandBase *pBase, const char *na
void ConVarManager::OnPluginUnloaded(IPlugin *plugin)
{
ConVarList *pConVarList;
List<ConVarQuery>::iterator iter;
/* If plugin has a convar list, free its memory */
if (plugin->GetProperty("ConVarList", (void **)&pConVarList, true))
{
delete pConVarList;
}
/* Remove convar queries for this plugin that haven't returned results yet */
for (iter = m_ConVarQueries.begin(); iter != m_ConVarQueries.end(); iter++)
{
ConVarQuery &query = (*iter);
if (query.pCallback->GetParentRuntime() == plugin->GetRuntime())
{
m_ConVarQueries.erase(iter);
}
}
}
void ConVarManager::OnHandleDestroy(HandleType_t type, void *object)
@@ -269,8 +322,15 @@ void ConVarManager::OnRootConsoleCommand(const char *cmdname, const CCommand &co
int argcount = command.ArgC();
if (argcount >= 3)
{
bool wantReset = false;
/* Get plugin index that was passed */
const char *arg = command.Arg(2);
if (argcount >= 4 && strcmp(arg, "reset") == 0)
{
wantReset = true;
arg = command.Arg(3);
}
/* Get plugin object */
CPlugin *plugin = g_PluginSys.FindPluginByConsoleArg(arg);
@@ -295,21 +355,34 @@ void ConVarManager::OnRootConsoleCommand(const char *cmdname, const CCommand &co
return;
}
g_RootMenu.ConsolePrint("[SM] Listing %d convars for: %s", pConVarList->size(), plname);
g_RootMenu.ConsolePrint(" %-32.31s %s", "[Name]", "[Value]");
/* Iterate convar list and display each one */
if (!wantReset)
{
g_RootMenu.ConsolePrint("[SM] Listing %d convars for: %s", pConVarList->size(), plname);
g_RootMenu.ConsolePrint(" %-32.31s %s", "[Name]", "[Value]");
}
/* Iterate convar list and display/reset each one */
for (iter = pConVarList->begin(); iter != pConVarList->end(); iter++)
{
const ConVar *pConVar = (*iter);
g_RootMenu.ConsolePrint(" %-32.31s %s", pConVar->GetName(), pConVar->GetString());
/*const */ConVar *pConVar = const_cast<ConVar *>(*iter);
if (!wantReset)
{
g_RootMenu.ConsolePrint(" %-32.31s %s", pConVar->GetName(), pConVar->GetString());
} else {
pConVar->Revert();
}
}
if (wantReset)
{
g_RootMenu.ConsolePrint("[SM] Reset %d convars for: %s", pConVarList->size(), plname);
}
return;
}
/* Display usage of subcommand */
g_RootMenu.ConsolePrint("[SM] Usage: sm convars <plugin #>");
g_RootMenu.ConsolePrint("[SM] Usage: sm cvars [reset] <plugin #>");
}
Handle_t ConVarManager::CreateConVar(IPluginContext *pContext, const char *name, const char *defaultVal, const char *description, int flags, bool hasMin, float min, bool hasMax, float max)
@@ -359,17 +432,10 @@ Handle_t ConVarManager::CreateConVar(IPluginContext *pContext, const char *name,
}
}
/* To prevent creating a convar that has the same name as a console command... ugh */
ConCommandBase *pBase = icvar->GetCommands();
while (pBase)
/* Prevent creating a convar that has the same name as a console command */
if (FindCommand(name))
{
if (pBase->IsCommand() && strcmp(pBase->GetName(), name) == 0)
{
return BAD_HANDLE;
}
pBase = const_cast<ConCommandBase *>(pBase->GetNext());
return BAD_HANDLE;
}
/* Create and initialize ConVarInfo structure */
@@ -524,7 +590,8 @@ void ConVarManager::UnhookConVarChange(ConVar *pConVar, IPluginFunction *pFuncti
}
/* If the forward now has 0 functions in it... */
if (pForward->GetFunctionCount() == 0)
if (pForward->GetFunctionCount() == 0 &&
!ConVarReentrancyGuard::IsCvarInChain(pConVar))
{
/* Free this forward */
g_Forwards.ReleaseForward(pForward);
@@ -535,8 +602,9 @@ void ConVarManager::UnhookConVarChange(ConVar *pConVar, IPluginFunction *pFuncti
QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char *name, IPluginFunction *pCallback, Handle_t hndl)
{
QueryCvarCookie_t cookie;
QueryCvarCookie_t cookie = 0;
#if SOURCE_ENGINE != SE_DARKMESSIAH
/* Call StartQueryCvarValue() in either the IVEngineServer or IServerPluginHelpers depending on situation */
if (m_bIsDLLQueryHooked)
{
@@ -553,6 +621,7 @@ QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char
ConVarQuery query = {cookie, pCallback, hndl};
m_ConVarQueries.push_back(query);
#endif
return cookie;
}
@@ -595,7 +664,7 @@ void ConVarManager::AddConVarToPluginList(IPluginContext *pContext, const ConVar
}
}
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue, float flOldValue)
#else
void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue)
@@ -623,7 +692,7 @@ void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue)
i != pInfo->changeListeners.end();
i++)
{
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
(*i)->OnConVarChanged(pConVar, oldValue, flOldValue);
#else
(*i)->OnConVarChanged(pConVar, oldValue, atof(oldValue));
@@ -633,6 +702,8 @@ void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue)
if (pForward != NULL)
{
ConVarReentrancyGuard guard(pConVar);
/* Now call forwards in plugins that have hooked this */
pForward->PushCell(pInfo->handle);
pForward->PushString(oldValue);
@@ -646,6 +717,7 @@ bool ConVarManager::IsQueryingSupported()
return (m_bIsDLLQueryHooked || m_bIsVSPQueryHooked);
}
#if SOURCE_ENGINE != SE_DARKMESSIAH
void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
{
IPluginFunction *pCallback = NULL;
@@ -668,7 +740,7 @@ void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *
cell_t ret;
pCallback->PushCell(cookie);
pCallback->PushCell(engine->IndexOfEdict(pPlayer));
pCallback->PushCell(IndexOfEdict(pPlayer));
pCallback->PushCell(result);
pCallback->PushString(cvarName);
@@ -687,6 +759,7 @@ void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *
m_ConVarQueries.erase(iter);
}
}
#endif
HandleError ConVarManager::ReadConVarHandle(Handle_t hndl, ConVar **pVar)
{
+9 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -42,6 +42,11 @@
#include <compat_wrappers.h>
#include "concmd_cleaner.h"
#if SOURCE_ENGINE == SE_DARKMESSIAH
class EQueryCvarValueStatus;
typedef int QueryCvarCookie_t;
#endif
using namespace SourceHook;
class IConVarChangeListener
@@ -140,7 +145,7 @@ private:
/**
* Static callback that Valve's ConVar object executes when the convar's value changes.
*/
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
static void OnConVarChanged(ConVar *pConVar, const char *oldValue, float flOldValue);
#else
static void OnConVarChanged(ConVar *pConVar, const char *oldValue);
@@ -149,8 +154,10 @@ private:
/**
* Callback for when StartQueryCvarValue() has finished.
*/
#if SOURCE_ENGINE != SE_DARKMESSIAH
void OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result,
const char *cvarName, const char *cvarValue);
#endif
private:
HandleType_t m_ConVarType;
List<ConVarInfo *> m_ConVars;
+747
View File
@@ -0,0 +1,747 @@
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
/**
* On SourceHook v4.3 or lower, there are no DVP hooks. Very sad, right?
* Only do this on newer versions. For the older code, we'll do an incredibly
* hacky detour.
*
* The idea of the "non-hacky" (yeah... no) code is that every unique
* ConCommand vtable gets its own DVP hook. We watch for unloading and
* loading commands to remove stale hooks from SH.
*/
#include "sourcemod.h"
#include "sourcemm_api.h"
#include "Logger.h"
#include "compat_wrappers.h"
#include "ConsoleDetours.h"
#include <IGameConfigs.h>
#include "sm_stringutil.h"
#include "ConCmdManager.h"
#include "HalfLife2.h"
#include "ConCommandBaseIterator.h"
#include "ShareSys.h"
#if defined PLATFORM_POSIX
# include <dlfcn.h>
# include <sys/mman.h>
# include <stdint.h>
# include <unistd.h>
#endif
#if SH_IMPL_VERSION >= 5
# if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
# else
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
# endif
#else
# if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHVPAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>,bool);
extern int __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);
#endif
#if SH_IMPL_VERSION >= 4
class GenericCommandHooker : public IConCommandLinkListener
{
struct HackInfo
{
void **vtable;
int hook;
unsigned int refcount;
};
CVector<HackInfo> vtables;
bool enabled;
SourceHook::MemFuncInfo dispatch;
inline void **GetVirtualTable(ConCommandBase *pBase)
{
return *reinterpret_cast<void***>(reinterpret_cast<char*>(pBase) +
dispatch.thisptroffs +
dispatch.vtbloffs);
}
inline bool FindVtable(void **ptr, size_t& index)
{
for (size_t i = 0; i < vtables.size(); i++)
{
if (vtables[i].vtable == ptr)
{
index = i;
return true;
}
}
return false;
}
void MakeHookable(ConCommandBase *pBase)
{
if (!pBase->IsCommand())
return;
ConCommand *cmd = (ConCommand*)pBase;
void **vtable = GetVirtualTable(cmd);
size_t index;
if (!FindVtable(vtable, index))
{
HackInfo hack;
hack.vtable = vtable;
hack.hook = SH_ADD_VPHOOK(ConCommand, Dispatch, cmd, SH_MEMBER(this, &GenericCommandHooker::Dispatch), false);
hack.refcount = 1;
vtables.push_back(hack);
}
else
{
vtables[index].refcount++;
}
}
# if SOURCE_ENGINE >= SE_ORANGEBOX
void Dispatch(const CCommand& args)
# else
void Dispatch()
# endif
{
cell_t res = ConsoleDetours::Dispatch(META_IFACEPTR(ConCommand)
# if SOURCE_ENGINE >= SE_ORANGEBOX
, args
# endif
);
if (res >= Pl_Handled)
RETURN_META(MRES_SUPERCEDE);
}
void ReparseCommandList()
{
for (size_t i = 0; i < vtables.size(); i++)
vtables[i].refcount = 0;
for (ConCommandBaseIterator iter; iter.IsValid(); iter.Next())
MakeHookable(iter.Get());
CVector<HackInfo>::iterator iter = vtables.begin();
while (iter != vtables.end())
{
if ((*iter).refcount)
{
iter++;
continue;
}
/* Damn it. This event happens AFTER the plugin has unloaded!
* There's two options. Remove the hook now and hope SH's memory
* protection will prevent a crash. Otherwise, we can wait until
* the server shuts down and more likely crash then.
*
* This situation only arises if:
* 1) Someone has used AddCommandFilter()
* 2) ... on a Dark Messiah server (mm:s new api)
* 3) ... and another MM:S plugin that uses ConCommands has unloaded.
*
* Even though the impact is really small, we'll wait until the
* server shuts down, so normal operation isn't interrupted.
*
* See bug 4018.
*/
iter = vtables.erase(iter);
}
}
void UnhookCommand(ConCommandBase *pBase)
{
if (!pBase->IsCommand())
return;
ConCommand *cmd = (ConCommand*)pBase;
void **vtable = GetVirtualTable(cmd);
size_t index;
if (!FindVtable(vtable, index))
{
g_Logger.LogError("Console detour tried to unhook command \"%s\" but it wasn't found", pBase->GetName());
return;
}
assert(vtables[index].refcount > 0);
vtables[index].refcount--;
if (vtables[index].refcount == 0)
{
SH_REMOVE_HOOK_ID(vtables[index].hook);
vtables.erase(vtables.iterAt(index));
}
}
public:
GenericCommandHooker() : enabled(false)
{
}
bool Enable()
{
SourceHook::GetFuncInfo(&ConCommand::Dispatch, dispatch);
if (dispatch.thisptroffs < 0)
{
g_Logger.LogError("Command filter could not determine ConCommand layout");
return false;
}
for (ConCommandBaseIterator iter; iter.IsValid(); iter.Next())
MakeHookable(iter.Get());
if (!vtables.size())
{
g_Logger.LogError("Command filter could not find any cvars!");
return false;
}
enabled = true;
return true;
}
void Disable()
{
for (size_t i = 0; i < vtables.size(); i++)
SH_REMOVE_HOOK_ID(vtables[i].hook);
vtables.clear();
}
virtual void OnLinkConCommand(ConCommandBase *pBase)
{
if (!enabled)
return;
MakeHookable(pBase);
}
virtual void OnUnlinkConCommand(ConCommandBase *pBase)
{
if (!enabled)
return;
if (pBase == NULL)
ReparseCommandList();
else
UnhookCommand(pBase);
}
};
/**
* END DVP HOOK VERSION
*/
#else /* SH_IMPL_VERSION >= 4 */
/**
* BEGIN ENGINE DETOUR VERSION
*/
# include <jit/jit_helpers.h>
# include <jit/x86/x86_macros.h>
class GenericCommandHooker
{
struct Patch
{
Patch() : applied(false)
{
}
bool applied;
void *base;
unsigned char search[16];
size_t search_len;
size_t offset;
size_t saveat;
int regparam;
void *detour;
};
Patch ces;
Patch cgc;
public:
static void DelayedActivation(void *inparam)
{
GenericCommandHooker *cdtrs = reinterpret_cast<GenericCommandHooker*>(inparam);
/* Safe to re-enter because the frame queue is lock+swapped. */
if ((!cdtrs->ces.applied || !cdtrs->cgc.applied) &&
g_HL2.PeekCommandStack() != NULL)
{
g_SourceMod.AddFrameAction(GenericCommandHooker::DelayedActivation, cdtrs);
return;
}
if (!cdtrs->ces.applied)
cdtrs->ApplyPatch(&cdtrs->ces);
if (!cdtrs->cgc.applied)
cdtrs->ApplyPatch(&cdtrs->cgc);
}
bool Enable()
{
const char *platform = NULL;
# if defined(PLATFORM_WINDOWS)
platform = "Windows";
# else
void *addrInBase = (void *)g_SMAPI->GetEngineFactory(false);
Dl_info info;
if (!dladdr(addrInBase, &info))
{
g_Logger.LogError("Command filter could not find engine name");
return false;
}
if (strstr(info.dli_fname, "engine_i486"))
{
platform = "Linux_486";
}
else if (strstr(info.dli_fname, "engine_i686"))
{
platform = "Linux_686";
}
else if (strstr(info.dli_fname, "engine_amd"))
{
platform = "Linux_AMD";
}
else
{
g_Logger.LogError("Command filter could not determine engine (%s)", info.dli_fname);
return false;
}
# endif
if (!PrepPatch("Cmd_ExecuteString", "CES", platform, &ces))
return false;
if (!PrepPatch("CGameClient::ExecuteString", "CGC", platform, &cgc))
return false;
if (g_HL2.PeekCommandStack() != NULL)
{
g_SourceMod.AddFrameAction(GenericCommandHooker::DelayedActivation, this);
return true;
}
ApplyPatch(&ces);
ApplyPatch(&cgc);
return true;
}
void Disable()
{
UndoPatch(&ces);
UndoPatch(&cgc);
}
private:
# if !defined PLATFORM_WINDOWS
# define PAGE_READWRITE PROT_READ|PROT_WRITE
# define PAGE_EXECUTE_READ PROT_READ|PROT_EXEC
static inline uintptr_t AddrToPage(uintptr_t address)
{
return (address & ~(uintptr_t(sysconf(_SC_PAGE_SIZE) - 1)));
}
# endif
void Protect(void *addr, size_t length, int prot)
{
# if defined PLATFORM_WINDOWS
DWORD ignore;
VirtualProtect(addr, length, prot, &ignore);
# else
uintptr_t startPage = AddrToPage(uintptr_t(addr));
length += (uintptr_t(addr) - startPage);
mprotect((void*)startPage, length, prot);
# endif
}
void UndoPatch(Patch *patch)
{
if (!patch->applied || patch->detour == NULL)
return;
g_pSourcePawn->FreePageMemory(patch->detour);
unsigned char *source = (unsigned char *)patch->base + patch->offset;
Protect(source, patch->search_len, PAGE_READWRITE);
for (size_t i = 0; i < patch->search_len; i++)
source[i] = patch->search[i];
Protect(source, patch->search_len, PAGE_EXECUTE_READ);
}
void ApplyPatch(Patch *patch)
{
assert(!patch->applied);
size_t length = 0;
void *callback = (void*)&ConsoleDetours::Dispatch;
/* Bogus assignment to make compiler is doing the right thing. */
patch->detour = callback;
/* Assemgle the detour. */
JitWriter writer;
writer.outbase = NULL;
writer.outptr = NULL;
do
{
/* Need a specific register, or value on stack? */
if (patch->regparam != -1)
IA32_Push_Reg(&writer, patch->regparam);
/* Call real function. */
IA32_Write_Jump32_Abs(&writer, IA32_Call_Imm32(&writer, 0), callback);
/* Restore stack. */
if (patch->regparam != -1)
IA32_Pop_Reg(&writer, patch->regparam);
/* Copy any saved bytes */
if (patch->saveat)
{
for (size_t i = patch->saveat; i < patch->search_len; i++)
{
writer.write_ubyte(patch->search[i]);
}
}
/* Jump back to the caller. */
unsigned char *target = (unsigned char *)patch->base + patch->offset + patch->search_len;
IA32_Jump_Imm32_Abs(&writer, target);
/* Assemble, if we can. */
if (writer.outbase == NULL)
{
length = writer.outptr - writer.outbase;
patch->detour = g_pSourcePawn->AllocatePageMemory(length);
if (patch->detour == NULL)
{
g_Logger.LogError("Ran out of memory!");
return;
}
g_pSourcePawn->SetReadWrite(patch->detour);
writer.outbase = (jitcode_t)patch->detour;
writer.outptr = writer.outbase;
}
else
{
break;
}
} while (true);
g_pSourcePawn->SetReadExecute(patch->detour);
unsigned char *source = (unsigned char *)patch->base + patch->offset;
Protect(source, 6, PAGE_READWRITE);
source[0] = 0xFF;
source[1] = 0x25;
*(void **)&source[2] = &patch->detour;
Protect(source, 6, PAGE_EXECUTE_READ);
patch->applied = true;
}
bool PrepPatch(const char *signature, const char *name, const char *platform, Patch *patch)
{
/* Get the base address of the function. */
if (!g_pGameConf->GetMemSig(signature, &patch->base) || patch->base == NULL)
{
g_Logger.LogError("Command filter could not find signature: %s", signature);
return false;
}
const char *value;
char keyname[255];
/* Get the verification bytes that will be written over. */
UTIL_Format(keyname, sizeof(keyname), "%s_Patch_%s", name, platform);
if ((value = g_pGameConf->GetKeyValue(keyname)) == NULL)
{
g_Logger.LogError("Command filter could not find key: %s", keyname);
return false;
}
patch->search_len = UTIL_DecodeHexString(patch->search, sizeof(patch->search), value);
if (patch->search_len < 6)
{
g_Logger.LogError("Error decoding %s value, or not long enough", keyname);
return false;
}
/* Get the offset into the function. */
UTIL_Format(keyname, sizeof(keyname), "%s_Offset_%s", name, platform);
if ((value = g_pGameConf->GetKeyValue(keyname)) == NULL)
{
g_Logger.LogError("Command filter could not find key: %s", keyname);
return false;
}
patch->offset = atoi(value);
if (patch->offset > 20000)
{
g_Logger.LogError("Command filter %s value is bogus", keyname);
return false;
}
/* Get the number of bytes to save from what was written over. */
patch->saveat = 0;
UTIL_Format(keyname, sizeof(keyname), "%s_Save_%s", name, platform);
if ((value = g_pGameConf->GetKeyValue(keyname)) != NULL)
{
patch->saveat = atoi(value);
if (patch->saveat >= patch->search_len)
{
g_Logger.LogError("Command filter %s value is too large", keyname);
return false;
}
}
/* Get register for parameter, if any. */
patch->regparam = -1;
UTIL_Format(keyname, sizeof(keyname), "%s_Reg_%s", name, platform);
if ((value = g_pGameConf->GetKeyValue(keyname)) != NULL)
{
patch->regparam = atoi(value);
}
/* Everything loaded from gamedata, make sure the patch will succeed. */
unsigned char *address = (unsigned char *)patch->base + patch->offset;
for (size_t i = 0; i < patch->search_len; i++)
{
if (address[i] != patch->search[i])
{
g_Logger.LogError("Command filter %s has changed (byte %x is not %x sub-offset %d)",
name, address[i], patch->search[i], i);
return false;
}
}
return true;
}
};
static bool dummy_hook_set = false;
void DummyHook()
{
if (dummy_hook_set)
{
dummy_hook_set = false;
RETURN_META(MRES_SUPERCEDE);
}
}
#endif
/**
* BEGIN THE ACTUALLY GENERIC CODE.
*/
#define FEATURECAP_COMMANDLISTENER "command listener"
static GenericCommandHooker s_GenericHooker;
ConsoleDetours g_ConsoleDetours;
ConsoleDetours::ConsoleDetours() : status(FeatureStatus_Unknown)
{
}
void ConsoleDetours::OnSourceModAllInitialized()
{
m_pForward = g_Forwards.CreateForwardEx("OnAnyCommand", ET_Hook, 3, NULL, Param_Cell,
Param_String, Param_Cell);
g_ShareSys.AddCapabilityProvider(NULL, this, FEATURECAP_COMMANDLISTENER);
}
void ConsoleDetours::OnSourceModShutdown()
{
List<Listener*>::iterator iter = m_Listeners.begin();
while (iter != m_Listeners.end())
{
Listener *listener = (*iter);
g_Forwards.ReleaseForward(listener->forward);
delete listener;
iter = m_Listeners.erase(iter);
}
g_Forwards.ReleaseForward(m_pForward);
s_GenericHooker.Disable();
}
FeatureStatus ConsoleDetours::GetFeatureStatus(FeatureType type, const char *name)
{
return GetStatus();
}
FeatureStatus ConsoleDetours::GetStatus()
{
if (status == FeatureStatus_Unknown)
{
status = s_GenericHooker.Enable() ? FeatureStatus_Available : FeatureStatus_Unavailable;
}
return status;
}
bool ConsoleDetours::AddListener(IPluginFunction *fun, const char *command)
{
if (GetStatus() != FeatureStatus_Available)
return false;
if (command == NULL)
{
m_pForward->AddFunction(fun);
}
else
{
const char *str = UTIL_ToLowerCase(command);
Listener *listener;
Listener **plistener = m_CmdLookup.retrieve(str);
if (plistener == NULL)
{
listener = new Listener;
listener->forward = g_Forwards.CreateForwardEx(NULL, ET_Hook, 3, NULL, Param_Cell,
Param_String, Param_Cell);
m_CmdLookup.insert(str, listener);
}
else
{
listener = *plistener;
}
listener->forward->AddFunction(fun);
delete [] str;
}
return true;
}
bool ConsoleDetours::RemoveListener(IPluginFunction *fun, const char *command)
{
if (command == NULL)
{
return m_pForward->RemoveFunction(fun);
}
else
{
const char *str = UTIL_ToLowerCase(command);
Listener *listener;
Listener **plistener = m_CmdLookup.retrieve(str);
delete [] str;
if (plistener == NULL)
return false;
listener = *plistener;
return listener->forward->RemoveFunction(fun);
}
}
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')
name[i] = tolower(realname[i]);
else
name[i] = realname[i];
}
name[len] = '\0';
cell_t result = Pl_Continue;
m_pForward->PushCell(client);
m_pForward->PushString(name);
m_pForward->PushCell(args.ArgC() - 1);
m_pForward->Execute(&result, NULL);
/* Don't let plugins block this. */
if (strcmp(name, "sm") == 0)
result = Pl_Continue;
if (result >= Pl_Stop)
return result;
Listener **plistener = m_CmdLookup.retrieve(name);
if (plistener == NULL)
return result;
Listener *listener = *plistener;
if (listener->forward->GetFunctionCount() == 0)
return result;
cell_t result2 = Pl_Continue;
listener->forward->PushCell(client);
listener->forward->PushString(name);
listener->forward->PushCell(args.ArgC() - 1);
listener->forward->Execute(&result2, NULL);
if (result2 > result)
result = result2;
/* "sm" should not have flown through the above. */
assert(strcmp(name, "sm") != 0 || result == Pl_Continue);
return result;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
cell_t ConsoleDetours::Dispatch(ConCommand *pBase, const CCommand& args)
{
#else
cell_t ConsoleDetours::Dispatch(ConCommand *pBase)
{
CCommand args;
#endif
g_HL2.PushCommandStack(&args);
cell_t res = g_ConsoleDetours.InternalDispatch(g_ConCmds.GetCommandClient(), args);
g_HL2.PopCommandStack();
#if SH_IMPL_VERSION < 4
if (res >= Pl_Handled)
{
/* See bug 4020 - we can't optimize this because looking at the vtable
* is probably more expensive, since there's no SH_GET_ORIG_VFNPTR_ENTRY.
*/
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, pBase, DummyHook, false);
dummy_hook_set = true;
pBase->Dispatch();
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, pBase, DummyHook, false);
}
else
{
/* Make sure the command gets invoked. See bug 4019 on making this better. */
pBase->Dispatch();
}
#endif
return res;
}
+83
View File
@@ -0,0 +1,83 @@
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_CONSOLE_DETOURS_H_
#define _INCLUDE_SOURCEMOD_CONSOLE_DETOURS_H_
#include "sm_globals.h"
#include "sourcemm_api.h"
#include "ForwardSys.h"
#include <sm_trie_tpl.h>
class ConsoleDetours :
public SMGlobalClass,
public IFeatureProvider
{
friend class PlayerManager;
friend class GenericCommandHooker;
struct Listener
{
IChangeableForward *forward;
};
public:
ConsoleDetours();
public: //SMGlobalClass
void OnSourceModAllInitialized();
void OnSourceModShutdown();
public: //IFeatureProvider
FeatureStatus GetFeatureStatus(FeatureType type, const char *name);
public:
bool AddListener(IPluginFunction *fun, const char *command);
bool RemoveListener(IPluginFunction *fun, const char *command);
private:
cell_t InternalDispatch(int client, const CCommand& args);
#if SOURCE_ENGINE >= SE_ORANGEBOX
static cell_t Dispatch(ConCommand *pBase, const CCommand& args);
#else
static cell_t Dispatch(ConCommand *pBase);
#endif
public:
FeatureStatus GetStatus();
bool IsEnabled()
{
return status == FeatureStatus_Available;
}
private:
FeatureStatus status;
IChangeableForward *m_pForward;
KTrie<Listener*> m_CmdLookup;
List<Listener*> m_Listeners;
};
extern ConsoleDetours g_ConsoleDetours;
#endif /* _INCLUDE_SOURCEMOD_CONSOLE_DETOURS_H_ */
+165 -12
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,29 +34,97 @@
#include "sourcemod.h"
#include "sourcemm_api.h"
#include "sm_srvcmds.h"
#include "sm_version.h"
#include <sourcemod_version.h>
#include "sm_stringutil.h"
#include "LibrarySys.h"
#include "Logger.h"
#include "PluginSys.h"
#include "ForwardSys.h"
#include "frame_hooks.h"
#ifdef PLATFORM_WINDOWS
ConVar sm_corecfgfile("sm_corecfgfile", "addons\\sourcemod\\configs\\core.cfg", 0, "SourceMod core configuration file");
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_APPLE
ConVar sm_corecfgfile("sm_corecfgfile", "addons/sourcemod/configs/core.cfg", 0, "SourceMod core configuration file");
#endif
IForward *g_pOnServerCfg = NULL;
IForward *g_pOnConfigsExecuted = NULL;
IForward *g_pOnAutoConfigsBuffered = NULL;
CoreConfig g_CoreConfig;
bool g_bConfigsExecd = false;
bool g_bServerExecd = false;
bool g_bGotServerStart = false;
bool g_bGotTrigger = false;
ConCommand *g_pExecPtr = NULL;
ConVar *g_ServerCfgFile = NULL;
void CheckAndFinalizeConfigs();
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
void Hook_ExecDispatchPre(const CCommand &cmd)
#elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
void Hook_ExecDispatchPre()
#else
# if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
void Hook_ExecDispatchPre()
#endif
{
#if SOURCE_ENGINE <= SE_DARKMESSIAH
CCommand cmd;
#endif
const char *arg = cmd.Arg(1);
if (!g_bServerExecd && arg != NULL && strcmp(arg, g_ServerCfgFile->GetString()) == 0)
{
g_bGotTrigger = true;
}
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void Hook_ExecDispatchPost(const CCommand &cmd)
#else
void Hook_ExecDispatchPost()
#endif
{
if (g_bGotTrigger)
{
g_bGotTrigger = false;
g_bServerExecd = true;
CheckAndFinalizeConfigs();
}
}
void CheckAndFinalizeConfigs()
{
if ((g_bServerExecd || g_ServerCfgFile == NULL) && g_bGotServerStart)
{
g_PendingInternalPush = true;
}
}
void CoreConfig::OnSourceModAllInitialized()
{
g_RootMenu.AddRootConsoleCommand("config", "Set core configuration options", this);
g_pOnServerCfg = g_Forwards.CreateForward("OnServerCfg", ET_Ignore, 0, NULL);
g_pOnConfigsExecuted = g_Forwards.CreateForward("OnConfigsExecuted", ET_Ignore, 0, NULL);
g_pOnAutoConfigsBuffered = g_Forwards.CreateForward("OnAutoConfigsBuffered", ET_Ignore, 0, NULL);
}
CoreConfig::CoreConfig() : m_Strings(512)
{
}
CoreConfig::~CoreConfig()
{
}
void CoreConfig::OnSourceModShutdown()
@@ -64,11 +132,51 @@ void CoreConfig::OnSourceModShutdown()
g_RootMenu.RemoveRootConsoleCommand("config", this);
g_Forwards.ReleaseForward(g_pOnServerCfg);
g_Forwards.ReleaseForward(g_pOnConfigsExecuted);
g_Forwards.ReleaseForward(g_pOnAutoConfigsBuffered);
if (g_pExecPtr != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPre, false);
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPost, true);
g_pExecPtr = NULL;
}
}
void CoreConfig::OnSourceModLevelChange(const char *mapName)
{
static bool already_checked = false;
if (!already_checked)
{
if (engine->IsDedicatedServer())
{
g_ServerCfgFile = icvar->FindVar("servercfgfile");
}
else
{
g_ServerCfgFile = icvar->FindVar("lservercfgfile");
}
if (g_ServerCfgFile != NULL)
{
g_pExecPtr = FindCommand("exec");
if (g_pExecPtr != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPre, false);
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, g_pExecPtr, Hook_ExecDispatchPost, true);
}
else
{
g_ServerCfgFile = NULL;
}
}
already_checked = true;
}
g_bConfigsExecd = false;
g_bServerExecd = false;
g_bGotServerStart = false;
g_bGotTrigger = false;
}
void CoreConfig::OnRootConsoleCommand(const char *cmdname, const CCommand &command)
@@ -106,14 +214,32 @@ void CoreConfig::Initialize()
/* Try to get command line value of core config convar */
const char *corecfg = icvar->GetCommandLineValue("sm_corecfgfile");
/* If sm_corecfgfile not specified on command line, use default value */
if (!corecfg)
/* If sm_corecfgfile is on the command line, use that
* If sm_corecfgfile isn't there, check sm_basepath on the command line and build the path off that
* If sm_basepath isn't there, just use the default path for the cfg
*/
if (corecfg)
{
corecfg = sm_corecfgfile.GetDefault();
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg);
}
else
{
const char *basepath = icvar->GetCommandLineValue("sm_basepath");
/* Format path to config file */
if (basepath)
{
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s/%s", g_SourceMod.GetGamePath(), basepath, "configs/core.cfg");
}
else
{
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), sm_corecfgfile.GetDefault());
}
}
/* Format path to config file */
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg);
/* Reset cached key values */
m_KeyValues.clear();
m_Strings.Reset();
/* Parse config file */
if ((err=textparsers->ParseFile_SMC(filePath, this, NULL)) != SMCError_Okay)
@@ -153,9 +279,21 @@ ConfigResult CoreConfig::SetConfigOption(const char *option, const char *value,
pBase = pBase->m_pGlobalClassNext;
}
m_KeyValues.replace(option, m_Strings.AddString(value));
return ConfigResult_Ignore;
}
const char *CoreConfig::GetCoreConfigValue(const char *key)
{
int *pKey = m_KeyValues.retrieve(key);
if (pKey == NULL)
{
return NULL;
}
return m_Strings.GetString(*pKey);
}
bool SM_AreConfigsExecuted()
{
return g_bConfigsExecd;
@@ -165,7 +303,7 @@ inline bool IsPathSepChar(char c)
{
#if defined PLATFORM_WINDOWS
return (c == '\\' || c == '/');
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_LINUX || defined PLATFORM_POSIX
return (c == '/');
#endif
}
@@ -257,7 +395,7 @@ bool SM_ExecuteConfig(CPlugin *pl, AutoConfig *cfg, bool can_create)
FILE *fp = fopen(file, "wt");
if (fp)
{
fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SVN_FULL_VERSION);
fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SM_FULL_VERSION);
fprintf(fp, "// ConVars for plugin \"%s\"\n", pl->GetFilename());
fprintf(fp, "\n\n");
@@ -314,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;
}
}
}
@@ -382,7 +525,7 @@ void SM_ExecuteForPlugin(IPluginContext *ctx)
void SM_ExecuteAllConfigs()
{
if (g_bConfigsExecd)
if (g_bGotServerStart)
{
return;
}
@@ -403,7 +546,8 @@ void SM_ExecuteAllConfigs()
}
iter->Release();
engine->ServerCommand("sm internal 1\n");
g_bGotServerStart = true;
CheckAndFinalizeConfigs();
}
void SM_ConfigsExecuted_Global()
@@ -418,3 +562,12 @@ void SM_ConfigsExecuted_Global()
g_pOnServerCfg->Execute(NULL);
g_pOnConfigsExecuted->Execute(NULL);
}
void SM_InternalCmdTrigger()
{
/* Order is important here. We need to buffer things before we send the command out. */
g_pOnAutoConfigsBuffered->Execute(NULL);
engine->ServerCommand("sm internal 1\n");
g_PendingInternalPush = false;
}
+11 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,6 +35,8 @@
#include "sm_globals.h"
#include <ITextParsers.h>
#include <IRootConsoleMenu.h>
#include <sm_trie_tpl.h>
#include "sm_memtable.h"
using namespace SourceMod;
@@ -43,6 +45,9 @@ class CoreConfig :
public ITextListener_SMC,
public IRootConsoleCommand
{
public:
CoreConfig();
~CoreConfig();
public: // SMGlobalClass
void OnSourceModAllInitialized();
void OnSourceModShutdown();
@@ -56,11 +61,15 @@ public:
* Initializes CoreConfig by reading from core.cfg file
*/
void Initialize();
const char *GetCoreConfigValue(const char *key);
private:
/**
* Sets configuration option by notifying SourceMod components that rely on core.cfg
*/
ConfigResult SetConfigOption(const char *option, const char *value, ConfigSource, char *Error, size_t maxlength);
private:
BaseStringTable m_Strings;
KTrie<int> m_KeyValues;
};
extern bool SM_AreConfigsExecuted();
@@ -68,6 +77,7 @@ extern void SM_ExecuteAllConfigs();
extern void SM_ExecuteForPlugin(IPluginContext *ctx);
extern void SM_ConfigsExecuted_Global();
extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
extern void SM_InternalCmdTrigger();
extern CoreConfig g_CoreConfig;
+110 -56
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -29,12 +29,74 @@
* Version: $Id$
*/
#if 0
#include "sm_globals.h"
#include "sourcemm_api.h"
#include "Tlhelp32.h"
#include "LibrarySys.h"
#include "minidump.h"
#include "sm_stringutil.h"
bool HookImportAddrTable(BYTE *base, const char *func, DWORD hookfunc, char *err, size_t maxlength)
{
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)base;
if (dos->e_magic != IMAGE_DOS_SIGNATURE)
{
UTIL_Format(err, maxlength, "%s", "Could not detect valid DOS signature");
return false;
}
IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)(base + dos->e_lfanew);
if (nt->Signature != IMAGE_NT_SIGNATURE)
{
UTIL_Format(err, maxlength, "%s", "Could not detect valid NT signature");
return false;
}
IMAGE_IMPORT_DESCRIPTOR *desc =
(IMAGE_IMPORT_DESCRIPTOR *)
(base + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if (base == (BYTE *)desc)
{
UTIL_Format(err, maxlength, "%s", "Could not find IAT");
return false;
}
bool entryFound = false;
while (desc->Name)
{
if (desc->FirstThunk != 0)
{
IMAGE_THUNK_DATA *data = (IMAGE_THUNK_DATA *)(base + desc->OriginalFirstThunk);
DWORD *iat = (DWORD *)(base + desc->FirstThunk);
while (data->u1.Function)
{
if ((data->u1.Ordinal & IMAGE_ORDINAL_FLAG32) != IMAGE_ORDINAL_FLAG32)
{
IMAGE_IMPORT_BY_NAME *import = (IMAGE_IMPORT_BY_NAME *)(base + data->u1.AddressOfData);
if (strcmp((char *)import->Name, func) == 0)
{
DWORD oldprot, oldprot2;
VirtualProtect(iat, 4, PAGE_READWRITE, &oldprot);
*iat = hookfunc;
VirtualProtect(iat, 4, oldprot, &oldprot2);
entryFound = true;
}
}
data++;
iat++;
}
}
desc++;
}
if (!entryFound)
{
UTIL_Format(err, maxlength, "Could not find IAT entry for %s", func);
return false;
}
return true;
}
BOOL
WINAPI
@@ -62,6 +124,24 @@ FARPROC WINAPI GetProcAddress2(HMODULE hModule, LPCSTR lpProcName)
return GetProcAddress(hModule, lpProcName);
}
HMODULE WINAPI LoadLibraryEx2(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags)
{
HMODULE lib = LoadLibraryEx(lpFileName, hFile, dwFlags);
/* Steam.dll seems to get loaded using an abs path, thus the use of stristr() */
if (stristr(lpFileName, "steam.dll"))
{
char err[64];
if (!HookImportAddrTable((BYTE *)lib, "GetProcAddress", (DWORD)GetProcAddress2, err, sizeof(err)))
{
Error("[SM] %s in steam.dll\n", err);
return NULL;
}
}
return lib;
}
class CrazyWindowsDebugger : public SMGlobalClass
{
public:
@@ -69,6 +149,9 @@ public:
{
HANDLE hModuleList = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
MODULEENTRY32 me32;
BYTE *engine = NULL;
BYTE *steam = NULL;
char err[64];
me32.dwSize = sizeof(MODULEENTRY32);
@@ -77,69 +160,40 @@ public:
Error("Could not initialize crazy debugger!");
}
bool found = false;
do
{
if (strcasecmp(me32.szModule, "steam.dll") == 0)
if (strcasecmp(me32.szModule, "engine.dll") == 0)
{
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)me32.modBaseAddr;
if (dos->e_magic != IMAGE_DOS_SIGNATURE)
{
Error("[SM] Could not detect steam.dll with valid DOS signature");
}
char *base = (char *)dos;
IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)(base + dos->e_lfanew);
if (nt->Signature != IMAGE_NT_SIGNATURE)
{
Error("[SM] Could not detect steam.dll with valid NT signature");
}
IMAGE_IMPORT_DESCRIPTOR *desc =
(IMAGE_IMPORT_DESCRIPTOR *)
(base + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if (base == (char *)desc)
{
Error("[SM] Could not find the steam.dll IAT");
}
while (desc->Name)
{
if (desc->FirstThunk != 0)
{
IMAGE_THUNK_DATA *data = (IMAGE_THUNK_DATA *)(base + desc->OriginalFirstThunk);
DWORD *iat = (DWORD *)(base + desc->FirstThunk);
while (data->u1.Function)
{
if ((data->u1.Ordinal & IMAGE_ORDINAL_FLAG32) != IMAGE_ORDINAL_FLAG32)
{
IMAGE_IMPORT_BY_NAME *import = (IMAGE_IMPORT_BY_NAME *)(base + data->u1.AddressOfData);
if (strcmp((char *)import->Name, "GetProcAddress") == 0)
{
DWORD oldprot, oldprot2;
VirtualProtect(iat, 4, PAGE_READWRITE, &oldprot);
*iat = (DWORD)GetProcAddress2;
VirtualProtect(iat, 4, oldprot, &oldprot2);
found = true;
goto _end;
}
}
data++;
iat++;
}
}
desc++;
}
break;
engine = me32.modBaseAddr;
}
else if (strcasecmp(me32.szModule, "steam.dll") == 0)
{
steam = me32.modBaseAddr;
}
} while (Module32Next(hModuleList, &me32));
_end:
CloseHandle(hModuleList);
if (!found)
/* This really should not happen, but ... */
if (!engine)
{
Error("Could not find steam.dll's GetProcAddress IAT entry");
Error("[SM] Could not find engine.dll\n");
}
CloseHandle(hModuleList);
/* Steam.dll isn't loaded yet */
if (!steam)
{
if (!HookImportAddrTable(engine, "LoadLibraryExA", (DWORD)LoadLibraryEx2, err, sizeof(err)))
{
Error("[SM] %s in engine.dll)\n", err);
}
}
else
{
if (!HookImportAddrTable(steam, "GetProcAddress", (DWORD)GetProcAddress2, err, sizeof(err)))
{
Error("[SM] %s in steam.dll)\n", err);
}
}
}
} s_CrazyDebugger;
#endif
+48 -33
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -37,7 +37,7 @@
#include "Logger.h"
#include "ExtensionSys.h"
#include <stdlib.h>
#include "ThreadSupport.h"
#include <IThreader.h>
#define DBPARSE_LEVEL_NONE 0
#define DBPARSE_LEVEL_MAIN 1
@@ -47,7 +47,7 @@ DBManager g_DBMan;
static bool s_OneTimeThreaderErrorMsg = false;
DBManager::DBManager()
: m_StrTab(512), m_ParseLevel(0), m_ParseState(0), m_pDefault(NULL)
: m_ParseLevel(0), m_ParseState(0), m_pDefault(NULL)
{
}
@@ -104,6 +104,7 @@ void DBManager::OnSourceModShutdown()
m_pQueueLock->DestroyThis();
g_HandleSys.RemoveType(m_DatabaseType, g_pCoreIdent);
g_HandleSys.RemoveType(m_DriverType, g_pCoreIdent);
ClearConfigs();
}
unsigned int DBManager::GetInterfaceVersion()
@@ -133,13 +134,20 @@ void DBManager::OnHandleDestroy(HandleType_t type, void *object)
void DBManager::ReadSMC_ParseStart()
{
m_confs.clear();
ClearConfigs();
m_ParseLevel = 0;
m_ParseState = DBPARSE_LEVEL_NONE;
m_StrTab.Reset();
m_DefDriver.clear();
}
void DBManager::ClearConfigs()
{
List<ConfDbInfo *>::iterator iter;
for (iter=m_confs.begin(); iter!=m_confs.end(); iter++)
delete (*iter);
m_confs.clear();
}
ConfDbInfo s_CurInfo;
SMCResult DBManager::ReadSMC_NewSection(const SMCStates *states, const char *name)
{
@@ -159,7 +167,7 @@ SMCResult DBManager::ReadSMC_NewSection(const SMCStates *states, const char *nam
}
} else if (m_ParseState == DBPARSE_LEVEL_MAIN) {
s_CurInfo = ConfDbInfo();
s_CurInfo.name = m_StrTab.AddString(name);
s_CurInfo.name = name;
m_ParseState = DBPARSE_LEVEL_DATABASE;
} else if (m_ParseState == DBPARSE_LEVEL_DATABASE) {
m_ParseLevel++;
@@ -186,16 +194,16 @@ SMCResult DBManager::ReadSMC_KeyValue(const SMCStates *states, const char *key,
{
if (strcmp(value, "default") != 0)
{
s_CurInfo.driver = m_StrTab.AddString(value);
s_CurInfo.driver = value;
}
} else if (strcmp(key, "database") == 0) {
s_CurInfo.database = m_StrTab.AddString(value);
s_CurInfo.database = value;
} else if (strcmp(key, "host") == 0) {
s_CurInfo.host = m_StrTab.AddString(value);
s_CurInfo.host = value;
} else if (strcmp(key, "user") == 0) {
s_CurInfo.user = m_StrTab.AddString(value);
s_CurInfo.user = value;
} else if (strcmp(key, "pass") == 0) {
s_CurInfo.pass = m_StrTab.AddString(value);
s_CurInfo.pass = value;
} else if (strcmp(key, "timeout") == 0) {
s_CurInfo.info.maxTimeout = atoi(value);
} else if (strcmp(key, "port") == 0) {
@@ -206,13 +214,6 @@ SMCResult DBManager::ReadSMC_KeyValue(const SMCStates *states, const char *key,
return SMCResult_Continue;
}
#define ASSIGN_VAR(var) \
if (s_CurInfo.var == -1) { \
s_CurInfo.info.var = ""; \
} else { \
s_CurInfo.info.var = m_StrTab.GetString(s_CurInfo.var); \
}
SMCResult DBManager::ReadSMC_LeavingSection(const SMCStates *states)
{
if (m_ParseLevel)
@@ -223,17 +224,26 @@ SMCResult DBManager::ReadSMC_LeavingSection(const SMCStates *states)
if (m_ParseState == DBPARSE_LEVEL_DATABASE)
{
/* Set all of the info members to either a blank string
* or the string pointer from the string table.
*/
ASSIGN_VAR(driver);
ASSIGN_VAR(database);
ASSIGN_VAR(host);
ASSIGN_VAR(user);
ASSIGN_VAR(pass);
ConfDbInfo *cdb = new ConfDbInfo();
cdb->name = s_CurInfo.name;
cdb->driver = s_CurInfo.driver;
cdb->host = s_CurInfo.host;
cdb->user = s_CurInfo.user;
cdb->pass = s_CurInfo.pass;
cdb->database = s_CurInfo.database;
cdb->realDriver = s_CurInfo.realDriver;
cdb->info.maxTimeout = s_CurInfo.info.maxTimeout;
cdb->info.port = s_CurInfo.info.port;
cdb->info.driver = cdb->driver.c_str();
cdb->info.database = cdb->database.c_str();
cdb->info.host = cdb->host.c_str();
cdb->info.user = cdb->user.c_str();
cdb->info.pass = cdb->pass.c_str();
/* Save it.. */
m_confs.push_back(s_CurInfo);
m_confs.push_back(cdb);
/* Go up one level */
m_ParseState = DBPARSE_LEVEL_MAIN;
@@ -244,7 +254,6 @@ SMCResult DBManager::ReadSMC_LeavingSection(const SMCStates *states)
return SMCResult_Continue;
}
#undef ASSIGN_VAR
void DBManager::ReadSMC_ParseEnd(bool halted, bool failed)
{
@@ -333,10 +342,10 @@ void DBManager::RemoveDriver(IDBDriver *pDriver)
}
/* Make sure NOTHING references this! */
List<ConfDbInfo>::iterator iter;
List<ConfDbInfo *>::iterator iter;
for (iter=m_confs.begin(); iter!=m_confs.end(); iter++)
{
ConfDbInfo &db = (*iter);
ConfDbInfo &db = *(*iter);
if (db.realDriver == pDriver)
{
db.realDriver = NULL;
@@ -448,12 +457,12 @@ const DatabaseInfo *DBManager::FindDatabaseConf(const char *name)
ConfDbInfo *DBManager::GetDatabaseConf(const char *name)
{
List<ConfDbInfo>::iterator iter;
List<ConfDbInfo *>::iterator iter;
for (iter=m_confs.begin(); iter!=m_confs.end(); iter++)
{
ConfDbInfo &conf = (*iter);
if (strcmp(m_StrTab.GetString(conf.name), name) == 0)
ConfDbInfo &conf = *(*iter);
if (conf.name == name)
{
return &conf;
}
@@ -717,3 +726,9 @@ const char *DBManager::GetDefaultDriverName()
{
return m_DefDriver.c_str();
}
void DBManager::AddDependency(IExtension *myself, IDBDriver *driver)
{
g_Extensions.AddRawDependency(myself, driver->GetIdentity(), driver);
}
+11 -11
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -47,16 +47,15 @@ using namespace SourceHook;
struct ConfDbInfo
{
ConfDbInfo() : name(-1), driver(-1), host(-1), user(-1), pass(-1),
database(-1), realDriver(NULL)
ConfDbInfo() : realDriver(NULL)
{
}
int name;
int driver;
int host;
int user;
int pass;
int database;
String name;
String driver;
String host;
String user;
String pass;
String database;
IDBDriver *realDriver;
DatabaseInfo info;
};
@@ -92,6 +91,7 @@ public: //IDBManager
Handle_t CreateHandle(DBHandleType type, void *ptr, IdentityToken_t *pToken);
HandleError ReadHandle(Handle_t hndl, DBHandleType type, void **ptr);
HandleError ReleaseHandle(Handle_t hndl, DBHandleType type, IdentityToken_t *token);
void AddDependency(IExtension *myself, IDBDriver *driver);
public: //ITextListener_SMC
void ReadSMC_ParseStart();
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
@@ -120,6 +120,7 @@ public:
return m_DatabaseType;
}
private:
void ClearConfigs();
void KillWorkerThread();
private:
CVector<IDBDriver *> m_drivers;
@@ -133,11 +134,10 @@ private:
IMutex *m_pQueueLock; /* Queue safety lock */
IMutex *m_pThinkLock; /* Think-queue lock */
List<ConfDbInfo> m_confs;
List<ConfDbInfo *> m_confs;
HandleType_t m_DriverType;
HandleType_t m_DatabaseType;
String m_DefDriver;
BaseStringTable m_StrTab;
char m_Filename[PLATFORM_MAX_PATH];
unsigned int m_ParseLevel;
unsigned int m_ParseState;
+29 -14
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -36,27 +36,39 @@
DebugReport g_DbgReporter;
/* I'm really lazy. This should probably be exported to ISourcePawnEngine someday,
* but we need to make sure the JIT will deal with the version bump.
*/
extern const char *GetSourcePawnErrorMessage(int error);
void DebugReport::OnSourceModAllInitialized()
{
g_pSourcePawn->SetDebugListener(this);
}
void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, const char *message, ...)
void DebugReport::OnDebugSpew(const char *msg, ...)
{
va_list ap;
char buffer[512];
va_start(ap, message);
UTIL_FormatArgs(buffer, sizeof(buffer), message, ap);
va_start(ap, msg);
UTIL_FormatArgs(buffer, sizeof(buffer), msg, ap);
va_end(ap);
g_Logger.LogMessage("[SM] %s", buffer);
}
void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, const char *message, ...)
{
va_list ap;
va_start(ap, message);
GenerateErrorVA(ctx, func_idx, err, message, ap);
va_end(ap);
}
void DebugReport::GenerateErrorVA(IPluginContext *ctx, cell_t func_idx, int err, const char *message, va_list ap)
{
char buffer[512];
UTIL_FormatArgs(buffer, sizeof(buffer), message, ap);
const char *plname = g_PluginSys.FindPluginByContext(ctx->GetContext())->GetFilename();
const char *error = GetSourcePawnErrorMessage(err);
const char *error = g_pSourcePawn2->GetErrorString(err);
if (error)
{
@@ -73,7 +85,7 @@ void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, c
{
func_idx >>= 1;
sp_public_t *function;
if (ctx->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
if (ctx->GetRuntime()->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
{
g_Logger.LogError("[SM] Unable to call function \"%s\" due to above error(s).", function->name);
}
@@ -91,7 +103,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr
va_end(ap);
const char *plname = g_PluginSys.FindPluginByContext(pContext->GetContext())->GetFilename();
const char *error = GetSourcePawnErrorMessage(err);
const char *error = g_pSourcePawn2->GetErrorString(err);
if (error)
{
@@ -103,7 +115,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr
g_Logger.LogError("[SM] %s", buffer);
IPluginDebugInfo *pDebug;
if ((pDebug = pContext->GetDebugInfo()) == NULL)
if ((pDebug = pContext->GetRuntime()->GetDebugInfo()) == NULL)
{
g_Logger.LogError("[SM] Debug mode is not enabled for \"%s\"", plname);
g_Logger.LogError("[SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug %d on",
@@ -181,6 +193,9 @@ int DebugReport::_GetPluginIndex(IPluginContext *ctx)
}
iter->Release();
return -1;
/* If we don't know which plugin this is, it's one being loaded. Fake its index for now. */
return g_PluginSys.GetPluginCount() + 1;
}
+4 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -43,7 +43,10 @@ public: // SMGlobalClass
void OnSourceModAllInitialized();
public: // IDebugListener
void OnContextExecuteError(IPluginContext *ctx, IContextTrace *error);
void OnDebugSpew(const char *msg, ...);
public:
void GenerateError(IPluginContext *ctx, cell_t func_idx, int err, const char *message, ...);
void GenerateErrorVA(IPluginContext *ctx, cell_t func_idx, int err, const char *message, va_list ap);
void GenerateCodeError(IPluginContext *ctx, uint32_t code_addr, int err, const char *message, ...);
private:
int _GetPluginIndex(IPluginContext *ctx);
+89 -22
View File
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -42,6 +42,20 @@ SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent *,
const ParamType GAMEEVENT_PARAMS[] = {Param_Cell, Param_String, Param_Cell};
typedef List<EventHook *> EventHookList;
class EventForwardFilter : public IForwardFilter
{
EventInfo *pEventInfo;
public:
EventForwardFilter(EventInfo *pEventInfo) : pEventInfo(pEventInfo)
{
}
void Preprocess(IPluginFunction *fun, FwdParamInfo *params)
{
params[2].val = pEventInfo->bDontBroadcast ? 1 : 0;
}
};
EventManager::EventManager() : m_EventType(0)
{
/* Create an event lookup trie */
@@ -147,6 +161,13 @@ void EventManager::FireGameEvent(IGameEvent *pEvent)
Just need to add ourselves as a listener to make our hook on IGameEventManager2::FireEvent work */
}
#if SOURCE_ENGINE >= SE_LEFT4DEAD
int EventManager::GetEventDebugID()
{
return EVENT_DEBUG_ID_INIT;
}
#endif
EventHookError EventManager::HookEvent(const char *name, IPluginFunction *pFunction, EventHookMode mode)
{
EventHook *pHook;
@@ -193,6 +214,9 @@ EventHookError EventManager::HookEvent(const char *name, IPluginFunction *pFunct
pHook->pPostHook->AddFunction(pFunction);
}
/* Cache the name for post hooks */
pHook->name = sm_strdup(name);
/* Increase reference count */
pHook->refCount++;
@@ -296,6 +320,9 @@ EventHookError EventManager::UnhookEvent(const char *name, IPluginFunction *pFun
/* Delete entry in trie */
sm_trie_delete(m_EventHooks, name);
/* Free the cached name */
delete pHook->name;
/* And finally free structure memory */
delete pHook;
}
@@ -321,6 +348,7 @@ EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name,
pInfo->pEvent = pEvent;
pInfo->pOwner = pContext->GetIdentity();
pInfo->bDontBroadcast = false;
return pInfo;
}
@@ -359,33 +387,49 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
IChangeableForward *pForward;
const char *name;
cell_t res = Pl_Continue;
/* Get the event name, we're going to need this for passing to post hooks */
bool broadcast = bDontBroadcast;
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
if (!pEvent)
{
RETURN_META_VALUE(MRES_IGNORED, false);
}
name = pEvent->GetName();
m_EventNames.push(name);
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
{
/* Push the event onto the event stack. The reference count is increased to make sure
* the structure is not garbage collected in between now and the post hook.
*/
pHook->refCount++;
m_EventStack.push(pHook);
pForward = pHook->pPreHook;
if (pForward)
{
EventInfo info = { pEvent, NULL };
EventInfo info(pEvent, NULL);
HandleSecurity sec(NULL, g_pCoreIdent);
Handle_t hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);
info.bDontBroadcast = bDontBroadcast;
EventForwardFilter filter(&info);
pForward->PushCell(hndl);
pForward->PushString(name);
pForward->PushCell(bDontBroadcast);
pForward->Execute(&res, NULL);
pForward->Execute(&res, &filter);
broadcast = info.bDontBroadcast;
HandleSecurity sec(NULL, g_pCoreIdent);
g_HandleSys.FreeHandle(hndl, &sec);
}
if (pHook->postCopy)
{
pHook->pEventCopy = gameevents->DuplicateEvent(pEvent);
m_EventCopies.push(gameevents->DuplicateEvent(pEvent));
}
if (res)
@@ -394,6 +438,13 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
}
else
{
m_EventStack.push(NULL);
}
if (broadcast != bDontBroadcast)
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, true, &IGameEventManager2::FireEvent, (pEvent, broadcast));
RETURN_META_VALUE(MRES_IGNORED, true);
}
@@ -401,24 +452,30 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast)
/* IGameEventManager2::FireEvent post hook */
bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
{
IGameEvent *pEventCopy = NULL;
EventHook *pHook;
EventInfo info;
IChangeableForward *pForward;
const char *name;
Handle_t hndl = 0;
name = m_EventNames.front();
/* The engine accepts NULL without crashing, so to prevent a crash in SM we ignore these */
if (!pEvent)
{
RETURN_META_VALUE(MRES_IGNORED, false);
}
if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast<void **>(&pHook)))
pHook = m_EventStack.front();
if (pHook != NULL)
{
pForward = pHook->pPostHook;
if (pForward)
{
EventInfo info = { pHook->pEventCopy, NULL };
if (pHook->postCopy)
{
info.bDontBroadcast = bDontBroadcast;
info.pEvent = m_EventCopies.front();
info.pOwner = NULL;
hndl = g_HandleSys.CreateHandle(m_EventType, &info, NULL, g_pCoreIdent, NULL);
pForward->PushCell(hndl);
@@ -426,7 +483,7 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
pForward->PushCell(BAD_HANDLE);
}
pForward->PushString(name);
pForward->PushString(pHook->name);
pForward->PushCell(bDontBroadcast);
pForward->Execute(NULL);
@@ -437,13 +494,23 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast)
g_HandleSys.FreeHandle(hndl, &sec);
/* Free event structure */
gameevents->FreeEvent(pEventCopy);
pHook->pEventCopy = NULL;
gameevents->FreeEvent(info.pEvent);
m_EventCopies.pop();
}
}
/* Decrement reference count, check if a delayed delete is needed */
if (--pHook->refCount == 0)
{
assert(pHook->pPostHook == NULL);
assert(pHook->pPreHook == NULL);
sm_trie_delete(m_EventHooks, pHook->name);
delete pHook->name;
delete pHook;
}
}
m_EventNames.pop();
m_EventStack.pop();
RETURN_META_VALUE(MRES_IGNORED, true);
}
+14 -4
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -45,8 +45,15 @@ using namespace SourceHook;
struct EventInfo
{
EventInfo()
{
}
EventInfo(IGameEvent *ev, IdentityToken_t *owner) : pEvent(ev), pOwner(owner)
{
}
IGameEvent *pEvent;
IdentityToken_t *pOwner;
bool bDontBroadcast;
};
struct EventHook
@@ -56,14 +63,13 @@ struct EventHook
pPreHook = NULL;
pPostHook = NULL;
postCopy = false;
pEventCopy = NULL;
refCount = 0;
}
IChangeableForward *pPreHook;
IChangeableForward *pPostHook;
bool postCopy;
IGameEvent *pEventCopy;
unsigned int refCount;
char *name;
};
enum EventHookMode
@@ -99,6 +105,9 @@ public: // IPluginsListener
void OnPluginUnloaded(IPlugin *plugin);
public: // IGameEventListener2
void FireGameEvent(IGameEvent *pEvent);
#if SOURCE_ENGINE >= SE_LEFT4DEAD
int GetEventDebugID();
#endif
public:
/**
* Get the 'GameEvent' handle type ID.
@@ -120,7 +129,8 @@ private:
HandleType_t m_EventType;
Trie *m_EventHooks;
CStack<EventInfo *> m_FreeEvents;
CStack<const char *> m_EventNames;
CStack<EventHook *> m_EventStack;
CStack<IGameEvent *> m_EventCopies;
};
extern EventManager g_EventManager;
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -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;
@@ -49,6 +50,9 @@ void CExtension::Initialize(const char *filename, const char *path)
m_bFullyLoaded = false;
m_File.assign(filename);
m_Path.assign(path);
char real_name[PLATFORM_MAX_PATH];
g_LibSys.GetFileFromPath(real_name, sizeof(real_name), m_Path.c_str());
m_RealFile.assign(real_name);
}
CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filename, const char *path)
@@ -57,6 +61,30 @@ CRemoteExtension::CRemoteExtension(IExtensionInterface *pAPI, const char *filena
m_pAPI = pAPI;
}
#if defined METAMOD_PLAPI_VERSION
#if SOURCE_ENGINE == SE_LEFT4DEAD
#define GAMEFIX "2.l4d"
#elif SOURCE_ENGINE == SE_LEFT4DEAD2
#define GAMEFIX "2.l4d2"
#elif SOURCE_ENGINE == SE_ALIENSWARM
#define GAMEFIX "2.swarm"
#elif SOURCE_ENGINE == SE_ORANGEBOX
#define GAMEFIX "2.ep2"
#elif SOURCE_ENGINE == SE_BLOODYGOODTIME
#define GAMEFIX "2.bgt"
#elif SOURCE_ENGINE == SE_EYE
#define GAMEFIX "2.eye"
#elif SOURCE_ENGINE == SE_ORANGEBOXVALVE
#define GAMEFIX "2.ep2v"
#elif SOURCE_ENGINE == SE_DARKMESSIAH
#define GAMEFIX "2.darkm"
#else
#define GAMEFIX "2.ep1"
#endif //(SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#else //METAMOD_PLAPI_VERSION
#define GAMEFIX "1.ep1"
#endif //METAMOD_PLAPI_VERSION
CLocalExtension::CLocalExtension(const char *filename)
{
m_PlId = 0;
@@ -64,27 +92,43 @@ CLocalExtension::CLocalExtension(const char *filename)
char path[PLATFORM_MAX_PATH];
/* Special case for new bintools binary */
if (strcmp(filename, "bintools.ext") == 0)
{
goto normal;
}
/* Zeroth, see if there is an engine specific build in the new place. */
g_SourceMod.BuildPath(Path_SM,
path,
PLATFORM_MAX_PATH,
"extensions/%s." GAMEFIX "." PLATFORM_LIB_EXT,
filename);
if (g_LibSys.IsPathFile(path))
{
goto found;
}
/* First see if there is an engine specific build! */
g_SourceMod.BuildPath(Path_SM,
path,
PLATFORM_MAX_PATH,
#if defined METAMOD_PLAPI_VERSION
#if defined ORANGEBOX_BUILD
"extensions/auto.2.ep2/%s",
#else
"extensions/auto.2.ep1/%s",
#endif //ORANGEBOX_BUILD
#else //METAMOD_PLAPI_VERSION
"extensions/auto.1.ep1/%s",
#endif //METAMOD_PLAPI_VERSION
PLATFORM_MAX_PATH,
"extensions/auto." GAMEFIX "/%s." PLATFORM_LIB_EXT,
filename);
normal:
/* Try the "normal" version */
if (!g_LibSys.IsPathFile(path))
{
g_SourceMod.BuildPath(Path_SM, path, PLATFORM_MAX_PATH, "extensions/%s", filename);
g_SourceMod.BuildPath(Path_SM,
path,
PLATFORM_MAX_PATH,
"extensions/%s." PLATFORM_LIB_EXT,
filename);
}
found:
Initialize(filename, path);
}
@@ -141,6 +185,28 @@ bool CLocalExtension::Load(char *error, size_t maxlength)
{
bool already;
m_PlId = g_pMMPlugins->Load(m_Path.c_str(), g_PLID, already, error, maxlength);
// Check the plugin didn't refuse load
Pl_Status status;
#ifndef METAMOD_PLAPI_VERSION
const char *file;
PluginId source;
#endif
if (!m_PlId || (
#ifndef METAMOD_PLAPI_VERSION
g_pMMPlugins->Query(m_PlId, file, status, source)
#else
g_pMMPlugins->Query(m_PlId, NULL, &status, NULL)
#endif
&& status < Pl_Paused))
{
m_pLib->CloseLibrary();
m_pLib = NULL;
m_pAPI = NULL;
return false;
}
}
if (!CExtension::Load(error, maxlength))
@@ -183,6 +249,23 @@ void CLocalExtension::Unload()
}
}
bool CRemoteExtension::Reload(char *error, size_t maxlength)
{
snprintf(error, maxlength, "Remote extensions do not support reloading");
return false;
}
bool CLocalExtension::Reload(char *error, size_t maxlength)
{
if (m_pLib == NULL) // FIXME: just load it instead?
return false;
m_pAPI->OnExtensionUnload();
Unload();
return Load(error, maxlength);
}
bool CRemoteExtension::IsExternal()
{
return true;
@@ -266,43 +349,12 @@ void CExtension::MarkAllLoaded()
}
}
void CExtension::AddPlugin(IPlugin *pPlugin)
void CExtension::AddPlugin(CPlugin *pPlugin)
{
/* Unfortunately we have to do this :( */
if (m_Plugins.find(pPlugin) != m_Plugins.end())
if (m_Dependents.find(pPlugin) != m_Dependents.end())
{
m_Plugins.push_back(pPlugin);
}
}
void CExtension::RemovePlugin(IPlugin *pPlugin)
{
m_Plugins.remove(pPlugin);
List<WeakNative>::iterator iter = m_WeakNatives.begin();
while (iter != m_WeakNatives.end())
{
if ((*iter).pl == pPlugin)
{
iter = m_WeakNatives.erase(iter);
}
else
{
iter++;
}
}
iter = m_ReplacedNatives.begin();
while (iter != m_ReplacedNatives.end())
{
if ((*iter).pl == pPlugin)
{
iter = m_ReplacedNatives.erase(iter);
}
else
{
iter++;
}
m_Dependents.push_back(pPlugin);
}
}
@@ -318,7 +370,12 @@ IExtensionInterface *CExtension::GetAPI()
const char *CExtension::GetFilename()
{
return m_File.c_str();
return m_RealFile.c_str();
}
const char *CExtension::GetPath() const
{
return m_Path.c_str();
}
IdentityToken_t *CExtension::GetIdentity()
@@ -336,7 +393,7 @@ bool CLocalExtension::IsLoaded()
return (m_pLib != NULL);
}
void CExtension::AddDependency(IfaceInfo *pInfo)
void CExtension::AddDependency(const IfaceInfo *pInfo)
{
if (m_Deps.find(*pInfo) == m_Deps.end())
{
@@ -521,7 +578,7 @@ void CExtensionManager::TryAutoload()
char file[PLATFORM_MAX_PATH];
len = UTIL_Format(file, sizeof(file), "%s", lfile);
strcpy(&file[len - 9], ".ext." PLATFORM_LIB_EXT);
strcpy(&file[len - 9], ".ext");
LoadAutoExtension(file);
@@ -529,13 +586,16 @@ void CExtensionManager::TryAutoload()
}
}
IExtension *CExtensionManager::LoadAutoExtension(const char *path)
IExtension *CExtensionManager::LoadAutoExtension(const char *path, bool bErrorOnMissing)
{
if (!strstr(path, "." PLATFORM_LIB_EXT))
/* Remove platform extension if it's there. Compat hack. */
const char *ext = g_LibSys.GetFileExtension(path);
if (strcmp(ext, PLATFORM_LIB_EXT) == 0)
{
char newpath[PLATFORM_MAX_PATH];
g_LibSys.PathFormat(newpath, sizeof(newpath), "%s.%s", path, PLATFORM_LIB_EXT);
return LoadAutoExtension(newpath);
char path2[PLATFORM_MAX_PATH];
UTIL_Format(path2, sizeof(path2), "%s", path);
path2[strlen(path) - strlen(PLATFORM_LIB_EXT) - 1] = '\0';
return LoadAutoExtension(path2, bErrorOnMissing);
}
IExtension *pAlready;
@@ -554,7 +614,11 @@ IExtension *CExtensionManager::LoadAutoExtension(const char *path)
if (!p->Load(error, sizeof(error)) || !p->IsLoaded())
{
g_Logger.LogError("[SM] Unable to load extension \"%s\": %s", path, error);
if (bErrorOnMissing || g_LibSys.IsPathFile(p->GetPath()))
{
g_Logger.LogError("[SM] Unable to load extension \"%s\": %s", path, error);
}
p->SetError(error);
}
@@ -573,24 +637,12 @@ IExtension *CExtensionManager::FindExtensionByFile(const char *file)
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
{
pExt = (*iter);
char short_file[PLATFORM_MAX_PATH];
g_LibSys.GetFileFromPath(short_file, sizeof(short_file), pExt->GetFilename());
if (strcmp(lookup, short_file) == 0)
if (pExt->IsSameFile(lookup))
{
return pExt;
}
}
/* If we got no results, test if there was a platform extension.
* If not, add one.
*/
if (!strstr(file, "." PLATFORM_LIB_EXT))
{
char path[PLATFORM_MAX_PATH];
UTIL_Format(path, sizeof(path), "%s.%s", file, PLATFORM_LIB_EXT);
return FindExtensionByFile(path);
}
return NULL;
}
@@ -628,6 +680,16 @@ IExtension *CExtensionManager::FindExtensionByName(const char *ext)
IExtension *CExtensionManager::LoadExtension(const char *file, char *error, size_t maxlength)
{
/* Remove platform extension if it's there. Compat hack. */
const char *ext = g_LibSys.GetFileExtension(file);
if (strcmp(ext, PLATFORM_LIB_EXT) == 0)
{
char path2[PLATFORM_MAX_PATH];
UTIL_Format(path2, sizeof(path2), "%s", file);
path2[strlen(file) - strlen(PLATFORM_LIB_EXT) - 1] = '\0';
return LoadExtension(path2, error, maxlength);
}
IExtension *pAlready;
if ((pAlready=FindExtensionByFile(file)) != NULL)
{
@@ -664,6 +726,20 @@ void CExtensionManager::BindDependency(IExtension *pRequester, IfaceInfo *pInfo)
}
}
void CExtensionManager::AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface)
{
CExtension *pExt = (CExtension *)ext;
CExtension *pOwner = GetExtensionFromIdent(other);
IfaceInfo info;
info.iface = (SMInterface *)iface;
info.owner = pOwner;
pExt->AddDependency(&info);
pOwner->AddChildDependent(pExt, (SMInterface *)iface);
}
void CExtensionManager::AddInterface(IExtension *pOwner, SMInterface *pInterface)
{
CExtension *pExt = (CExtension *)pOwner;
@@ -671,7 +747,7 @@ void CExtensionManager::AddInterface(IExtension *pOwner, SMInterface *pInterface
pExt->AddInterface(pInterface);
}
void CExtensionManager::BindChildPlugin(IExtension *pParent, IPlugin *pPlugin)
void CExtensionManager::BindChildPlugin( IExtension *pParent, CPlugin *pPlugin )
{
CExtension *pExt = (CExtension *)pParent;
@@ -684,7 +760,7 @@ void CExtensionManager::OnPluginDestroyed(IPlugin *plugin)
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
{
(*iter)->RemovePlugin(plugin);
(*iter)->DropRefsTo((CPlugin *)plugin);
}
}
@@ -709,77 +785,6 @@ CExtension *CExtensionManager::FindByOrder(unsigned int num)
return NULL;
}
void CExtensionManager::BindAllNativesToPlugin(IPlugin *pPlugin)
{
IPluginContext *pContext = pPlugin->GetBaseContext();
List<CExtension *> exts;
uint32_t natives = pContext->GetNativesNum();
sp_native_t *native;
sm_extnative_t *x_native;
sm_repnative_t *r_native;
for (uint32_t i=0; i<natives; i++)
{
/* Make sure the native is valid */
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
continue;
}
/* Make sure the native is not already bound */
if (native->status == SP_NATIVE_BOUND)
{
/* If it is bound, see if there is a replacement. */
if ((r_native = m_RepNatives.retrieve(native->name)) == NULL)
{
continue;
}
/* Rewrite the address. Whee! */
native->pfn = r_native->info.func;
/* Make sure this will unload safely */
WeakNative wn((CPlugin *)pPlugin, i);
r_native->owner->m_ReplacedNatives.push_back(wn);
continue;
}
/* See if we've got this native in our cache */
if ((x_native = m_ExtNatives.retrieve(native->name)) == NULL)
{
continue;
}
/* Try and bind it */
if (pContext->BindNativeToIndex(i, x_native->info->func) != SP_ERROR_NONE)
{
continue;
}
/* See if it's optional */
if (native->flags & SP_NTVFLAG_OPTIONAL)
{
WeakNative wkn = WeakNative((CPlugin *)pPlugin, i);
x_native->owner->m_WeakNatives.push_back(wkn);
}
else if (exts.find(x_native->owner) == exts.end())
{
exts.push_back(x_native->owner);
}
}
List<CExtension *>::iterator iter;
for (iter = exts.begin(); iter != exts.end(); iter++)
{
CExtension *pExt = (*iter);
if (pExt->m_Plugins.find(pPlugin) != pExt->m_Plugins.end())
{
continue;
}
pExt->m_Plugins.push_back(pPlugin);
}
}
bool CExtensionManager::UnloadExtension(IExtension *_pExt)
{
if (!_pExt)
@@ -804,12 +809,12 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
if (pExt->IsLoaded())
{
/* Unload any dependent plugins */
List<IPlugin *>::iterator p_iter = pExt->m_Plugins.begin();
while (p_iter != pExt->m_Plugins.end())
List<CPlugin *>::iterator p_iter = pExt->m_Dependents.begin();
while (p_iter != pExt->m_Dependents.end())
{
/* We have to manually unlink ourselves here, since we're no longer being managed */
g_PluginSys.UnloadPlugin((*p_iter));
p_iter = pExt->m_Plugins.erase(p_iter);
p_iter = pExt->m_Dependents.erase(p_iter);
}
List<String>::iterator s_iter;
@@ -820,30 +825,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
g_PluginSys.OnLibraryAction((*s_iter).c_str(), false, true);
}
/* Unbind weak natives */
List<WeakNative>::iterator wkn_iter;
for (wkn_iter=pExt->m_WeakNatives.begin(); wkn_iter!=pExt->m_WeakNatives.end(); wkn_iter++)
{
WeakNative & wkn = (*wkn_iter);
sp_context_t *ctx = wkn.pl->GetContext();
ctx->natives[wkn.idx].status = SP_NATIVE_UNBOUND;
}
/* Unbind replacement natives, link them back to their originals */
for (wkn_iter = pExt->m_ReplacedNatives.begin();
wkn_iter != pExt->m_ReplacedNatives.end();
wkn_iter++)
{
WeakNative & wkn = (*wkn_iter);
sp_context_t *ctx = wkn.pl->GetContext();
sm_repnative_t *r_native = m_RepNatives.retrieve(ctx->natives[wkn.idx].name);
if (r_native == NULL || ctx->natives[wkn.idx].pfn != r_native->info.func)
{
continue;
}
ctx->natives[wkn.idx].pfn = r_native->original;
}
/* Notify and/or unload all dependencies */
List<CExtension *>::iterator c_iter;
CExtension *pDep;
@@ -898,44 +879,7 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
/* Unbind our natives from Core */
List<const sp_nativeinfo_t *>::iterator native_iter;
for (native_iter = pExt->m_Natives.begin();
native_iter != pExt->m_Natives.end();
native_iter++)
{
const sp_nativeinfo_t *natives = (*native_iter);
sm_extnative_t *x_native;
for (unsigned int n = 0;
natives[n].name != NULL && natives[n].func != NULL;
n++)
{
x_native = m_ExtNatives.retrieve(natives[n].name);
if (x_native && x_native->owner == pExt)
{
m_ExtNatives.remove(natives[n].name);
}
}
}
/* Unbind our replacement natives */
List<sm_repnative_t>::iterator rep_iter = m_RepNativeList.begin();
while (rep_iter != m_RepNativeList.end())
{
sm_repnative_t & r_native = (*rep_iter);
if (r_native.owner == pExt)
{
m_RepNatives.remove(r_native.info.name);
rep_iter = m_RepNativeList.erase(rep_iter);
}
else
{
rep_iter++;
}
}
/* Tell it to unload */
pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
pExt->DropEverything();
}
IdentityToken_t *pIdentity;
@@ -949,6 +893,13 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
}
}
/* Tell it to unload */
if (pExt->IsLoaded())
{
IExtensionInterface *pAPI = pExt->GetAPI();
pAPI->OnExtensionUnload();
}
pExt->Unload();
delete pExt;
@@ -962,44 +913,6 @@ bool CExtensionManager::UnloadExtension(IExtension *_pExt)
return true;
}
void CExtensionManager::AddNatives(IExtension *pOwner, const sp_nativeinfo_t *natives)
{
CExtension *pExt = (CExtension *)pOwner;
pExt->m_Natives.push_back(natives);
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if (m_ExtNatives.retrieve(natives[i].name) != NULL)
{
continue;
}
sm_extnative_t x_native;
x_native.info = &natives[i];
x_native.owner = pExt;
m_ExtNatives.insert(natives[i].name, x_native);
}
}
void CExtensionManager::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
SPVM_NATIVE_FUNC orig;
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((orig = g_PluginSys.FindCoreNative(natives[i].name)) == NULL)
{
continue;
}
sm_repnative_t rep;
rep.info = natives[i];
rep.owner = (CExtension *)myself;
rep.original = orig;
m_RepNativeList.push_back(rep);
m_RepNatives.insert(natives[i].name, rep);
}
}
void CExtensionManager::MarkAllLoaded()
{
List<CExtension *>::iterator iter;
@@ -1085,11 +998,42 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
return;
}
else if (strcmp(cmd, "load") == 0)
{
if (argcount < 4)
{
g_RootMenu.ConsolePrint("[SM] Usage: sm exts load <file>");
return;
}
const char *filename = command.Arg(3);
char path[PLATFORM_MAX_PATH];
char error[256];
UTIL_Format(path, sizeof(path), "%s%s%s", filename, !strstr(filename, ".ext") ? ".ext" : "",
!strstr(filename, "." PLATFORM_LIB_EXT) ? "." PLATFORM_LIB_EXT : "");
if (FindExtensionByFile(path) != NULL)
{
g_RootMenu.ConsolePrint("[SM] Extension %s is already loaded.", path);
return;
}
if (LoadExtension(path, error, sizeof(error)))
{
g_RootMenu.ConsolePrint("[SM] Loaded extension %s successfully.", path);
} else
{
g_RootMenu.ConsolePrint("[SM] Extension %s failed to load: %s", path, error);
}
return;
}
else if (strcmp(cmd, "info") == 0)
{
if (argcount < 4)
{
g_RootMenu.ConsolePrint("[SM] Usage: sm info <#>");
g_RootMenu.ConsolePrint("[SM] Usage: sm exts info <#>");
return;
}
@@ -1097,7 +1041,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
unsigned int id = atoi(sId);
if (id <= 0)
{
g_RootMenu.ConsolePrint("[SM] Usage: sm info <#>");
g_RootMenu.ConsolePrint("[SM] Usage: sm exts info <#>");
return;
}
@@ -1174,7 +1118,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
{
if (argcount < 4)
{
g_RootMenu.ConsolePrint("[SM] Usage: sm unload <#> [code]");
g_RootMenu.ConsolePrint("[SM] Usage: sm exts unload <#> [code]");
return;
}
@@ -1206,7 +1150,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
if (!pExt->IsLoaded()
|| (!pExt->m_ChildDeps.size() && !pExt->m_Plugins.size()))
|| (!pExt->m_ChildDeps.size() && !pExt->m_Dependents.size()))
{
char filename[PLATFORM_MAX_PATH];
snprintf(filename, PLATFORM_MAX_PATH, "%s", pExt->GetFilename());
@@ -1216,7 +1160,7 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
else
{
List<IPlugin *> plugins;
List<CPlugin *> plugins;
if (pExt->m_ChildDeps.size())
{
g_RootMenu.ConsolePrint("[SM] Unloading %s will unload the following extensions: ", pExt->GetFilename());
@@ -1246,9 +1190,9 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
{
g_RootMenu.ConsolePrint(" -> %s", pExt->GetFilename());
/* Add to plugin unload list */
List<IPlugin *>::iterator p_iter;
for (p_iter=pOther->m_Plugins.begin();
p_iter!=pOther->m_Plugins.end();
List<CPlugin *>::iterator p_iter;
for (p_iter=pOther->m_Dependents.begin();
p_iter!=pOther->m_Dependents.end();
p_iter++)
{
if (plugins.find((*p_iter)) == plugins.end())
@@ -1260,12 +1204,12 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
}
}
}
if (pExt->m_Plugins.size())
if (pExt->m_Dependents.size())
{
g_RootMenu.ConsolePrint("[SM] Unloading %s will unload the following plugins: ", pExt->GetFilename());
List<IPlugin *>::iterator iter;
IPlugin *pPlugin;
for (iter = pExt->m_Plugins.begin(); iter != pExt->m_Plugins.end(); iter++)
List<CPlugin *>::iterator iter;
CPlugin *pPlugin;
for (iter = pExt->m_Dependents.begin(); iter != pExt->m_Dependents.end(); iter++)
{
pPlugin = (*iter);
if (plugins.find(pPlugin) == plugins.end())
@@ -1287,14 +1231,148 @@ void CExtensionManager::OnRootConsoleCommand(const char *cmdname, const CCommand
return;
}
}
else if (strcmp(cmd, "reload") == 0)
{
if (argcount < 4)
{
g_RootMenu.ConsolePrint("[SM] Usage: sm exts reload <#>");
return;
}
const char *arg = command.Arg(3);
unsigned int num = atoi(arg);
CExtension *pExt = FindByOrder(num);
if (!pExt)
{
g_RootMenu.ConsolePrint("[SM] Extension number %d was not found.", num);
return;
}
if (pExt->IsLoaded())
{
char filename[PLATFORM_MAX_PATH];
char error[255];
snprintf(filename, PLATFORM_MAX_PATH, "%s", pExt->GetFilename());
if (pExt->Reload(error, sizeof(error)))
{
g_RootMenu.ConsolePrint("[SM] Extension %s is now reloaded.", filename);
}
else
{
g_RootMenu.ConsolePrint("[SM] Extension %s failed to reload: %s", filename, error);
}
return;
}
else
{
g_RootMenu.ConsolePrint("[SM] Extension %s is not loaded.", pExt->GetFilename());
return;
}
}
}
g_RootMenu.ConsolePrint("SourceMod Extensions Menu:");
g_RootMenu.DrawGenericOption("info", "Extra extension information");
g_RootMenu.DrawGenericOption("list", "List extensions");
g_RootMenu.DrawGenericOption("load", "Load an extension");
g_RootMenu.DrawGenericOption("reload", "Reload an extension");
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)
@@ -1369,3 +1447,33 @@ IExtension *CExtensionManager::LoadExternal(IExtensionInterface *pInterface,
return pExt;
}
void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
{
IExtensionInterface *pAPI;
List<CExtension *>::iterator iter;
for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++)
{
if ((pAPI = (*iter)->GetAPI()) == NULL)
{
continue;
}
if (pAPI->GetExtensionVersion() > 3)
{
pAPI->OnCoreMapStart(pEdictList, edictCount, clientMax);
}
}
}
bool CLocalExtension::IsSameFile(const char *file)
{
/* Only care about the shortened name. */
return strcmp(file, m_File.c_str()) == 0;
}
bool CRemoteExtension::IsSameFile(const char *file)
{
/* :TODO: this could be better, but no one uses this API anyway. */
return strcmp(file, m_Path.c_str()) == 0;
}
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -43,6 +43,9 @@
#include <IPluginSys.h>
#include <IRootConsoleMenu.h>
#include "PluginSys.h"
#include "NativeOwner.h"
class CPlayer;
using namespace SourceMod;
using namespace SourceHook;
@@ -55,15 +58,9 @@ struct sm_extnative_t
const sp_nativeinfo_t *info;
};
/* Replacement native */
struct sm_repnative_t
{
CExtension *owner;
sp_nativeinfo_t info;
SPVM_NATIVE_FUNC original;
};
class CExtension : public IExtension
class CExtension :
public IExtension,
public CNativeOwner
{
friend class CExtensionManager;
public:
@@ -71,6 +68,7 @@ public:
public: //IExtension
IExtensionInterface *GetAPI();
const char *GetFilename();
const char *GetPath() const;
IdentityToken_t *GetIdentity();
ITERATOR *FindFirstDependency(IExtension **pOwner, SMInterface **pInterface);
bool FindNextDependency(ITERATOR *iter, IExtension **pOwner, SMInterface **pInterface);
@@ -78,17 +76,18 @@ public: //IExtension
bool IsRunning(char *error, size_t maxlength);
public:
void SetError(const char *error);
void AddDependency(IfaceInfo *pInfo);
void AddDependency(const IfaceInfo *pInfo);
void AddChildDependent(CExtension *pOther, SMInterface *iface);
void AddInterface(SMInterface *pInterface);
void AddPlugin(IPlugin *pPlugin);
void RemovePlugin(IPlugin *pPlugin);
void AddPlugin(CPlugin *pPlugin);
void MarkAllLoaded();
void AddLibrary(const char *library);
public:
virtual bool Load(char *error, size_t maxlength);
virtual bool IsLoaded() =0;
virtual void Unload() =0;
virtual bool Reload(char *error, size_t maxlength) =0;
virtual bool IsSameFile(const char* file) =0;
protected:
void Initialize(const char *filename, const char *path);
bool PerformAPICheck(char *error, size_t maxlength);
@@ -98,15 +97,12 @@ protected:
IdentityToken_t *m_pIdentToken;
IExtensionInterface *m_pAPI;
String m_File;
String m_RealFile;
String m_Path;
String m_Error;
List<IfaceInfo> m_Deps; /** Dependencies */
List<IfaceInfo> m_ChildDeps; /** Children who might depend on us */
List<SMInterface *> m_Interfaces;
List<IPlugin *> m_Plugins;
List<const sp_nativeinfo_t *> m_Natives;
List<WeakNative> m_WeakNatives;
List<WeakNative> m_ReplacedNatives;
List<String> m_Libraries;
unsigned int unload_code;
bool m_bFullyLoaded;
@@ -120,7 +116,9 @@ public:
bool Load(char *error, size_t maxlength);
bool IsLoaded();
void Unload();
bool Reload(char *error, size_t maxlength);
bool IsExternal();
bool IsSameFile(const char *file);
private:
PluginId m_PlId;
ILibrary *m_pLib;
@@ -134,7 +132,9 @@ public:
bool Load(char *error, size_t maxlength);
bool IsLoaded();
void Unload();
bool Reload(char *error, size_t maxlength);
bool IsExternal();
bool IsSameFile(const char *file);
};
class CExtensionManager :
@@ -166,28 +166,31 @@ public: //IPluginsListener
public: //IRootConsoleCommand
void OnRootConsoleCommand(const char *cmdname, const CCommand &command);
public:
IExtension *LoadAutoExtension(const char *path);
IExtension *LoadAutoExtension(const char *path, bool bErrorOnMissing=true);
void BindDependency(IExtension *pOwner, IfaceInfo *pInfo);
void AddInterface(IExtension *pOwner, SMInterface *pInterface);
void BindChildPlugin(IExtension *pParent, IPlugin *pPlugin);
void AddNatives(IExtension *pOwner, const sp_nativeinfo_t *natives);
void BindAllNativesToPlugin(IPlugin *pPlugin);
void BindChildPlugin(IExtension *pParent, CPlugin *pPlugin);
void MarkAllLoaded();
void AddDependency(IExtension *pSource, const char *file, bool required, bool autoload);
void TryAutoload();
void AddLibrary(IExtension *pSource, const char *library);
bool LibraryExists(const char *library);
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
void CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
void AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface);
public:
void ListExtensionsToClient(CPlayer *player, const CCommand &args);
public:
CExtension *GetExtensionFromIdent(IdentityToken_t *ptr);
void Shutdown();
CNativeOwner *GetNativeOwner(IExtension *pExt)
{
CExtension *p = (CExtension *)pExt;
return p;
}
private:
CExtension *FindByOrder(unsigned int num);
private:
List<CExtension *> m_Libs;
List<sm_repnative_t> m_RepNativeList;
KTrie<sm_repnative_t> m_RepNatives;
KTrie<sm_extnative_t> m_ExtNatives;
};
extern CExtensionManager g_Extensions;
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -186,6 +186,11 @@ void CForwardManager::ReleaseForward(IForward *forward)
void CForwardManager::ForwardFree(CForward *fwd)
{
if (fwd == NULL)
{
return;
}
m_FreeForwards.push(fwd);
m_managed.remove(fwd);
}
@@ -250,6 +255,7 @@ CForward *CForward::CreateForward(const char *name, ExecType et, unsigned int nu
}
CForward *pForward = g_Forwards.ForwardMake();
pForward->m_IterGuard = NULL;
pForward->m_curparam = 0;
pForward->m_ExecType = et;
snprintf(pForward->m_name, FORWARDS_NAME_MAX, "%s", name ? name : "");
@@ -283,17 +289,13 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
return err;
}
if (filter)
{
filter->OnExecuteBegin();
}
FuncIter iter = m_functions.begin();
IPluginFunction *func;
cell_t cur_result = 0;
cell_t high_result = 0;
cell_t low_result = 0;
int err;
unsigned int failed=0, success=0;
unsigned int success=0;
unsigned int num_params = m_curparam;
FwdParamInfo temp_info[SP_MAX_EXEC_PARAMS];
FwdParamInfo *param;
@@ -303,20 +305,29 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
memcpy(temp_info, m_params, sizeof(m_params));
m_curparam = 0;
for (iter=m_functions.begin(); iter!=m_functions.end(); iter++)
FuncIteratorGuard guard(&m_IterGuard, &iter);
while (iter != m_functions.end())
{
func = (*iter);
if (filter)
filter->Preprocess(func, temp_info);
for (unsigned int i=0; i<num_params; i++)
{
int err = SP_ERROR_PARAM;
param = &temp_info[i];
if (i >= m_numparams || m_types[i] == Param_Any)
{
type = param->pushedas;
} else {
}
else
{
type = m_types[i];
}
if ((i >= m_numparams) || (type & SP_PARAMFLAG_BYREF))
{
/* If we're byref or we're vararg, we always push everything by ref.
@@ -325,39 +336,37 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
if (type == Param_String)
{
err = func->PushStringEx((char *)param->byref.orig_addr, param->byref.cells, param->byref.sz_flags, param->byref.flags);
} else if (type == Param_Float || type == Param_Cell) {
}
else if (type == Param_Float || type == Param_Cell)
{
err = func->PushCellByRef(&param->val);
} else {
}
else
{
err = func->PushArray(param->byref.orig_addr, param->byref.cells, param->byref.flags);
assert(type == Param_Array || type == Param_FloatByRef || type == Param_CellByRef);
}
} else {
}
else
{
/* If we're not byref or not vararg, our job is a bit easier. */
assert(type == Param_Cell || type == Param_Float);
err = func->PushCell(param->val);
}
if (err != SP_ERROR_NONE)
{
if (!filter || !filter->OnErrorReport(this, func, err))
{
g_DbgReporter.GenerateError(func->GetParentContext(),
func->GetFunctionID(),
err,
"Failed to push parameter while executing forward");
}
g_DbgReporter.GenerateError(func->GetParentContext(),
func->GetFunctionID(),
err,
"Failed to push parameter while executing forward");
continue;
}
}
/* Call the function and deal with the return value. */
if ((err=func->Execute(&cur_result)) != SP_ERROR_NONE)
if ((err=func->Execute(&cur_result)) == SP_ERROR_NONE)
{
if (filter)
{
filter->OnErrorReport(this, func, err);
}
failed++;
} else {
success++;
switch (m_ExecType)
{
@@ -381,14 +390,12 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
}
break;
}
case ET_Custom:
case ET_LowEvent:
{
if (filter)
/* Check if the current result is the lowest so far (or if it's the first result) */
if (cur_result < low_result || success == 1)
{
if (filter->OnFunctionReturn(this, func, &cur_result) == Pl_Stop)
{
goto done;
}
low_result = cur_result;
}
break;
}
@@ -398,28 +405,45 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
}
}
}
if (!guard.Triggered())
iter++;
}
done:
if (success)
{
if (m_ExecType == ET_Event || m_ExecType == ET_Hook)
switch (m_ExecType)
{
cur_result = high_result;
} else if (m_ExecType == ET_Ignore) {
cur_result = 0;
case ET_Ignore:
{
cur_result = 0;
break;
}
case ET_Event:
case ET_Hook:
{
cur_result = high_result;
break;
}
case ET_LowEvent:
{
cur_result = low_result;
break;
}
default:
{
break;
}
}
if (result)
{
*result = cur_result;
}
}
if (filter)
{
filter->OnExecuteEnd(&cur_result, success, failed);
}
return SP_ERROR_NONE;
}
@@ -663,6 +687,7 @@ bool CForward::RemoveFunction(IPluginFunction *func)
{
if ((*iter) == func)
{
m_IterGuard->FixIteratorChain(iter);
found = true;
lst->erase(iter);
break;
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -43,7 +43,7 @@ using namespace SourceHook;
typedef List<IPluginFunction *>::iterator FuncIter;
//:TODO: a global name max define for sourcepawn, should mirror compiler's sNAMEMAX
/* :TODO: a global name max define for sourcepawn, should mirror compiler's sNAMEMAX */
#define FORWARDS_NAME_MAX 64
struct ByrefInfo
@@ -61,6 +61,58 @@ struct FwdParamInfo
ParamType pushedas;
};
class SourceMod::IForwardFilter
{
public:
virtual void Preprocess(IPluginFunction *fun, FwdParamInfo *params)
{
}
};
class FuncIteratorGuard
{
bool triggered;
FuncIteratorGuard **pprev;
FuncIter *iter;
FuncIteratorGuard *next;
public:
FuncIteratorGuard(FuncIteratorGuard **pprev, FuncIter *iter)
: triggered(false), pprev(pprev), iter(iter), next(*pprev)
{
*pprev = this;
}
~FuncIteratorGuard()
{
*pprev = next;
}
inline bool Triggered()
{
bool t = triggered;
triggered = false;
return t;
}
/**
* This should not read from |this| before the NULL check, because FwdSys
* can call (NULL)->FixIteratorChain().
*/
void FixIteratorChain(FuncIter &other)
{
FuncIteratorGuard *guard = this;
while (guard != NULL)
{
if (*guard->iter == other)
{
*(guard->iter) = ++(*(guard->iter));
guard->triggered = true;
}
guard = guard->next;
}
}
};
class CForward : public IChangeableForward
{
public: //ICallable
@@ -103,6 +155,7 @@ protected:
*/
mutable List<IPluginFunction *> m_functions;
mutable List<IPluginFunction *> m_paused;
FuncIteratorGuard *m_IterGuard;
/* Type and name information */
FwdParamInfo m_params[SP_MAX_EXEC_PARAMS];
+615 -13
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,12 +35,41 @@
#include "UserMessages.h"
#include "PlayerManager.h"
#include "sm_stringutil.h"
#include "GameConfigs.h"
#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;
static void *g_EntList = NULL;
static int entInfoOffset = -1;
namespace SourceHook
{
template<>
@@ -88,13 +117,20 @@ CHalfLife2::~CHalfLife2()
m_Maps.clear();
}
#if SOURCE_ENGINE != SE_DARKMESSIAH
CSharedEdictChangeInfo *g_pSharedChangeInfo = NULL;
#endif
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool is_original_engine = false;
#endif
void CHalfLife2::OnSourceModStartup(bool late)
{
#if SOURCE_ENGINE != SE_DARKMESSIAH
/* The Ship currently is the only known game to use an older version of the engine */
#if defined METAMOD_PLAPI_VERSION
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
#else
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
@@ -106,29 +142,161 @@ void CHalfLife2::OnSourceModStartup(bool late)
{
g_pSharedChangeInfo = engine->GetSharedEdictChangeInfo();
}
#endif
}
void CHalfLife2::OnSourceModAllInitialized()
{
m_MsgTextMsg = g_UserMsgs.GetMessageIndex("TextMsg");
m_HinTextMsg = g_UserMsgs.GetMessageIndex("HintText");
m_SayTextMsg = g_UserMsgs.GetMessageIndex("SayText");
m_VGUIMenu = g_UserMsgs.GetMessageIndex("VGUIMenu");
g_ShareSys.AddInterface(NULL, this);
FindInSendTable("CTFPlayer", "m_nDisguiseClass");
}
#if !defined METAMOD_PLAPI_VERSION
void CHalfLife2::OnSourceModAllInitialized_Post()
{
InitLogicalEntData();
InitCommandLine();
}
void CHalfLife2::InitLogicalEntData()
{
char *addr = NULL;
/*
* gEntList and/or g_pEntityList
*
* First try to lookup pointer directly for platforms with symbols.
* If symbols aren't present (Windows or stripped Linux/Mac),
* attempt find via LevelShutdown + offset
*/
if (g_pGameConf->GetMemSig("gEntList", (void **)&addr))
{
#if !defined PLATFORM_WINDOWS
if (!addr)
{
// Key exists so notify if lookup fails, but try other method.
g_Logger.LogError("Failed lookup of gEntList directly - Reverting to lookup via LevelShutdown");
}
else
{
#endif
g_EntList = reinterpret_cast<void *>(addr);
#if !defined PLATFORM_WINDOWS
}
#endif
}
if (!g_EntList)
{
if (!g_pGameConf->GetMemSig("LevelShutdown", (void **)&addr))
{
g_Logger.LogError("Logical Entities not supported by this mod (LevelShutdown) - Reverting to networkable entities only");
return;
}
if (!addr)
{
g_Logger.LogError("Failed lookup of LevelShutdown - Reverting to networkable entities only");
return;
}
int offset;
if (!g_pGameConf->GetOffset("gEntList", &offset))
{
g_Logger.LogError("Logical Entities not supported by this mod (gEntList) - Reverting to networkable entities only");
return;
}
g_EntList = *reinterpret_cast<void **>(addr + offset);
}
if (!g_EntList)
{
g_Logger.LogError("Failed lookup of gEntList - Reverting to networkable entities only");
return;
}
if (!g_pGameConf->GetOffset("EntInfo", &entInfoOffset))
{
g_Logger.LogError("Logical Entities not supported by this mod (EntInfo) - Reverting to networkable entities only");
return;
}
}
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()
{
return is_original_engine;
}
#endif
#if SOURCE_ENGINE != SE_DARKMESSIAH
IChangeInfoAccessor *CBaseEdict::GetChangeAccessor()
{
return engine->GetChangeAccessor( (const edict_t *)this );
}
#endif
bool UTIL_FindInSendTable(SendTable *pTable,
const char *name,
@@ -165,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++)
@@ -181,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;
}
}
}
}
@@ -277,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];
@@ -287,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);
}
@@ -298,6 +487,7 @@ typedescription_t *CHalfLife2::FindInDataMap(datamap_t *pMap, const char *offset
void CHalfLife2::SetEdictStateChanged(edict_t *pEdict, unsigned short offset)
{
#if SOURCE_ENGINE != SE_DARKMESSIAH
if (g_pSharedChangeInfo != NULL)
{
if (offset)
@@ -310,6 +500,7 @@ void CHalfLife2::SetEdictStateChanged(edict_t *pEdict, unsigned short offset)
}
}
else
#endif
{
pEdict->m_fStateFlags |= FL_EDICT_CHANGED;
}
@@ -320,6 +511,31 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
bf_write *pBitBuf = NULL;
cell_t players[] = {client};
if (dest == HUD_PRINTTALK)
{
const char *chat_saytext = g_pGameConf->GetKeyValue("ChatSayText");
/* Use SayText user message instead */
if (chat_saytext != NULL && strcmp(chat_saytext, "yes") == 0)
{
char buffer[192];
UTIL_Format(buffer, sizeof(buffer), "%s\1\n", msg);
if ((pBitBuf = g_UserMsgs.StartMessage(m_SayTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
}
pBitBuf->WriteByte(0);
pBitBuf->WriteString(buffer);
pBitBuf->WriteByte(1);
g_UserMsgs.EndMessage();
return true;
}
}
if ((pBitBuf = g_UserMsgs.StartMessage(m_MsgTextMsg, players, 1, USERMSG_RELIABLE)) == NULL)
{
return false;
@@ -327,6 +543,7 @@ bool CHalfLife2::TextMsg(int client, int dest, const char *msg)
pBitBuf->WriteByte(dest);
pBitBuf->WriteString(msg);
g_UserMsgs.EndMessage();
return true;
@@ -353,6 +570,26 @@ bool CHalfLife2::HintTextMsg(int client, const char *msg)
return true;
}
bool CHalfLife2::HintTextMsg(cell_t *players, int count, const char *msg)
{
bf_write *pBitBuf = NULL;
if ((pBitBuf = g_UserMsgs.StartMessage(m_HinTextMsg, players, count, USERMSG_RELIABLE)) == NULL)
{
return false;
}
const char *pre_byte = g_pGameConf->GetKeyValue("HintTextPreByte");
if (pre_byte != NULL && strcmp(pre_byte, "yes") == 0)
{
pBitBuf->WriteByte(1);
}
pBitBuf->WriteString(msg);
g_UserMsgs.EndMessage();
return true;
}
bool CHalfLife2::ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show)
{
bf_write *pBitBuf = NULL;
@@ -437,12 +674,53 @@ bool CHalfLife2::IsLANServer()
return (sv_lan->GetInt() != 0);
}
bool CHalfLife2::KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID)
{
#if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11
if (g_SMAPI->GetSourceEngineBuild() == SOURCE_ENGINE_ORIGINAL)
#else
if (strcasecmp(g_SourceMod.GetGameFolderName(), "ship") == 0)
#endif
{
Assert(filesystem);
#ifdef _MSC_VER
Assert(_heapchk() == _HEAPOK);
#endif
FileHandle_t f = filesystem->Open(resourceName, "rb", pathID);
if (!f)
return false;
// load file into a null-terminated buffer
int fileSize = filesystem->Size(f);
char *buffer = (char *)MemAllocScratch(fileSize + 1);
Assert(buffer);
filesystem->Read(buffer, fileSize, f); // read into local buffer
buffer[fileSize] = 0; // null terminate file as EOF
filesystem->Close( f ); // close file after reading
bool retOK = kv->LoadFromBuffer( resourceName, buffer, filesystem );
MemFreeScratch();
return retOK;
}
else
{
return kv->LoadFromFile(filesystem, resourceName, pathID);
}
}
void CHalfLife2::PushCommandStack(const CCommand *cmd)
{
CachedCommandInfo info;
info.args = cmd;
#if !defined ORANGEBOX_BUILD
#if SOURCE_ENGINE <= SE_DARKMESSIAH
strncopy(info.cmd, cmd->Arg(0), sizeof(info.cmd));
#endif
@@ -466,9 +744,333 @@ void CHalfLife2::PopCommandStack()
const char *CHalfLife2::CurrentCommandName()
{
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
return m_CommandStack.front().args->Arg(0);
#else
return m_CommandStack.front().cmd;
#endif
}
void CHalfLife2::AddDelayedKick(int client, int userid, const char *msg)
{
DelayedKickInfo kick;
kick.client = client;
kick.userid = userid;
UTIL_Format(kick.buffer, sizeof(kick.buffer), "%s", msg);
m_DelayedKicks.push(kick);
}
void CHalfLife2::ProcessDelayedKicks()
{
while (!m_DelayedKicks.empty())
{
DelayedKickInfo info = m_DelayedKicks.first();
m_DelayedKicks.pop();
CPlayer *player = g_Players.GetPlayerByIndex(info.client);
if (player == NULL || player->GetUserId() != info.userid)
{
continue;
}
player->Kick(info.buffer);
}
}
edict_t *CHalfLife2::EdictOfIndex(int index)
{
return ::PEntityOfEntIndex(index);
}
int CHalfLife2::IndexOfEdict(edict_t *pEnt)
{
return ::IndexOfEdict(pEnt);
}
edict_t *CHalfLife2::GetHandleEntity(CBaseHandle &hndl)
{
if (!hndl.IsValid())
{
return NULL;
}
int index = hndl.GetEntryIndex();
edict_t *pStoredEdict;
CBaseEntity *pStoredEntity;
if (!IndexToAThings(index, &pStoredEntity, &pStoredEdict))
{
return NULL;
}
if (pStoredEdict == NULL || pStoredEntity == NULL)
{
return NULL;
}
IServerEntity *pSE = pStoredEdict->GetIServerEntity();
if (pSE == NULL)
{
return NULL;
}
if (pSE->GetRefEHandle() != hndl)
{
return NULL;
}
return pStoredEdict;
}
void CHalfLife2::SetHandleEntity(CBaseHandle &hndl, edict_t *pEnt)
{
IServerEntity *pEntOther = pEnt->GetIServerEntity();
if (pEntOther == NULL)
{
return;
}
hndl.Set(pEntOther);
}
const char *CHalfLife2::GetCurrentMap()
{
return STRING(gpGlobals->mapname);
}
void CHalfLife2::ServerCommand(const char *buffer)
{
engine->ServerCommand(buffer);
}
cell_t CHalfLife2::EntityToReference(CBaseEntity *pEntity)
{
IServerUnknown *pUnknown = (IServerUnknown *)pEntity;
CBaseHandle hndl = pUnknown->GetRefEHandle();
return (hndl.ToInt() | (1<<31));
}
CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
{
if ((unsigned)entRef == INVALID_EHANDLE_INDEX)
{
return NULL;
}
CEntInfo *pInfo = NULL;
if (entRef & (1<<31))
{
/* Proper ent reference */
int hndlValue = entRef & ~(1<<31);
CBaseHandle hndl(hndlValue);
pInfo = LookupEntity(hndl.GetEntryIndex());
if (!pInfo || pInfo->m_SerialNumber != hndl.GetSerialNumber())
{
return NULL;
}
}
else
{
/* Old style index only */
pInfo = LookupEntity(entRef);
}
if (!pInfo)
{
return NULL;
}
IServerUnknown *pUnk = static_cast<IServerUnknown *>(pInfo->m_pEntity);
if (pUnk)
{
return pUnk->GetBaseEntity();
}
return NULL;
}
/**
* Retrieves the CEntInfo pointer from g_EntList for a given entity index
*/
CEntInfo *CHalfLife2::LookupEntity(int entIndex)
{
// Make sure that our index is within the bounds of the global ent array
if (entIndex < 0 || entIndex >= NUM_ENT_ENTRIES)
{
return NULL;
}
if (!g_EntList || entInfoOffset == -1)
{
/* Attempt to use engine interface instead */
static CEntInfo tempInfo;
tempInfo.m_pNext = NULL;
tempInfo.m_pPrev = NULL;
edict_t *pEdict = PEntityOfEntIndex(entIndex);
if (!pEdict)
{
return NULL;
}
IServerUnknown *pUnk = pEdict->GetUnknown();
if (!pUnk)
{
return NULL;
}
tempInfo.m_pEntity = pUnk;
tempInfo.m_SerialNumber = pUnk->GetRefEHandle().GetSerialNumber();
return &tempInfo;
}
CEntInfo *pArray = (CEntInfo *)(((unsigned char *)g_EntList) + entInfoOffset);
return &pArray[entIndex];
}
/**
SERIAL_MASK = 0x7fff (15 bits)
#define MAX_EDICT_BITS 11
#define NUM_ENT_ENTRY_BITS (MAX_EDICT_BITS + 1)
m_Index = iEntry | (iSerialNumber << NUM_ENT_ENTRY_BITS);
Top 5 bits of a handle are unused.
Bit 31 - Our 'reference' flag indicator
*/
cell_t CHalfLife2::IndexToReference(int entIndex)
{
CBaseEntity *pEnt = ReferenceToEntity(entIndex);
if (!pEnt)
{
return INVALID_EHANDLE_INDEX;
}
return EntityToReference(pEnt);
}
int CHalfLife2::ReferenceToIndex(cell_t entRef)
{
if ((unsigned)entRef == INVALID_EHANDLE_INDEX)
{
return INVALID_EHANDLE_INDEX;
}
if (entRef & (1<<31))
{
/* Proper ent reference */
int hndlValue = entRef & ~(1<<31);
CBaseHandle hndl(hndlValue);
CEntInfo *pInfo = LookupEntity(hndl.GetEntryIndex());
if (pInfo->m_SerialNumber != hndl.GetSerialNumber())
{
return INVALID_EHANDLE_INDEX;
}
return hndl.GetEntryIndex();
}
return entRef;
}
cell_t CHalfLife2::EntityToBCompatRef(CBaseEntity *pEntity)
{
if (pEntity == NULL)
{
return INVALID_EHANDLE_INDEX;
}
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));
}
else
{
return hndl.GetEntryIndex();
}
}
cell_t CHalfLife2::ReferenceToBCompatRef(cell_t entRef)
{
if ((unsigned)entRef == INVALID_EHANDLE_INDEX)
{
return INVALID_EHANDLE_INDEX;
}
int hndlValue = entRef & ~(1<<31);
CBaseHandle hndl(hndlValue);
if (hndl.GetEntryIndex() < MAX_EDICTS)
{
return hndl.GetEntryIndex();
}
return entRef;
}
void *CHalfLife2::GetGlobalEntityList()
{
return g_EntList;
}
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);
}
+55 -3
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -41,6 +41,10 @@
#include "sm_queue.h"
#include <IGameHelpers.h>
#include <KeyValues.h>
#include <server_class.h>
#include <datamap.h>
#include <ihandleentity.h>
#include <tier0/icommandline.h>
class CCommand;
@@ -72,11 +76,27 @@ struct DelayedFakeCliCmd
struct CachedCommandInfo
{
const CCommand *args;
#if !defined ORANGEBOX_BUILD
#if SOURCE_ENGINE <= SE_DARKMESSIAH
char cmd[300];
#endif
};
struct DelayedKickInfo
{
int userid;
int client;
char buffer[384];
};
class CEntInfo
{
public:
IHandleEntity *m_pEntity;
int m_SerialNumber;
CEntInfo *m_pPrev;
CEntInfo *m_pNext;
};
class CHalfLife2 :
public SMGlobalClass,
public IGameHelpers
@@ -87,6 +107,7 @@ public:
public:
void OnSourceModStartup(bool late);
void OnSourceModAllInitialized();
void OnSourceModAllInitialized_Post();
/*void OnSourceModAllShutdown();*/
public: //IGameHelpers
SendProp *FindInSendTable(const char *classname, const char *offset);
@@ -94,11 +115,32 @@ 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);
bool HintTextMsg(cell_t *players, int count, const char *msg);
bool ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show);
bool IsLANServer();
bool KVLoadFromFile(KeyValues *kv, IBaseFileSystem *filesystem, const char *resourceName, const char *pathID = NULL);
edict_t *EdictOfIndex(int index);
int IndexOfEdict(edict_t *pEnt);
edict_t *GetHandleEntity(CBaseHandle &hndl);
void SetHandleEntity(CBaseHandle &hndl, edict_t *pEnt);
const char *GetCurrentMap();
void ServerCommand(const char *buffer);
CBaseEntity *ReferenceToEntity(cell_t entRef);
cell_t EntityToReference(CBaseEntity *pEntity);
cell_t IndexToReference(int entIndex);
int ReferenceToIndex(cell_t entRef);
cell_t ReferenceToBCompatRef(cell_t entRef);
CEntInfo *LookupEntity(int entIndex);
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();
@@ -107,23 +149,33 @@ public:
void PopCommandStack();
const CCommand *PeekCommandStack();
const char *CurrentCommandName();
#if !defined METAMOD_PLAPI_VERSION
void AddDelayedKick(int client, int userid, const char *msg);
void ProcessDelayedKicks();
#if !defined METAMOD_PLAPI_VERSION || PLAPI_VERSION < 11
bool IsOriginalEngine();
#endif
private:
DataTableInfo *_FindServerClass(const char *classname);
private:
void InitLogicalEntData();
void InitCommandLine();
private:
Trie *m_pClasses;
List<DataTableInfo *> m_Tables;
THash<datamap_t *, DataMapTrie> m_Maps;
int m_MsgTextMsg;
int m_HinTextMsg;
int m_SayTextMsg;
int m_VGUIMenu;
Queue<DelayedFakeCliCmd *> m_CmdQueue;
CStack<DelayedFakeCliCmd *> m_FreeCmds;
CStack<CachedCommandInfo> m_CommandStack;
Queue<DelayedKickInfo> m_DelayedKicks;
void *m_pGetCommandLine;
};
extern CHalfLife2 g_HL2;
bool IndexToAThings(cell_t, CBaseEntity **pEntData, edict_t **pEdictData);
#endif //_INCLUDE_SOURCEMOD_CHALFLIFE2_H_
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -493,7 +493,7 @@ HandleError HandleSystem::GetHandle(Handle_t handle,
unsigned int serial = (handle >> 16);
unsigned int index = (handle & HANDLESYS_HANDLE_MASK);
if (index == 0 || index == 0xFFFF)
if (index == 0 || index > m_HandleTail || index > HANDLESYS_MAX_HANDLES)
{
return HandleError_Index;
}
@@ -620,6 +620,43 @@ HandleError HandleSystem::CloneHandle(Handle_t handle, Handle_t *newhandle, Iden
return CloneHandle(pHandle, index, newhandle, newOwner);
}
Handle_t HandleSystem::FastCloneHandle(QHandle *pHandle, unsigned int index)
{
if (pHandle->clone)
return FastCloneHandle(&m_Handles[pHandle->clone], pHandle->clone);
Handle_t hndl;
if (CloneHandle(pHandle, index, &hndl, g_pCoreIdent) != HandleError_None)
return BAD_HANDLE;
return hndl;
}
Handle_t HandleSystem::FastCloneHandle(Handle_t hndl)
{
QHandle *pHandle;
unsigned int index;
GetHandleUnchecked(hndl, pHandle, index);
return FastCloneHandle(pHandle, index);
}
void HandleSystem::GetHandleUnchecked(Handle_t hndl, QHandle *& pHandle, unsigned int &index)
{
#ifndef NDEBUG
unsigned int serial = (hndl >> 16);
#endif
index = (hndl & HANDLESYS_HANDLE_MASK);
assert(index != 0 && index <= m_HandleTail && index < HANDLESYS_MAX_HANDLES);
pHandle = &m_Handles[index];
assert(pHandle->set && pHandle->set != HandleSet_Freed);
assert(pHandle->serial == serial);
}
HandleError HandleSystem::FreeHandle(QHandle *pHandle, unsigned int index)
{
QHandleType *pType = &m_Types[pHandle->type];
@@ -910,6 +947,15 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
}
}
/* Remove it from the type cache. */
if (pType->nameIdx != -1)
{
const char *typeName;
typeName = m_strtab->GetString(pType->nameIdx);
sm_trie_delete(m_TypeLookup, typeName);
}
return true;
}
@@ -941,6 +987,10 @@ bool HandleSystem::InitAccessDefaults(TypeAccess *pTypeAccess, HandleAccess *pHa
return true;
}
#define HANDLE_LOG_VERY_BAD(message, ...) \
g_Logger.LogFatal(message, ##__VA_ARGS__); \
g_Logger.LogError(message, ##__VA_ARGS__);
bool HandleSystem::TryAndFreeSomeHandles()
{
IPluginIterator *pl_iter = g_PluginSys.GetPluginIterator();
@@ -986,11 +1036,11 @@ bool HandleSystem::TryAndFreeSomeHandles()
return false;
}
g_Logger.LogFatal("[SM] MEMORY LEAK DETECTED IN PLUGIN (file \"%s\")", highest_owner->GetFilename());
g_Logger.LogFatal("[SM] Reloading plugin to free %d handles.", highest_handle_count);
g_Logger.LogFatal("[SM] Contact the author(s) of this plugin to correct this error.", highest_handle_count);
HANDLE_LOG_VERY_BAD("[SM] MEMORY LEAK DETECTED IN PLUGIN (file \"%s\")", highest_owner->GetFilename());
HANDLE_LOG_VERY_BAD("[SM] Unloading plugin to free %d handles.", highest_handle_count);
HANDLE_LOG_VERY_BAD("[SM] Contact the author(s) of this plugin to correct this error.", highest_handle_count);
highest_owner->GetContext()->n_err = SP_ERROR_MEMACCESS;
highest_owner->GetBaseContext()->ThrowNativeErrorEx(SP_ERROR_MEMACCESS, "Memory leak");
return g_PluginSys.UnloadPlugin(highest_owner);
}
+30 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -160,6 +160,9 @@ public: //IHandleSystem
HandleError *err);
void Dump(HANDLE_REPORTER rep);
/* Bypasses security checks. */
Handle_t FastCloneHandle(Handle_t hndl);
protected:
/**
* Decodes a handle with sanity and security checking.
@@ -170,6 +173,9 @@ protected:
unsigned int *index,
bool ignoreFree=false);
Handle_t FastCloneHandle(QHandle *pHandle, unsigned int index);
void GetHandleUnchecked(Handle_t hndl, QHandle *& pHandle, unsigned int &index);
/**
* Creates a basic handle and sets its reference count to 1.
* Does not do any type or security checking.
@@ -222,4 +228,27 @@ private:
extern HandleSystem g_HandleSys;
struct AutoHandleRooter
{
public:
AutoHandleRooter(Handle_t hndl)
{
if (hndl != BAD_HANDLE)
this->hndl = g_HandleSys.FastCloneHandle(hndl);
else
this->hndl = BAD_HANDLE;
}
~AutoHandleRooter()
{
if (hndl != BAD_HANDLE)
{
HandleSecurity sec(g_pCoreIdent, g_pCoreIdent);
g_HandleSys.FreeHandle(hndl, &sec);
}
}
private:
Handle_t hndl;
};
#endif //_INCLUDE_SOURCEMOD_HANDLESYSTEM_H_
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -138,7 +138,7 @@ bool CDirectory::IsEntryDirectory()
{
#if defined PLATFORM_WINDOWS
return ((m_fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
char temppath[PLATFORM_MAX_PATH];
snprintf(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName());
return g_LibSys.IsPathDirectory(temppath);
@@ -160,7 +160,7 @@ const char *CDirectory::GetEntryName()
{
#if defined PLATFORM_WINDOWS
return m_fd.cFileName;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return ep ? ep->d_name : "";
#endif
}
@@ -174,7 +174,7 @@ bool CDirectory::IsValid()
{
#if defined PLATFORM_WINDOWS
return (m_dir != INVALID_HANDLE_VALUE);
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
return (m_dir != NULL);
#endif
}
@@ -214,7 +214,7 @@ bool LibrarySystem::IsPathFile(const char *path)
}
return true;
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
struct stat s;
if (stat(path, &s) != 0)
@@ -241,7 +241,7 @@ bool LibrarySystem::IsPathDirectory(const char *path)
return true;
}
#elif defined PLATFORM_LINUX
#elif defined PLATFORM_POSIX
struct stat s;
if (stat(path, &s) != 0)
@@ -272,25 +272,53 @@ IDirectory *LibrarySystem::OpenDirectory(const char *path)
}
void LibrarySystem::GetPlatformError(char *error, size_t maxlength)
{
#if defined PLATFORM_WINDOWS
return GetPlatformErrorEx(GetLastError(), error, maxlength);
#elif defined PLATFORM_POSIX
return GetPlatformErrorEx(errno, error, maxlength);
#endif
}
void LibrarySystem::GetPlatformErrorEx(int code, char *error, size_t maxlength)
{
if (error && maxlength)
{
#if defined PLATFORM_WINDOWS
DWORD dw = GetLastError();
FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)error,
maxlength,
NULL);
if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
(DWORD)code,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)error,
maxlength,
NULL) == 0)
{
UTIL_Format(error, maxlength, "error code %08x", code);
}
#elif defined PLATFORM_LINUX
const char *ae = strerror_r(code, error, maxlength);
if (ae != error)
{
UTIL_Format(error, maxlength, "%s", ae);
}
#elif defined PLATFORM_POSIX
snprintf(error, maxlength, "%s", strerror(errno));
strerror_r(code, error, maxlength);
#endif
}
}
void LibrarySystem::GetLoaderError(char *buffer, size_t maxlength)
{
#if defined PLATFORM_WINDOWS
GetPlatformError(buffer, maxlength);
#elif defined PLATFORM_POSIX
if (buffer != NULL && maxlength)
{
strncopy(buffer, dlerror(), maxlength);
}
#endif
}
void LibrarySystem::CloseDirectory(IDirectory *dir)
{
delete dir;
@@ -301,20 +329,16 @@ ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t maxle
LibraryHandle lib;
#if defined PLATFORM_WINDOWS
lib = LoadLibraryA(path);
if (!lib)
{
GetPlatformError(error, maxlength);
return false;
}
#elif defined PLATFORM_POSIX
lib = dlopen(path, RTLD_NOW);
if (!lib)
{
GetPlatformError(error, maxlength);
return false;
}
#endif
if (lib == NULL)
{
GetLoaderError(error, maxlength);
return NULL;
}
return new CLibrary(lib);
}
@@ -344,21 +368,26 @@ size_t LibrarySystem::PathFormat(char *buffer, size_t len, const char *fmt, ...)
const char *LibrarySystem::GetFileExtension(const char *filename)
{
size_t end = strlen(filename) - 1;
size_t len, end;
for (size_t i = end; i >= 0; i--)
len = strlen(filename);
/* Minimum string length for filename with ext would be 3; example: a.a */
if (len < 3)
{
if (i > end)
{
break;
}
return NULL;
}
end = len - 1;
for (size_t i = end; i <= end; i--)
{
if (filename[i] == PLATFORM_SEP_CHAR || filename[i] == PLATFORM_SEP_ALTCHAR)
{
break;
}
if (filename[i] == '.' && i != end)
if (filename[i] == '.' && i != end && i != 0)
{
return &filename[++i];
}
@@ -381,7 +410,7 @@ size_t LibrarySystem::GetFileFromPath(char *buffer, size_t maxlength, const char
size_t length = strlen(path);
for (size_t i = length - 1;
i >= 0 && i <= length - 1;
i <= length - 1;
i--)
{
if (path[i] == '/'
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -90,11 +90,13 @@ public:
bool IsPathFile(const char *path);
bool IsPathDirectory(const char *path);
void GetPlatformError(char *error, size_t maxlength);
void GetPlatformErrorEx(int code, char *error, size_t maxlength);
size_t PathFormat(char *buffer, size_t len, const char *fmt, ...);
const char *GetFileExtension(const char *filename);
bool CreateFolder(const char *path);
size_t GetFileFromPath(char *buffer, size_t maxlength, const char *path);
bool FileTime(const char *path, FileTimeType type, time_t *pTime);
void GetLoaderError(char *buffer, size_t maxlength);
};
extern LibrarySystem g_LibSys;
+54 -10
View File
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,9 +34,9 @@
#include "sourcemm_api.h"
#include "sm_stringutil.h"
#include "Logger.h"
#include "systems/LibrarySys.h"
#include "LibrarySys.h"
#include "TimerSys.h"
#include "sm_version.h"
#include <sourcemod_version.h>
Logger g_Logger;
@@ -149,7 +149,7 @@ void Logger::_NewMapFile()
} else {
char date[32];
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SVN_FULL_VERSION);
fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SM_FULL_VERSION);
fclose(fp);
}
}
@@ -245,6 +245,19 @@ void Logger::LogToOpenFile(FILE *fp, const char *msg, ...)
va_end(ap);
}
void Logger::LogToFileOnly(FILE *fp, const char *msg, ...)
{
if (!m_Active)
{
return;
}
va_list ap;
va_start(ap, msg);
LogToFileOnlyEx(fp, msg, ap);
va_end(ap);
}
void Logger::LogToOpenFileEx(FILE *fp, const char *msg, va_list ap)
{
if (!m_Active)
@@ -252,6 +265,32 @@ 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);
char date[32];
time_t t;
GetAdjustedTime(&t);
tm *curtime = localtime(&t);
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
fprintf(fp, "L %s: %s\n", date, buffer);
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)
{
if (!m_Active)
{
return;
}
char buffer[3072];
UTIL_FormatArgs(buffer, sizeof(buffer), msg, ap);
@@ -262,7 +301,7 @@ 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);
fflush(fp);
}
void Logger::LogMessage(const char *vafmt, ...)
@@ -323,7 +362,7 @@ void Logger::LogMessage(const char *vafmt, ...)
char date[32];
m_DailyPrintHdr = false;
strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime);
fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SVN_FULL_VERSION);
fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SM_FULL_VERSION);
}
va_list ap;
va_start(ap, vafmt);
@@ -345,6 +384,14 @@ print_error:
}
void Logger::LogError(const char *vafmt, ...)
{
va_list ap;
va_start(ap, vafmt);
LogErrorEx(vafmt, ap);
va_end(ap);
}
void Logger::LogErrorEx(const char *vafmt, va_list ap)
{
if (!m_Active)
{
@@ -375,10 +422,7 @@ void Logger::LogError(const char *vafmt, ...)
fprintf(fp, "L %s: Info (map \"%s\") (file \"errors_%04d%02d%02d.log\")\n", date, m_CurMapName.c_str(), curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday);
m_ErrMapStart = true;
}
va_list ap;
va_start(ap, vafmt);
LogToOpenFileEx(fp, vafmt, ap);
va_end(ap);
fclose(fp);
}
else
+5 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -75,9 +75,13 @@ public:
void DisableLogging();
void LogMessage(const char *msg, ...);
void LogError(const char *msg, ...);
void LogErrorEx(const char *msg, va_list ap);
void LogFatal(const char *msg, ...);
void LogToOpenFile(FILE *fp, const char *msg, ...);
void LogToOpenFileEx(FILE *fp, const char *msg, va_list ap);
/* This version does not print to console, and is thus thread-safe */
void LogToFileOnly(FILE *fp, const char *msg, ...);
void LogToFileOnlyEx(FILE *fp, const char *msg, va_list ap);
void MapChange(const char *mapname);
const char *GetLogFileName(LogType type) const;
LoggingMode GetLoggingMode() const;
+140 -88
View File
@@ -1,133 +1,185 @@
#(C)2004-2008 Metamod:Source Development Team
# (C)2004-2008 SourceMod Development Team
# Makefile written by David "BAILOPAN" Anderson
#Local paths
SMSDK = ..
HL2SDK_ORIG = ../../hl2sdk
HL2SDK_OB = ../../hl2sdk-ob
SOURCEMM14 = ../../sourcemm-1.4
SOURCEMM16 = ../../sourcemm-1.6
SRCDS_BASE = ~/srcds
SMSDK = ..
#Project options
OPT_FLAGS = -O3 -funroll-loops -s -pipe -fno-strict-aliasing
GCC4_FLAGS = -fvisibility=hidden
GCC4_CPP_FLAGS = -fvisibility-inlines-hidden
DEBUG_FLAGS = -g -ggdb3
CPP = gcc-4.1
HL2SDK_OB_VALVE = ../../hl2sdk-ob-valve
HL2SDK_L4D = ../../hl2sdk-l4d
HL2SDK_L4D2 = ../../hl2sdk-l4d2
MMSOURCE = ../../mmsource-central
#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
#####################################
OBJECTS = AdminCache.cpp CDataPack.cpp ConCmdManager.cpp ConVarManager.cpp CoreConfig.cpp \
Database.cpp DebugReporter.cpp EventManager.cpp GameConfigs.cpp HalfLife2.cpp Logger.cpp \
MemoryUtils.cpp PlayerManager.cpp TextParsers.cpp TimerSys.cpp Translator.cpp UserMessages.cpp \
sm_autonatives.cpp sm_memtable.cpp sm_srvcmds.cpp sm_stringutil.cpp sm_trie.cpp \
Database.cpp DebugReporter.cpp EventManager.cpp HalfLife2.cpp Logger.cpp \
PlayerManager.cpp TimerSys.cpp UserMessages.cpp \
sm_autonatives.cpp sm_srvcmds.cpp sm_stringutil.cpp sm_trie.cpp \
sourcemm_api.cpp sourcemod.cpp MenuStyle_Base.cpp MenuStyle_Valve.cpp MenuManager.cpp \
MenuStyle_Radio.cpp ChatTriggers.cpp ADTFactory.cpp MenuVoting.cpp sm_crc32.cpp \
frame_hooks.cpp concmd_cleaner.cpp Profiler.cpp
OBJECTS += smn_admin.cpp smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \
smn_datapacks.cpp smn_entities.cpp smn_events.cpp smn_fakenatives.cpp \
smn_filesystem.cpp smn_float.cpp smn_functions.cpp smn_gameconfigs.cpp smn_halflife.cpp \
smn_handles.cpp smn_keyvalues.cpp smn_banning.cpp smn_maplists.cpp \
smn_lang.cpp smn_player.cpp smn_string.cpp smn_sorting.cpp smn_textparse.cpp smn_timers.cpp \
smn_usermsgs.cpp smn_menus.cpp smn_database.cpp smn_vector.cpp smn_adt_array.cpp \
smn_adt_trie.cpp smn_hudtext.cpp
OBJECTS += systems/ExtensionSys.cpp systems/ForwardSys.cpp systems/HandleSys.cpp \
systems/LibrarySys.cpp systems/PluginInfoDatabase.cpp systems/PluginSys.cpp \
systems/ShareSys.cpp vm/sp_vm_basecontext.cpp vm/sp_vm_function.cpp
OBJECTS += thread/ThreadWorker.cpp thread/BaseWorker.cpp thread/PosixThreads.cpp ThreadSupport.cpp
OBJECTS_C = zlib/adler32.c zlib/compress.c zlib/crc32.c zlib/deflate.c zlib/gzio.c \
zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c \
zlib/uncompr.c zlib/zutil.c
OBJECTS_SM16 = vm/sp_vm_engine.cpp
MenuStyle_Radio.cpp ChatTriggers.cpp ADTFactory.cpp MenuVoting.cpp \
frame_hooks.cpp concmd_cleaner.cpp NextMap.cpp \
NativeOwner.cpp logic_bridge.cpp ConsoleDetours.cpp
OBJECTS += smn_bitbuffer.cpp smn_console.cpp smn_core.cpp \
smn_entities.cpp smn_events.cpp smn_fakenatives.cpp \
smn_filesystem.cpp smn_halflife.cpp \
smn_keyvalues.cpp smn_player.cpp \
smn_usermsgs.cpp smn_menus.cpp smn_vector.cpp \
smn_hudtext.cpp smn_nextmap.cpp
OBJECTS += ExtensionSys.cpp \
ForwardSys.cpp \
HandleSys.cpp \
LibrarySys.cpp \
PluginInfoDatabase.cpp \
PluginSys.cpp \
ShareSys.cpp \
NativeInvoker.cpp
##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################
C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS = -fvisibility=hidden
CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
CPP = gcc
override ENGSET = false
ifneq (,$(filter original orangebox orangeboxvalve left4dead left4dead2,$(ENGINE)))
override ENGSET = true
endif
ifeq "$(ENGINE)" "original"
HL2SDK = $(HL2SDK_ORIG)
HL2PUB = $(HL2SDK_ORIG)/public
HL2LIB = $(HL2SDK)/linux_sdk
METAMOD = $(SOURCEMM14)
INCLUDE += -I$(HL2PUB)/dlls
SRCDS = $(SRCDS_BASE)
CFLAGS += -DSOURCE_ENGINE=1
METAMOD = $(MMSOURCE)/core-legacy
INCLUDE += -I$(HL2SDK)/public/dlls
BINARY = sourcemod.1.ep1.so
endif
ifeq "$(ENGINE)" "orangebox"
HL2SDK = $(HL2SDK_OB)
HL2PUB = $(HL2SDK_OB)/public
HL2LIB = $(HL2SDK)/linux_sdk
CFLAGS += -DORANGEBOX_BUILD
METAMOD = $(SOURCEMM16)
INCLUDE += -I$(HL2PUB)/game/server
SRCDS = $(SRCDS_BASE)/orangebox
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=3
METAMOD = $(MMSOURCE)/core
INCLUDE += -I$(HL2SDK)/public/game/server
BINARY = sourcemod.2.ep2.so
endif
ifeq "$(BINARY)" ""
echo "You must supply ENGINE=orangebox or ENGINE=original"
false
ifeq "$(ENGINE)" "orangeboxvalve"
HL2SDK = $(HL2SDK_OB_VALVE)
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=6
METAMOD = $(MMSOURCE)/core
INCLUDE += -I$(HL2SDK)/public/game/server
#-I$(HL2SDK)/common
BINARY = sourcemod.2.ep2v.so
endif
ifeq "$(ENGINE)" "left4dead"
HL2SDK = $(HL2SDK_L4D)
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=7
METAMOD = $(MMSOURCE)/core
INCLUDE += -I$(HL2SDK)/public/game/server
BINARY = sourcemod.2.l4d.so
endif
ifeq "$(ENGINE)" "left4dead2"
HL2SDK = $(HL2SDK_L4D2)
HL2LIB = $(HL2SDK)/lib/linux
CFLAGS += -DSOURCE_ENGINE=8
METAMOD = $(MMSOURCE)/core
INCLUDE += -I$(HL2SDK)/public/game/server
BINARY = sourcemod.2.l4d2.so
endif
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a vstdlib_i486.so \
tier0_i486.so -lpthread -static-libgcc
HL2PUB = $(HL2SDK)/public
INCLUDE_SMSDK = -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn -I$(SMSDK)/public/extensions
OS := $(shell uname -s)
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/dlls -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
-I$(HL2PUB)/vstdlib -I$(HL2SDK)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(METAMOD)/sourcemm \
-I$(HL2PUB)/mathlib -Isystems $(INCLUDE_SMSDK)
ifeq "$(OS)" "Darwin"
LIB_EXT = dylib
HL2LIB = $(HL2SDK)/lib/mac
else
LIB_EXT = so
ifeq "$(ENGINE)" "original"
HL2LIB = $(HL2SDK)/linux_sdk
else
HL2LIB = $(HL2SDK)/lib/linux
endif
endif
SM16_INCLUDE = -I. -I.. -I$(SOURCEMM16)/sourcehook $(INCLUDE_SMSDK)
ifneq (,$(filter original orangebox left4dead,$(ENGINE)))
LIB_SUFFIX = _i486.$(LIB_EXT)
else
LIB_PREFIX = lib
LIB_SUFFIX = .$(LIB_EXT)
endif
CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_BLOODYGOODTIME=4 -DSE_EYE=5 \
-DSE_ORANGEBOXVALVE=6 -DSE_LEFT4DEAD=7 -DSE_LEFT4DEAD2=8 -DSE_ALIENSWARM=9
LINK += $(HL2LIB)/tier1_i486.a $(HL2LIB)/mathlib_i486.a $(LIB_PREFIX)vstdlib$(LIB_SUFFIX) \
$(LIB_PREFIX)tier0$(LIB_SUFFIX) -static-libgcc
INCLUDE += -I. -I.. -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/mathlib -I$(HL2PUB)/vstdlib \
-I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 -I$(METAMOD) -I$(METAMOD)/sourcehook \
-I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
-D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror \
-Wno-uninitialized -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -DSM_DEFAULT_THREADER -m32
CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################
ifeq "$(DEBUG)" "true"
BIN_DIR = Debug.$(ENGINE)
CFLAGS += $(DEBUG_FLAGS)
CFLAGS += $(C_DEBUG_FLAGS)
else
BIN_DIR = Release.$(ENGINE)
CFLAGS += $(OPT_FLAGS)
CFLAGS += $(C_OPT_FLAGS)
endif
GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca \
-Dstrcmpi=strcasecmp -Wall -Wno-uninitialized -Werror -mfpmath=sse -msse \
-DSOURCEMOD_BUILD -DSM_DEFAULT_THREADER -m32
CPPFLAGS = -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
ifeq "$(GCC_VERSION)" "4"
CFLAGS += $(GCC4_FLAGS)
CPPFLAGS += $(GCC4_CPP_FLAGS)
CFLAGS += $(C_GCC4_FLAGS)
CPPFLAGS += $(CPP_GCC4_FLAGS)
endif
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.ox)
OBJ_LINUX_C := $(OBJECTS_C:%.c=$(BIN_DIR)/%.oc)
OBJ_LINUX_SM16 := $(OBJECTS_SM16:%.cpp=$(BIN_DIR)/%.ok)
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
OBJ_LINUX := $(OBJ_LINUX:%.c=$(BIN_DIR)/%.o)
$(BIN_DIR)/%.ox: %.cpp
$(BIN_DIR)/%.o: %.cpp
$(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
$(BIN_DIR)/%.oc: %.c
$(BIN_DIR)/%.o: %.c
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
$(BIN_DIR)/%.ok: %.cpp
$(CPP) $(SM16_INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
all:
mkdir -p $(BIN_DIR)/systems
mkdir -p $(BIN_DIR)/vm
mkdir -p $(BIN_DIR)/zlib
mkdir -p $(BIN_DIR)/thread
ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so
ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so
all: check
mkdir -p $(BIN_DIR)
ln -sf $(HL2LIB)/$(LIB_PREFIX)vstdlib$(LIB_SUFFIX)
ln -sf $(HL2LIB)/$(LIB_PREFIX)tier0$(LIB_SUFFIX)
$(MAKE) -f Makefile sourcemod
sourcemod: $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16)
$(CPP) $(OBJ_LINUX) $(OBJ_LINUX_C) $(OBJ_LINUX_SM16) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
check:
if [ "$(ENGSET)" = "false" ]; then \
echo "You must supply one of the following values for ENGINE:"; \
echo "left4dead2, left4dead, orangeboxvalve, orangebox, or original"; \
exit 1; \
fi
sourcemod: check $(OBJ_LINUX)
$(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -m32 -shared -ldl -lm -o$(BIN_DIR)/$(BINARY)
debug:
$(MAKE) -f Makefile all DEBUG=true
default: all
clean:
rm -rf $(BIN_DIR)/*.ox
rm -rf $(BIN_DIR)/systems/*.ox
rm -rf $(BIN_DIR)/zlib/*.oc
rm -rf $(BIN_DIR)/vm/*.ox
rm -rf $(BIN_DIR)/thread/*.ox
clean: check
rm -rf $(BIN_DIR)/*.o
rm -rf $(BIN_DIR)/$(BINARY)
-220
View File
@@ -1,220 +0,0 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "MemoryUtils.h"
#include "ShareSys.h"
#ifdef PLATFORM_LINUX
#include <string.h>
#include <elf.h>
#endif
MemoryUtils g_MemUtils;
#if 0
MemoryUtils::MemoryUtils()
{
#ifdef PLATFORM_WINDOWS
SYSTEM_INFO info;
GetSystemInfo(&info);
m_PageSize = info.dwPageSize;
#elif defined PLATFORM_POSIX
m_PageSize = sysconf(_SC_PAGE_SIZE);
#endif
}
#endif
void MemoryUtils::OnSourceModAllInitialized()
{
g_ShareSys.AddInterface(NULL, this);
}
void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len)
{
DynLibInfo lib;
bool found;
char *ptr, *end;
memset(&lib, 0, sizeof(DynLibInfo));
if (!GetLibraryInfo(libPtr, lib))
{
return NULL;
}
ptr = reinterpret_cast<char *>(lib.baseAddress);
end = ptr + lib.memorySize;
while (ptr < end)
{
found = true;
for (register size_t i = 0; i < len; i++)
{
if (pattern[i] != '\x2A' && pattern[i] != ptr[i])
{
found = false;
break;
}
}
if (found)
return ptr;
ptr++;
}
return NULL;
}
bool MemoryUtils::GetLibraryInfo(const void *libPtr, DynLibInfo &lib)
{
unsigned long baseAddr;
if (libPtr == NULL)
{
return false;
}
#ifdef PLATFORM_WINDOWS
MEMORY_BASIC_INFORMATION info;
IMAGE_DOS_HEADER *dos;
IMAGE_NT_HEADERS *pe;
IMAGE_FILE_HEADER *file;
IMAGE_OPTIONAL_HEADER *opt;
if (!VirtualQuery(libPtr, &info, sizeof(MEMORY_BASIC_INFORMATION)))
{
return false;
}
baseAddr = reinterpret_cast<unsigned long>(info.AllocationBase);
/* All this is for our insane sanity checks :o */
dos = reinterpret_cast<IMAGE_DOS_HEADER *>(baseAddr);
pe = reinterpret_cast<IMAGE_NT_HEADERS *>(baseAddr + dos->e_lfanew);
file = &pe->FileHeader;
opt = &pe->OptionalHeader;
/* Check PE magic and signature */
if (dos->e_magic != IMAGE_DOS_SIGNATURE || pe->Signature != IMAGE_NT_SIGNATURE || opt->Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC)
{
return false;
}
/* Check architecture, which is 32-bit/x86 right now
* Should change this for 64-bit if Valve gets their act together
*/
if (file->Machine != IMAGE_FILE_MACHINE_I386)
{
return false;
}
/* For our purposes, this must be a dynamic library */
if ((file->Characteristics & IMAGE_FILE_DLL) == 0)
{
return false;
}
/* Finally, we can do this */
lib.memorySize = opt->SizeOfImage;
#elif defined PLATFORM_LINUX
Dl_info info;
Elf32_Ehdr *file;
Elf32_Phdr *phdr;
uint16_t phdrCount;
if (!dladdr(libPtr, &info))
{
return false;
}
if (!info.dli_fbase || !info.dli_fname)
{
return false;
}
/* This is for our insane sanity checks :o */
baseAddr = reinterpret_cast<unsigned long>(info.dli_fbase);
file = reinterpret_cast<Elf32_Ehdr *>(baseAddr);
/* Check ELF magic */
if (memcmp(ELFMAG, file->e_ident, SELFMAG) != 0)
{
return false;
}
/* Check ELF version */
if (file->e_ident[EI_VERSION] != EV_CURRENT)
{
return false;
}
/* Check ELF architecture, which is 32-bit/x86 right now
* Should change this for 64-bit if Valve gets their act together
*/
if (file->e_ident[EI_CLASS] != ELFCLASS32 || file->e_machine != EM_386 || file->e_ident[EI_DATA] != ELFDATA2LSB)
{
return false;
}
/* For our purposes, this must be a dynamic library/shared object */
if (file->e_type != ET_DYN)
{
return false;
}
phdrCount = file->e_phnum;
phdr = reinterpret_cast<Elf32_Phdr *>(baseAddr + file->e_phoff);
/* Add up the memory sizes of segments marked as PT_LOAD as those are the only ones that should be in memory */
for (uint16_t i = 0; i < phdrCount; i++)
{
Elf32_Phdr &hdr = phdr[i];
if (hdr.p_type == PT_LOAD)
{
lib.memorySize += hdr.p_memsz;
}
}
#endif
lib.baseAddress = reinterpret_cast<void *>(baseAddr);
return true;
}
+54 -5
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -41,6 +41,7 @@
#include "ShareSys.h"
#include "HandleSys.h"
#include "sourcemm_api.h"
#include "logic_bridge.h"
MenuManager g_Menus;
VoteMenuHandler s_VoteHandler;
@@ -230,6 +231,7 @@ IMenuPanel *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder ord
unsigned int pgn = menu->GetPagination();
unsigned int maxItems = style->GetMaxPageItems();
bool exitButton = (menu->GetMenuOptionFlags() & MENUFLAG_BUTTON_EXIT) == MENUFLAG_BUTTON_EXIT;
bool novoteButton = (menu->GetMenuOptionFlags() & MENUFLAG_BUTTON_NOVOTE) == MENUFLAG_BUTTON_NOVOTE;
if (pgn != MENU_NO_PAGINATION)
{
@@ -240,6 +242,11 @@ IMenuPanel *MenuManager::RenderMenu(int client, menu_states_t &md, ItemOrder ord
maxItems--;
}
if (novoteButton)
{
maxItems--;
}
/* This is very not allowed! */
if (maxItems < 2)
{
@@ -435,6 +442,20 @@ skip_search:
/* Draw the item according to the order */
menu_slots_t *slots = md.slots;
unsigned int position = 0; /* Keep track of the last position */
if (novoteButton)
{
char text[50];
if (!logicore.CoreTranslate(text, sizeof(text), "%T", 2, NULL, "No Vote", &client))
{
UTIL_Format(text, sizeof(text), "No Vote");
}
ItemDrawInfo dr(text, 0);
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Exit;
position++;
}
if (order == ItemOrder_Ascending)
{
md.item_on_page = drawItems[0].position;
@@ -585,14 +606,20 @@ skip_search:
{
if (exitBackButton)
{
CorePlayerTranslate(client, text, sizeof(text), "Back", NULL);
if (!logicore.CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Back", &client))
{
UTIL_Format(text, sizeof(text), "Back");
}
dr.style = ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_ExitBack;
}
else
{
CorePlayerTranslate(client, text, sizeof(text), "Previous", NULL);
if (!logicore.CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Previous", &client))
{
UTIL_Format(text, sizeof(text), "Previous");
}
dr.style = (displayPrev ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Back;
@@ -610,7 +637,10 @@ skip_search:
/* NEXT */
if (displayNext || canDrawDisabled)
{
CorePlayerTranslate(client, text, sizeof(text), "Next", NULL);
if (!logicore.CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Next", &client))
{
UTIL_Format(text, sizeof(text), "Next");
}
dr.style = (displayNext ? 0 : ITEMDRAW_DISABLED)|ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Next;
@@ -638,7 +668,10 @@ skip_search:
/* EXIT */
if (exitButton)
{
CorePlayerTranslate(client, text, sizeof(text), "Exit", NULL);
if (!logicore.CoreTranslate(text, sizeof(text), "%T", 2, NULL, "Exit", &client))
{
UTIL_Format(text, sizeof(text), "Exit");
}
dr.style = ITEMDRAW_CONTROL;
position = panel->DrawItem(dr);
slots[position].type = ItemSel_Exit;
@@ -777,3 +810,19 @@ unsigned int MenuManager::GetRemainingVoteDelay()
{
return s_VoteHandler.GetRemainingVoteDelay();
}
bool MenuManager::IsClientInVotePool(int client)
{
return s_VoteHandler.IsClientInVotePool(client);
}
bool MenuManager::RedrawClientVoteMenu(int client)
{
return RedrawClientVoteMenu2(client, true);
}
bool MenuManager::RedrawClientVoteMenu2(int client, bool revote)
{
return s_VoteHandler.RedrawToClient(client, revote);
}
+4 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -89,6 +89,9 @@ public:
bool IsVoteInProgress();
void CancelVoting();
unsigned int GetRemainingVoteDelay();
bool IsClientInVotePool(int client);
bool RedrawClientVoteMenu(int client);
bool RedrawClientVoteMenu2(int client, bool revote);
public: //IHandleTypeDispatch
void OnHandleDestroy(HandleType_t type, void *object);
bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize);
+8 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -314,7 +314,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
if (sound != NULL)
{
edict_t *pEdict = engine->PEntityOfEntIndex(client);
edict_t *pEdict = PEntityOfEntIndex(client);
if (pEdict)
{
ICollideable *pCollideable = pEdict->GetCollideable();
@@ -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);
}
}
@@ -377,6 +380,9 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
RemoveClientFromWatch(client);
}
Handle_t hndl = menu ? menu->GetHandle() : BAD_HANDLE;
AutoHandleRooter ahr(hndl);
if (cancel)
{
mh->OnMenuCancel(menu, client, reason);
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+3 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -32,11 +32,12 @@
#include "MenuStyle_Radio.h"
#include "sm_stringutil.h"
#include "UserMessages.h"
#include "GameConfigs.h"
#include <IGameConfigs.h>
#include "PlayerManager.h"
#if defined MENU_DEBUG
#include "Logger.h"
#endif
#include "logic_bridge.h"
extern const char *g_RadioNumTable[];
CRadioStyle g_RadioMenuStyle;
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+3 -4
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -32,7 +32,6 @@
#include "sm_stringutil.h"
#include "PlayerManager.h"
#include "MenuStyle_Valve.h"
#include "Translator.h"
#include "PlayerManager.h"
#include "ConCmdManager.h"
@@ -88,7 +87,7 @@ void ValveMenuStyle::HookCreateMessage(edict_t *pEdict,
return;
}
int client = engine->IndexOfEdict(pEdict);
int client = IndexOfEdict(pEdict);
if (client < 1 || client > 256)
{
return;
@@ -325,7 +324,7 @@ void CValveMenuDisplay::SendRawDisplay(int client, int priority, unsigned int ti
m_pKv->SetInt("time", time ? time : 200);
SH_CALL(g_pSPHCC, &IServerPluginHelpers::CreateMessage)(
engine->PEntityOfEntIndex(client),
PEntityOfEntIndex(client),
DIALOG_MENU,
m_pKv,
vsp_interface);
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+305 -17
View File
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,10 +34,57 @@
#include "MenuVoting.h"
#include "PlayerManager.h"
#include "sourcemm_api.h"
#include <sourcemod.h>
#include <Logger.h>
#include <HalfLife2.h>
#include <mathlib.h>
#include <const.h>
#include <ITranslator.h>
#include "logic_bridge.h"
float g_next_vote = 0.0f;
#if defined ORANGEBOX_BUILD
#define VOTE_NOT_VOTING -2
#define VOTE_PENDING -1
ConVar sm_vote_hintbox("sm_vote_progress_hintbox",
"0",
0,
"Show current vote progress in a hint box",
true,
0.0,
true,
1.0);
ConVar sm_vote_chat("sm_vote_progress_chat",
"0",
0,
"Show current vote progress as chat messages",
true,
0.0,
true,
1.0);
ConVar sm_vote_console("sm_vote_progress_console",
"0",
0,
"Show current vote progress as console messages",
true,
0.0,
true,
1.0);
ConVar sm_vote_client_console("sm_vote_progress_client_console",
"0",
0,
"Show current vote progress as console messages to clients",
true,
0.0,
true,
1.0);
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnVoteDelayChange(IConVar *cvar, const char *value, float flOldValue);
#else
void OnVoteDelayChange(ConVar *cvar, const char *value);
@@ -52,7 +99,7 @@ ConVar sm_vote_delay("sm_vote_delay",
0.0,
OnVoteDelayChange);
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnVoteDelayChange(IConVar *cvar, const char *value, float flOldValue)
#else
void OnVoteDelayChange(ConVar *cvar, const char *value)
@@ -113,14 +160,19 @@ void VoteMenuHandler::OnClientDisconnected(int client)
return;
}
/* Wipe out their vote if they had one */
/* Wipe out their vote if they had one. We have to make sure the the the
* newly connected client is not allowed to vote.
*/
int item;
if ((item = m_ClientVotes[client]) >= 0)
if ((item = m_ClientVotes[client]) >= VOTE_PENDING)
{
assert((unsigned)item < m_Items);
assert(m_Votes[item] > 0);
m_Votes[item]--;
m_ClientVotes[client] = -1;
if (item >= 0)
{
assert((unsigned)item < m_Items);
assert(m_Votes[item] > 0);
m_Votes[item]--;
}
m_ClientVotes[client] = VOTE_NOT_VOTING;
}
}
@@ -129,18 +181,28 @@ bool VoteMenuHandler::IsVoteInProgress()
return (m_pCurMenu != NULL);
}
bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int clients[], unsigned int max_time, unsigned int flags/* =0 */)
bool VoteMenuHandler::StartVote(IBaseMenu *menu,
unsigned int num_clients,
int clients[],
unsigned int max_time,
unsigned int flags/* =0 */)
{
if (!InitializeVoting(menu, menu->GetHandler(), max_time, flags))
{
return false;
}
/* Note: we can use game time and not universal time because
* if we're voting then players are in-game.
*/
float fVoteDelay = sm_vote_delay.GetFloat();
if (fVoteDelay < 1.0)
{
g_next_vote = 0.0;
} else {
}
else
{
/* This little trick breaks for infinite votes!
* However, we just ignore that since those 1) shouldn't exist and
* 2) people must be checking IsVoteInProgress() beforehand anyway.
@@ -148,8 +210,15 @@ bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int c
g_next_vote = gpGlobals->curtime + fVoteDelay + (float)max_time;
}
m_fStartTime = gpGlobals->curtime;
m_nMenuTime = max_time;
for (unsigned int i=0; i<num_clients; i++)
{
if (clients[i] < 1 || clients[i] > 256)
{
continue;
}
menu->Display(clients[i], max_time, this);
}
@@ -158,6 +227,72 @@ bool VoteMenuHandler::StartVote(IBaseMenu *menu, unsigned int num_clients, int c
return true;
}
bool VoteMenuHandler::IsClientInVotePool(int client)
{
if (client < 1
|| client > g_Players.MaxClients()
|| m_pCurMenu == NULL)
{
return false;
}
return (m_ClientVotes[client] > VOTE_NOT_VOTING);
}
bool VoteMenuHandler::GetClientVoteChoice(int client, unsigned int *pItem)
{
if (!IsClientInVotePool(client)
|| m_ClientVotes[client] == VOTE_PENDING)
{
return false;
}
*pItem = m_ClientVotes[client];
return true;
}
bool VoteMenuHandler::RedrawToClient(int client, bool revotes)
{
unsigned int time_limit;
if (!IsClientInVotePool(client))
{
return false;
}
if (m_ClientVotes[client] >= 0)
{
if ((m_VoteFlags & VOTEFLAG_NO_REVOTES) == VOTEFLAG_NO_REVOTES || !revotes)
{
return false;
}
assert((unsigned)m_ClientVotes[client] < m_Items);
assert(m_Votes[m_ClientVotes[client]] > 0);
m_Votes[m_ClientVotes[client]]--;
m_ClientVotes[client] = VOTE_PENDING;
m_Revoting[client] = true;
m_NumVotes--;
}
if (m_nMenuTime == MENU_TIME_FOREVER)
{
time_limit = m_nMenuTime;
}
else
{
time_limit = (int)((float)m_nMenuTime - (gpGlobals->curtime - m_fStartTime));
/* Make sure this doesn't round to zero */
if (time_limit == MENU_TIME_FOREVER)
{
time_limit = 1;
}
}
return m_pCurMenu->Display(client, time_limit, this);
}
bool VoteMenuHandler::InitializeVoting(IBaseMenu *menu,
IMenuHandler *handler,
unsigned int time,
@@ -173,7 +308,8 @@ bool VoteMenuHandler::InitializeVoting(IBaseMenu *menu,
/* Mark all clients as not voting */
for (int i=1; i<=gpGlobals->maxClients; i++)
{
m_ClientVotes[i] = -2;
m_ClientVotes[i] = VOTE_NOT_VOTING;
m_Revoting[i] = false;
}
m_Items = menu->GetItemCount();
@@ -187,7 +323,9 @@ bool VoteMenuHandler::InitializeVoting(IBaseMenu *menu,
m_Votes[i] = 0;
}
m_Votes.resize(m_Items, 0);
} else {
}
else
{
for (unsigned int i=0; i<m_Items; i++)
{
m_Votes[i] = 0;
@@ -215,6 +353,8 @@ void VoteMenuHandler::StartVoting()
m_pHandler->OnMenuVoteStart(m_pCurMenu);
m_displayTimer = g_Timers.CreateTimer(this, 1.0, NULL, TIMER_FLAG_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
/* By now we know how many clients were set.
* If there are none, we should end IMMEDIATELY.
*/
@@ -222,6 +362,8 @@ void VoteMenuHandler::StartVoting()
{
EndVoting();
}
m_TotalClients = m_Clients;
}
void VoteMenuHandler::DecrementPlayerCount()
@@ -252,10 +394,17 @@ void VoteMenuHandler::EndVoting()
if (fVoteDelay < 1.0)
{
g_next_vote = 0.0;
} else {
}
else
{
g_next_vote = gpGlobals->curtime + fVoteDelay;
}
if (m_displayTimer)
{
g_Timers.KillTimer(m_displayTimer);
}
if (m_bCancelled)
{
/* If we were cancelled, don't bother tabulating anything.
@@ -302,7 +451,7 @@ void VoteMenuHandler::EndVoting()
/* Build the client list */
for (int i=1; i<=gpGlobals->maxClients; i++)
{
if (m_ClientVotes[i] >= -1)
if (m_ClientVotes[i] >= VOTE_PENDING)
{
client_vote[vote.num_clients].client = i;
client_vote[vote.num_clients].item = m_ClientVotes[i];
@@ -346,7 +495,7 @@ void VoteMenuHandler::OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReason
void VoteMenuHandler::OnMenuDisplay(IBaseMenu *menu, int client, IMenuPanel *display)
{
m_ClientVotes[client] = -1;
m_ClientVotes[client] = VOTE_PENDING;
m_pHandler->OnMenuDisplay(menu, client, display);
}
@@ -368,6 +517,58 @@ void VoteMenuHandler::OnMenuSelect(IBaseMenu *menu, int client, unsigned int ite
m_ClientVotes[client] = item;
m_Votes[item]++;
m_NumVotes++;
if (sm_vote_chat.GetBool() || sm_vote_console.GetBool() || sm_vote_client_console.GetBool())
{
static char buffer[1024];
ItemDrawInfo dr;
menu->GetItemInfo(item, &dr);
if (sm_vote_console.GetBool())
{
int target = SOURCEMOD_SERVER_LANGUAGE;
logicore.CoreTranslate(buffer, sizeof(buffer), "[SM] %T", 4, NULL, "Voted For",
&target, g_Players.GetPlayerByIndex(client)->GetName(), dr.display);
Engine_LogPrintWrapper(buffer);
}
if (sm_vote_chat.GetBool() || sm_vote_client_console.GetBool())
{
int maxclients = g_Players.GetMaxClients();
for (int i=1; i<=maxclients; i++)
{
CPlayer *pPlayer = g_Players.GetPlayerByIndex(i);
assert(pPlayer);
if (pPlayer->IsInGame() && !pPlayer->IsFakeClient())
{
if (m_Revoting[client])
{
logicore.CoreTranslate(buffer, sizeof(buffer), "[SM] %T", 4, NULL, "Changed Vote",
&i, g_Players.GetPlayerByIndex(client)->GetName(), dr.display);
}
else
{
logicore.CoreTranslate(buffer, sizeof(buffer), "[SM] %T", 4, NULL, "Voted For",
&i, g_Players.GetPlayerByIndex(client)->GetName(), dr.display);
}
if (sm_vote_chat.GetBool())
{
g_HL2.TextMsg(i, HUD_PRINTTALK, buffer);
}
if (sm_vote_client_console.GetBool())
{
ClientConsolePrint(pPlayer->GetEdict(), buffer);
}
}
}
}
}
BuildVoteLeaders();
DrawHintProgress();
}
m_pHandler->OnMenuSelect(menu, client, item);
@@ -390,6 +591,9 @@ void VoteMenuHandler::InternalReset()
m_NumVotes = 0;
m_bCancelled = false;
m_pHandler = NULL;
m_leaderList[0] = '\0';
m_displayTimer = NULL;
m_TotalClients = 0;
}
void VoteMenuHandler::CancelVoting()
@@ -411,3 +615,87 @@ bool VoteMenuHandler::IsCancelling()
{
return m_bCancelled;
}
void VoteMenuHandler::DrawHintProgress()
{
if (!sm_vote_hintbox.GetBool())
{
return;
}
static char buffer[1024];
float timeRemaining = (m_fStartTime + m_nMenuTime) - gpGlobals->curtime;
if (timeRemaining < 0)
{
timeRemaining = 0.0;
}
int iTimeRemaining = RoundFloatToInt(timeRemaining);
int maxclients = g_Players.GetMaxClients();
for (int i=1; i<=maxclients; i++)
{
if (g_Players.GetPlayerByIndex(i)->IsInGame())
{
logicore.CoreTranslate(buffer, sizeof(buffer), "%T%s", 6, NULL, "Vote Count",
&i, &m_NumVotes, &m_TotalClients, &iTimeRemaining, &m_leaderList);
g_HL2.HintTextMsg(i, buffer);
}
}
}
void VoteMenuHandler::BuildVoteLeaders()
{
if (m_NumVotes == 0 || !sm_vote_hintbox.GetBool())
{
return;
}
menu_vote_result_t vote;
menu_vote_result_t::menu_item_vote_t item_vote[256];
memset(&vote, 0, sizeof(vote));
/* Build the item list */
for (unsigned int i=0; i<m_Items; i++)
{
if (m_Votes[i] > 0)
{
item_vote[vote.num_items].count = m_Votes[i];
item_vote[vote.num_items].item = i;
vote.num_votes += m_Votes[i];
vote.num_items++;
}
}
vote.item_list = item_vote;
assert(vote.num_votes);
/* Sort the item list descending */
qsort(item_vote,
vote.num_items,
sizeof(menu_vote_result_t::menu_item_vote_t),
SortVoteItems);
/* Take the top 3 (if applicable) and draw them */
int len = 0;
for (unsigned int i=0; i<vote.num_items && i<3; i++)
{
int curItem = vote.item_list[i].item;
ItemDrawInfo dr;
m_pCurMenu->GetItemInfo(curItem, &dr);
len += g_SourceMod.Format(m_leaderList + len, sizeof(m_leaderList) - len, "\n%i. %s: (%i)", i+1, dr.display, vote.item_list[i].count);
}
}
SourceMod::ResultType VoteMenuHandler::OnTimer(ITimer *pTimer, void *pData)
{
DrawHintProgress();
return Pl_Continue;
}
void VoteMenuHandler::OnTimerEnd(ITimer *pTimer, void *pData)
{
m_displayTimer = NULL;
}
+19 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -36,6 +36,7 @@
#include <IPlayerHelpers.h>
#include <sh_vector.h>
#include "sm_globals.h"
#include <TimerSys.h>
using namespace SourceHook;
using namespace SourceMod;
@@ -43,7 +44,8 @@ using namespace SourceMod;
class VoteMenuHandler :
public IMenuHandler,
public SMGlobalClass,
public IClientListener
public IClientListener,
public ITimedEvent
{
public: //SMGlobalClass
void OnSourceModAllInitialized();
@@ -61,6 +63,9 @@ public: //IMenuHandler
void OnMenuEnd(IBaseMenu *menu, MenuEndReason reason);
void OnMenuDrawItem(IBaseMenu *menu, int client, unsigned int item, unsigned int &style);
unsigned int OnMenuDisplayItem(IBaseMenu *menu, int client, IMenuPanel *panel, unsigned int item, const ItemDrawInfo &dr);
public: //ITimedEvent
ResultType OnTimer(ITimer *pTimer, void *pData);
void OnTimerEnd(ITimer *pTimer, void *pData);
public:
bool StartVote(IBaseMenu *menu,
unsigned int num_clients,
@@ -72,6 +77,9 @@ public:
IBaseMenu *GetCurrentMenu();
bool IsCancelling();
unsigned int GetRemainingVoteDelay();
bool IsClientInVotePool(int client);
bool GetClientVoteChoice(int client, unsigned int *pItem);
bool RedrawToClient(int client, bool revote);
private:
void Reset(IMenuHandler *mh);
void DecrementPlayerCount();
@@ -82,9 +90,12 @@ private:
unsigned int time,
unsigned int flags);
void StartVoting();
void DrawHintProgress();
void BuildVoteLeaders();
private:
IMenuHandler *m_pHandler;
unsigned int m_Clients;
unsigned int m_TotalClients;
unsigned int m_Items;
CVector<unsigned int> m_Votes;
IBaseMenu *m_pCurMenu;
@@ -93,7 +104,13 @@ private:
unsigned int m_NumVotes;
unsigned int m_VoteTime;
unsigned int m_VoteFlags;
float m_fStartTime;
unsigned int m_nMenuTime;
int m_ClientVotes[256+1];
bool m_Revoting[256+1];
char m_leaderList[1024];
ITimer *m_displayTimer;
};
#endif //_INCLUDE_SOURCEMOD_MENUVOTING_H_
+379
View File
@@ -0,0 +1,379 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourcePawn
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "NativeInvoker.h"
#include "ShareSys.h"
NativeInterface g_NInvoke;
NativeInvoker::NativeInvoker()
{
}
NativeInvoker::~NativeInvoker()
{
}
const char *NativeInterface::GetInterfaceName()
{
return SMINTERFACE_NINVOKE_NAME;
}
unsigned int NativeInterface::GetInterfaceVersion()
{
return SMINTERFACE_NINVOKE_VERSION;
}
void NativeInterface::OnSourceModAllInitialized()
{
g_ShareSys.AddInterface(NULL, &g_NInvoke);
}
IPluginRuntime *NativeInterface::CreateRuntime(const char *name, size_t bytes)
{
return g_pSourcePawn2->CreateEmptyRuntime(name, bytes);
}
INativeInvoker *NativeInterface::CreateInvoker()
{
return new NativeInvoker();
}
bool NativeInvoker::Start(IPluginContext *pContext, const char *name)
{
NativeEntry *entry;
entry = g_ShareSys.FindNative(name);
if (entry == NULL)
{
return false;
}
native = NULL;
if (entry->replacement.owner != NULL)
{
native = entry->replacement.func;
}
else if (entry->owner != NULL)
{
native = entry->func;
}
if (native == NULL)
{
return false;
}
this->pContext = pContext;
m_curparam = 0;
m_errorstate = SP_ERROR_NONE;
return true;
}
cell_t NativeInvoker::PushCell(cell_t cell)
{
if (m_curparam >= SP_MAX_EXEC_PARAMS)
{
return SetError(SP_ERROR_PARAMS_MAX);
}
m_info[m_curparam].marked = false;
m_params[m_curparam] = cell;
m_curparam++;
return SP_ERROR_NONE;
}
int NativeInvoker::PushCellByRef(cell_t *cell, int flags)
{
return PushArray(cell, 1, flags);
}
int NativeInvoker::PushFloat(float number)
{
cell_t val = *(cell_t *)&number;
return PushCell(val);
}
int NativeInvoker::PushFloatByRef(float *number, int flags)
{
return PushCellByRef((cell_t *)number, flags);
}
int NativeInvoker::PushArray(cell_t *inarray, unsigned int cells, int copyback)
{
if (m_curparam >= SP_MAX_EXEC_PARAMS)
{
return SetError(SP_ERROR_PARAMS_MAX);
}
ParamInfo *info = &m_info[m_curparam];
info->flags = inarray ? copyback : 0;
info->marked = true;
info->size = cells;
info->str.is_sz = false;
info->orig_addr = inarray;
m_curparam++;
return SP_ERROR_NONE;
}
int NativeInvoker::PushString(const char *string)
{
return _PushString(string, SM_PARAM_STRING_COPY, 0, strlen(string)+1);
}
int NativeInvoker::PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags)
{
return _PushString(buffer, sz_flags, cp_flags, length);
}
int NativeInvoker::_PushString(const char *string, int sz_flags, int cp_flags, size_t len)
{
if (m_curparam >= SP_MAX_EXEC_PARAMS)
{
return SetError(SP_ERROR_PARAMS_MAX);
}
ParamInfo *info = &m_info[m_curparam];
info->marked = true;
info->orig_addr = (cell_t *)string;
info->flags = cp_flags;
info->size = len;
info->str.sz_flags = sz_flags;
info->str.is_sz = true;
m_curparam++;
return SP_ERROR_NONE;
}
void NativeInvoker::Cancel()
{
if (pContext == NULL)
{
return;
}
m_errorstate = SP_ERROR_NONE;
m_curparam = 0;
pContext = NULL;
native = NULL;
}
int NativeInvoker::SetError(int err)
{
m_errorstate = err;
return err;
}
int NativeInvoker::Invoke(cell_t *result)
{
int err = SP_ERROR_NONE;
if (pContext == NULL)
{
return SP_ERROR_INVALID_NATIVE;
}
if (m_errorstate != SP_ERROR_NONE)
{
err = m_errorstate;
Cancel();
return err;
}
cell_t tresult;
if (result == NULL)
{
result = &tresult;
}
//This is for re-entrancy!
IPluginContext *ctx = pContext;
cell_t _temp_params[SP_MAX_EXEC_PARAMS + 1];
cell_t *temp_params = &_temp_params[1];
ParamInfo temp_info[SP_MAX_EXEC_PARAMS];
unsigned int numparams = m_curparam;
unsigned int i;
bool docopies = true;
if (numparams)
{
//Save the info locally, then reset it for re-entrant calls.
memcpy(temp_info, m_info, numparams * sizeof(ParamInfo));
}
m_curparam = 0;
pContext = NULL;
/* Initialize 0th parameter */
_temp_params[0] = numparams;
/* Browse the parameters and build arrays */
for (i = 0; i < numparams; i++)
{
/* Is this marked as an array? */
if (temp_info[i].marked)
{
if (!temp_info[i].str.is_sz)
{
/* Allocate a normal/generic array */
if ((err = ctx->HeapAlloc(temp_info[i].size,
&temp_info[i].local_addr,
&temp_info[i].phys_addr))
!= SP_ERROR_NONE)
{
break;
}
if (temp_info[i].orig_addr)
{
memcpy(temp_info[i].phys_addr, temp_info[i].orig_addr, sizeof(cell_t) * temp_info[i].size);
}
}
else
{
/* Calculate cells required for the string */
size_t cells = (temp_info[i].size + sizeof(cell_t) - 1) / sizeof(cell_t);
/* Allocate the buffer */
if ((err = ctx->HeapAlloc(cells,
&temp_info[i].local_addr,
&temp_info[i].phys_addr))
!= SP_ERROR_NONE)
{
break;
}
/* Copy original string if necessary */
if ((temp_info[i].str.sz_flags & SM_PARAM_STRING_COPY) && (temp_info[i].orig_addr != NULL))
{
/* Cut off UTF-8 properly */
if (temp_info[i].str.sz_flags & SM_PARAM_STRING_UTF8)
{
if ((err = ctx->StringToLocalUTF8(temp_info[i].local_addr,
temp_info[i].size,
(const char *)temp_info[i].orig_addr,
NULL))
!= SP_ERROR_NONE)
{
break;
}
}
/* Copy a binary blob */
else if (temp_info[i].str.sz_flags & SM_PARAM_STRING_BINARY)
{
memmove(temp_info[i].phys_addr, temp_info[i].orig_addr, temp_info[i].size);
}
/* Copy ASCII characters */
else
{
if ((err = ctx->StringToLocal(temp_info[i].local_addr,
temp_info[i].size,
(const char *)temp_info[i].orig_addr))
!= SP_ERROR_NONE)
{
break;
}
}
}
} /* End array/string calculation */
/* Update the pushed parameter with the byref local address */
temp_params[i] = temp_info[i].local_addr;
}
else
{
/* Just copy the value normally */
temp_params[i] = m_params[i];
}
}
/* Make the call if we can */
if (err == SP_ERROR_NONE)
{
*result = native(ctx, _temp_params);
if (ctx->GetLastNativeError() != SP_ERROR_NONE)
{
docopies = false;
ctx->ClearLastNativeError();
}
}
else
{
docopies = false;
}
/* i should be equal to the last valid parameter + 1 */
while (i--)
{
if (!temp_info[i].marked)
{
continue;
}
if (docopies && (temp_info[i].flags & SM_PARAM_COPYBACK))
{
if (temp_info[i].orig_addr)
{
if (temp_info[i].str.is_sz)
{
memcpy(temp_info[i].orig_addr, temp_info[i].phys_addr, temp_info[i].size);
}
else
{
if (temp_info[i].size == 1)
{
*temp_info[i].orig_addr = *(temp_info[i].phys_addr);
}
else
{
memcpy(temp_info[i].orig_addr,
temp_info[i].phys_addr,
temp_info[i].size * sizeof(cell_t));
}
}
}
}
if ((err = ctx->HeapPop(temp_info[i].local_addr)) != SP_ERROR_NONE)
{
return err;
}
}
return err;
}
+98
View File
@@ -0,0 +1,98 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_NATIVE_INVOKER_H_
#define _INCLUDE_SOURCEMOD_NATIVE_INVOKER_H_
#include "sm_globals.h"
#include <INativeInvoker.h>
struct ParamInfo
{
int flags; /* Copy-back flags */
bool marked; /* Whether this is marked as being used */
cell_t local_addr; /* Local address to free */
cell_t *phys_addr; /* Physical address of our copy */
cell_t *orig_addr; /* Original address to copy back to */
ucell_t size; /* Size of array in bytes */
struct
{
bool is_sz; /* is a string */
int sz_flags; /* has sz flags */
} str;
};
class NativeInvoker : public INativeInvoker
{
public:
NativeInvoker();
~NativeInvoker();
public: /* ICallable */
int PushCell(cell_t cell);
int PushCellByRef(cell_t *cell, int flags=SM_PARAM_COPYBACK);
int PushFloat(float number);
int PushFloatByRef(float *number, int flags=SM_PARAM_COPYBACK);
int PushArray(cell_t *inarray, unsigned int cells, int flags=0);
int PushString(const char *string);
int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags);
void Cancel();
public: /* INativeInvoker */
bool Start(IPluginContext *pContext, const char *name);
int Invoke(cell_t *result);
private:
int _PushString(const char *string, int sz_flags, int cp_flags, size_t len);
int SetError(int err);
private:
IPluginContext *pContext;
SPVM_NATIVE_FUNC native;
cell_t m_params[SP_MAX_EXEC_PARAMS];
ParamInfo m_info[SP_MAX_EXEC_PARAMS];
unsigned int m_curparam;
int m_errorstate;
};
class NativeInterface :
public INativeInterface,
public SMGlobalClass
{
public: /* SMGlobalClass */
void OnSourceModAllInitialized();
public: /* SMInterface */
unsigned int GetInterfaceVersion();
const char *GetInterfaceName();
public: /* INativeInvoker */
IPluginRuntime *CreateRuntime(const char *name, size_t bytes);
INativeInvoker *CreateInvoker();
};
extern NativeInterface g_NInvoke;
#endif /* _INCLUDE_SOURCEMOD_NATIVE_INVOKER_H_ */
+144
View File
@@ -0,0 +1,144 @@
#include "NativeOwner.h"
#include "ShareSys.h"
#include "PluginSys.h"
CNativeOwner::CNativeOwner() : m_nMarkSerial(0)
{
}
void CNativeOwner::SetMarkSerial(unsigned int serial)
{
m_nMarkSerial = serial;
}
unsigned int CNativeOwner::GetMarkSerial()
{
return m_nMarkSerial;
}
void CNativeOwner::AddDependent(CPlugin *pPlugin)
{
m_Dependents.push_back(pPlugin);
}
void CNativeOwner::AddWeakRef(const WeakNative & ref)
{
m_WeakRefs.push_back(ref);
}
void CNativeOwner::AddNatives(const sp_nativeinfo_t *natives)
{
NativeEntry *pEntry;
for (unsigned int i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((pEntry = g_ShareSys.AddNativeToCache(this, &natives[i])) == NULL)
{
continue;
}
m_Natives.push_back(pEntry);
}
}
void CNativeOwner::PropogateMarkSerial(unsigned int serial)
{
CNativeOwner *pOwner;
List<CPlugin *>::iterator iter;
for (iter = m_Dependents.begin();
iter != m_Dependents.end();
iter++)
{
pOwner = (*iter);
pOwner->SetMarkSerial(serial);
}
}
void CNativeOwner::UnbindWeakRef(const WeakNative & ref)
{
sp_native_t *native;
IPluginContext *pContext;
pContext = ref.pl->GetBaseContext();
if ((pContext->GetNativeByIndex(ref.idx, &native)) == SP_ERROR_NONE)
{
/* If there is no reference, the native must be unbound */
if (ref.entry == NULL)
{
native->status = SP_NATIVE_UNBOUND;
native->pfn = NULL;
}
/* If we've cached a reference, it's a core native we can
* rebind back to its original (this was a replacement).
*/
else
{
native->pfn = ref.entry->func;
}
}
}
void CNativeOwner::DropEverything()
{
NativeEntry *pEntry;
List<WeakNative>::iterator iter;
List<NativeEntry *>::iterator ntv_iter;
/* Unbind and remove all weak references to us */
iter = m_WeakRefs.begin();
while (iter != m_WeakRefs.end())
{
UnbindWeakRef((*iter));
iter = m_WeakRefs.erase(iter);
}
/* Unmark our replacement natives */
ntv_iter = m_ReplacedNatives.begin();
while (ntv_iter != m_ReplacedNatives.end())
{
pEntry = (*ntv_iter);
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
ntv_iter = m_ReplacedNatives.erase(ntv_iter);
}
/* Strip all of our natives from the cache */
ntv_iter = m_Natives.begin();
while (ntv_iter != m_Natives.end())
{
g_ShareSys.ClearNativeFromCache(this, (*ntv_iter)->name);
ntv_iter = m_Natives.erase(ntv_iter);
}
}
void CNativeOwner::DropWeakRefsTo(CPlugin *pPlugin)
{
List<WeakNative>::iterator iter;
iter = m_WeakRefs.begin();
while (iter != m_WeakRefs.end())
{
WeakNative & ref = (*iter);
if (ref.pl == pPlugin)
{
iter = m_WeakRefs.erase(iter);
}
else
{
iter++;
}
}
}
void CNativeOwner::DropRefsTo(CPlugin *pPlugin)
{
m_Dependents.remove(pPlugin);
DropWeakRefsTo(pPlugin);
}
void CNativeOwner::AddReplacedNative(NativeEntry *pEntry)
{
m_ReplacedNatives.push_back(pEntry);
}
+59
View File
@@ -0,0 +1,59 @@
#ifndef _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
#define _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
#include <sp_vm_types.h>
#include <sh_list.h>
class CPlugin;
struct NativeEntry;
struct WeakNative
{
WeakNative(CPlugin *plugin, uint32_t index) :
pl(plugin), idx(index), entry(NULL)
{
pl = plugin;
idx = index;
}
WeakNative(CPlugin *plugin, uint32_t index, NativeEntry *pEntry) :
pl(plugin), idx(index), entry(pEntry)
{
pl = plugin;
idx = index;
}
CPlugin *pl;
uint32_t idx;
NativeEntry *entry;
};
using namespace SourceHook;
class CNativeOwner
{
public:
CNativeOwner();
public:
virtual void DropEverything();
public:
void AddNatives(const sp_nativeinfo_t *info);
public:
void SetMarkSerial(unsigned int serial);
unsigned int GetMarkSerial();
void PropogateMarkSerial(unsigned int serial);
public:
void AddDependent(CPlugin *pPlugin);
void AddWeakRef(const WeakNative & ref);
void DropRefsTo(CPlugin *pPlugin);
void AddReplacedNative(NativeEntry *pEntry);
private:
void DropWeakRefsTo(CPlugin *pPlugin);
void UnbindWeakRef(const WeakNative & ref);
protected:
List<CPlugin *> m_Dependents;
unsigned int m_nMarkSerial;
List<WeakNative> m_WeakRefs;
List<NativeEntry *> m_Natives;
List<NativeEntry *> m_ReplacedNatives;
};
#endif //_INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
+226
View File
@@ -0,0 +1,226 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "NextMap.h"
#include "Logger.h"
#include "sourcemm_api.h"
#include "sm_stringutil.h"
#include "sourcehook.h"
#include "sm_srvcmds.h"
NextMapManager g_NextMap;
#if SOURCE_ENGINE != SE_DARKMESSIAH
SH_DECL_HOOK2_void(IVEngineServer, ChangeLevel, SH_NOATTRIB, 0, const char *, const char *);
#else
SH_DECL_HOOK4_void(IVEngineServer, ChangeLevel, SH_NOATTRIB, 0, const char *, const char *, const char *, bool);
#endif
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
#else
# if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
ConCommand *changeLevelCmd = NULL;
ConVar sm_nextmap("sm_nextmap", "", FCVAR_NOTIFY);
bool g_forcedChange = false;
void NextMapManager::OnSourceModAllInitialized_Post()
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_ADD_HOOK(IVEngineServer, ChangeLevel, engine, SH_MEMBER(this, &NextMapManager::HookChangeLevel), false);
#else
SH_ADD_HOOK_MEMFUNC(IVEngineServer, ChangeLevel, engine, this, &NextMapManager::HookChangeLevel, false);
#endif
ConCommand *pCmd = FindCommand("changelevel");
if (pCmd != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, pCmd, CmdChangeLevelCallback, false);
changeLevelCmd = pCmd;
}
}
void NextMapManager::OnSourceModShutdown()
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_REMOVE_HOOK(IVEngineServer, ChangeLevel, engine, SH_MEMBER(this, &NextMapManager::HookChangeLevel), false);
#else
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, ChangeLevel, engine, this, &NextMapManager::HookChangeLevel, false);
#endif
if (changeLevelCmd != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, changeLevelCmd, CmdChangeLevelCallback, false);
}
SourceHook::List<MapChangeData *>::iterator iter;
iter = m_mapHistory.begin();
while (iter != m_mapHistory.end())
{
delete (MapChangeData *)*iter;
iter = m_mapHistory.erase(iter);
}
}
const char *NextMapManager::GetNextMap()
{
return sm_nextmap.GetString();
}
bool NextMapManager::SetNextMap(const char *map)
{
if (!engine->IsMapValid(map))
{
return false;
}
sm_nextmap.SetValue(map);
return true;
}
#if SOURCE_ENGINE != SE_DARKMESSIAH
void NextMapManager::HookChangeLevel(const char *map, const char *unknown)
#else
void NextMapManager::HookChangeLevel(const char *map, const char *unknown, const char *video, bool bLongLoading)
#endif
{
if (g_forcedChange)
{
g_Logger.LogMessage("[SM] Changed map to \"%s\"", map);
RETURN_META(MRES_IGNORED);
}
const char *newmap = sm_nextmap.GetString();
if (newmap[0] == 0 || !engine->IsMapValid(newmap))
{
RETURN_META(MRES_IGNORED);
}
g_Logger.LogMessage("[SM] Changed map to \"%s\"", newmap);
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), newmap);
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), "Normal level change");
#if SOURCE_ENGINE != SE_DARKMESSIAH
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::ChangeLevel, (newmap, unknown));
#else
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::ChangeLevel, (newmap, unknown, video, bLongLoading));
#endif
}
void NextMapManager::OnSourceModLevelChange( const char *mapName )
{
/* Skip the first 'mapchange' when the server starts up */
if (m_tempChangeInfo.startTime != 0)
{
if (strcmp(mapName, m_tempChangeInfo.m_mapName) == 0)
{
/* The map change was as we expected */
m_mapHistory.push_back(new MapChangeData(lastMap, m_tempChangeInfo.m_changeReason, m_tempChangeInfo.startTime));
}
else
{
/* Something intercepted the mapchange */
char newReason[255];
UTIL_Format(newReason, sizeof(newReason), "%s (Map overridden)", m_tempChangeInfo.m_changeReason);
m_mapHistory.push_back(new MapChangeData(lastMap, newReason, m_tempChangeInfo.startTime));
}
/* TODO: Should this be customizable? */
if (m_mapHistory.size() > 20)
{
SourceHook::List<MapChangeData *>::iterator iter;
iter = m_mapHistory.begin();
delete (MapChangeData *)*iter;
m_mapHistory.erase(iter);
}
}
m_tempChangeInfo.m_mapName[0] ='\0';
m_tempChangeInfo.m_changeReason[0] = '\0';
m_tempChangeInfo.startTime = time(NULL);
UTIL_Format(lastMap, sizeof(lastMap), mapName);
}
void NextMapManager::ForceChangeLevel( const char *mapName, const char* changeReason )
{
/* Store the mapname and reason */
UTIL_Format(m_tempChangeInfo.m_mapName, sizeof(m_tempChangeInfo.m_mapName), mapName);
UTIL_Format(m_tempChangeInfo.m_changeReason, sizeof(m_tempChangeInfo.m_changeReason), changeReason);
/* Change level and skip our hook */
g_forcedChange = true;
engine->ChangeLevel(mapName, NULL);
g_forcedChange = false;
}
NextMapManager::NextMapManager()
{
m_tempChangeInfo = MapChangeData();
m_mapHistory = SourceHook::List<MapChangeData *>();
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdChangeLevelCallback(const CCommand &command)
{
#else
void CmdChangeLevelCallback()
{
CCommand command;
#endif
if (command.ArgC() < 2)
{
return;
}
if (g_NextMap.m_tempChangeInfo.m_mapName[0] == '\0')
{
UTIL_Format(g_NextMap.m_tempChangeInfo.m_mapName, sizeof(g_NextMap.m_tempChangeInfo.m_mapName), command.Arg(1));
UTIL_Format(g_NextMap.m_tempChangeInfo.m_changeReason, sizeof(g_NextMap.m_tempChangeInfo.m_changeReason), "changelevel Command");
}
}
+103
View File
@@ -0,0 +1,103 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_NEXTMAP_H_
#define _INCLUDE_SOURCEMOD_NEXTMAP_H_
#include "sm_globals.h"
#include "eiface.h"
#include "sh_list.h"
#include "sm_stringutil.h"
struct MapChangeData
{
MapChangeData(const char *mapName, const char *changeReason, time_t time)
{
UTIL_Format(m_mapName, sizeof(m_mapName), mapName);
UTIL_Format(m_changeReason, sizeof(m_changeReason), changeReason);
startTime = time;
}
MapChangeData()
{
m_mapName[0] = '\0';
m_changeReason[0] = '\0';
startTime = 0;
}
char m_mapName[32];
char m_changeReason[100];
time_t startTime;
};
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdChangeLevelCallback(const CCommand &command);
#else
void CmdChangeLevelCallback();
#endif
class NextMapManager : public SMGlobalClass
{
public:
NextMapManager();
#if SOURCE_ENGINE >= SE_ORANGEBOX
friend void CmdChangeLevelCallback(const CCommand &command);
#else
friend void CmdChangeLevelCallback();
#endif
void OnSourceModAllInitialized_Post();
void OnSourceModShutdown();
void OnSourceModLevelChange(const char *mapName);
const char *GetNextMap();
bool SetNextMap(const char *map);
void ForceChangeLevel(const char *mapName, const char* changeReason);
#if SOURCE_ENGINE != SE_DARKMESSIAH
void HookChangeLevel(const char *map, const char *unknown);
#else
void HookChangeLevel(const char *map, const char *unknown, const char *video, bool bLongLoading);
#endif
public:
SourceHook::List<MapChangeData *> m_mapHistory;
private:
MapChangeData m_tempChangeInfo;
char lastMap[32];
};
extern NextMapManager g_NextMap;
#endif //_INCLUDE_SOURCEMOD_NEXTMAP_H_
+491 -108
View File
@@ -1,8 +1,8 @@
/**
* vim: set ts=4 :
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -39,19 +39,23 @@
#include "sm_stringutil.h"
#include "CoreConfig.h"
#include "TimerSys.h"
#include "Translator.h"
#include "Logger.h"
#include "ChatTriggers.h"
#include "HalfLife2.h"
#include <inetchannel.h>
#include <iclient.h>
#include "GameConfigs.h"
#include <IGameConfigs.h>
#include "ExtensionSys.h"
#include <sourcemod_version.h>
#include "ConsoleDetours.h"
#include "logic_bridge.h"
PlayerManager g_Players;
bool g_OnMapStarted = false;
IForward *PreAdminCheck = NULL;
IForward *PostAdminCheck = NULL;
IForward *PostAdminFilter = NULL;
const unsigned int *g_NumPlayersToAuth = NULL;
int lifestate_offset = -1;
List<ICommandTargetProcessor *> target_processors;
@@ -59,7 +63,7 @@ List<ICommandTargetProcessor *> target_processors;
SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t *, const char *, const char *, char *, int);
SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t *, const char *);
SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t *);
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
#else
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
@@ -67,6 +71,23 @@ SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *)
SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t *);
SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t *, int, int);
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_EXTERN1_void(ConCommand, Dispatch, SH_NOATTRIB, false, const CCommand &);
#elif SOURCE_ENGINE == SE_DARKMESSIAH
SH_DECL_EXTERN0_void(ConCommand, Dispatch, SH_NOATTRIB, false);
#else
# if SH_IMPL_VERSION >= 4
extern int __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# else
extern bool __SourceHook_FHAddConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
# endif
extern bool __SourceHook_FHRemoveConCommandDispatch(void *,bool,class fastdelegate::FastDelegate0<void>);
#endif
ConCommand *maxplayersCmd = NULL;
unsigned int g_PlayerSerialCount = 0;
class KickPlayerTimer : public ITimedEvent
{
public:
@@ -92,6 +113,9 @@ PlayerManager::PlayerManager()
m_FirstPass = false;
m_maxClients = 0;
m_SourceTVUserId = -1;
m_ReplayUserId = -1;
m_UserIdLookUp = new int[USHRT_MAX+1];
memset(m_UserIdLookUp, 0, sizeof(int) * (USHRT_MAX+1));
}
@@ -120,7 +144,8 @@ void PlayerManager::OnSourceModAllInitialized()
ParamType p1[] = {Param_Cell, Param_String, Param_Cell};
ParamType p2[] = {Param_Cell};
m_clconnect = g_Forwards.CreateForward("OnClientConnect", ET_Event, 3, p1);
m_clconnect = g_Forwards.CreateForward("OnClientConnect", ET_LowEvent, 3, p1);
m_clconnect_post = g_Forwards.CreateForward("OnClientConnected", ET_Ignore, 1, p2);
m_clputinserver = g_Forwards.CreateForward("OnClientPutInServer", ET_Ignore, 1, p2);
m_cldisconnect = g_Forwards.CreateForward("OnClientDisconnect", ET_Ignore, 1, p2);
m_cldisconnect_post = g_Forwards.CreateForward("OnClientDisconnect_Post", ET_Ignore, 1, p2);
@@ -133,11 +158,22 @@ void PlayerManager::OnSourceModAllInitialized()
PreAdminCheck = g_Forwards.CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1);
PostAdminCheck = g_Forwards.CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1);
PostAdminFilter = g_Forwards.CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1);
m_bIsListenServer = !engine->IsDedicatedServer();
m_ListenClient = 0;
ConCommand *pCmd = FindCommand("maxplayers");
if (pCmd != NULL)
{
SH_ADD_HOOK_STATICFUNC(ConCommand, Dispatch, pCmd, CmdMaxplayersCallback, true);
maxplayersCmd = pCmd;
}
}
void PlayerManager::OnSourceModShutdown()
{
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, serverClients, this, &PlayerManager::OnClientConnect, false);
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, serverClients, this, &PlayerManager::OnClientConnect_Post, true);
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, serverClients, this, &PlayerManager::OnClientPutInServer, true);
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, serverClients, this, &PlayerManager::OnClientDisconnect, false);
SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, serverClients, this, &PlayerManager::OnClientDisconnect_Post, true);
@@ -147,6 +183,7 @@ void PlayerManager::OnSourceModShutdown()
/* Release forwards */
g_Forwards.ReleaseForward(m_clconnect);
g_Forwards.ReleaseForward(m_clconnect_post);
g_Forwards.ReleaseForward(m_clputinserver);
g_Forwards.ReleaseForward(m_cldisconnect);
g_Forwards.ReleaseForward(m_cldisconnect_post);
@@ -161,6 +198,11 @@ void PlayerManager::OnSourceModShutdown()
g_Forwards.ReleaseForward(PostAdminFilter);
delete [] m_Players;
if (maxplayersCmd != NULL)
{
SH_REMOVE_HOOK_STATICFUNC(ConCommand, Dispatch, maxplayersCmd, CmdMaxplayersCallback, true);
}
}
ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
@@ -193,19 +235,41 @@ ConfigResult PlayerManager::OnSourceModConfigChanged(const char *key,
void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
{
static ConVar *tv_enable = icvar->FindVar("tv_enable");
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
static ConVar *replay_enable = icvar->FindVar("replay_enable");
#endif
// clientMax will not necessarily be correct here (such as on late SourceTV enable)
m_maxClients = gpGlobals->maxClients;
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());
#endif
m_PlayersSinceActive = 0;
if (!m_FirstPass)
{
/* Initialize all players */
m_maxClients = clientMax;
m_PlayerCount = 0;
m_Players = new CPlayer[m_maxClients + 1];
m_AuthQueue = new unsigned int[m_maxClients + 1];
m_Players = new CPlayer[ABSOLUTE_PLAYER_LIMIT + 1];
m_AuthQueue = new unsigned int[ABSOLUTE_PLAYER_LIMIT + 1];
m_FirstPass = true;
memset(m_AuthQueue, 0, sizeof(unsigned int) * (m_maxClients + 1));
memset(m_AuthQueue, 0, sizeof(unsigned int) * (ABSOLUTE_PLAYER_LIMIT + 1));
g_NumPlayersToAuth = &m_AuthQueue[0];
}
g_PluginSys.SyncMaxClients(m_maxClients);
g_OnMapStarted = true;
g_Extensions.CallOnCoreMapStart(pEdictList, edictCount, m_maxClients);
m_onActivate->Execute(NULL);
m_onActivate2->Execute(NULL);
@@ -214,11 +278,16 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl
{
if ((*iter)->GetClientListenerVersion() >= 5)
{
(*iter)->OnServerActivated(clientMax);
(*iter)->OnServerActivated(m_maxClients);
}
}
g_OnMapStarted = true;
SMGlobalClass *cls = SMGlobalClass::head;
while (cls)
{
cls->OnSourceModLevelActivated();
cls = cls->m_pGlobalClassNext;
}
SM_ExecuteAllConfigs();
}
@@ -283,7 +352,7 @@ void PlayerManager::RunAuthChecks()
unsigned int removed = 0;
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
pPlayer = GetPlayerByIndex(m_AuthQueue[i]);
pPlayer = &m_Players[m_AuthQueue[i]];
authstr = engine->GetPlayerNetworkIDString(pPlayer->m_pEdict);
if (authstr && authstr[0] != '\0'
&& (strcmp(authstr, "STEAM_ID_PENDING") != 0))
@@ -356,8 +425,25 @@ void PlayerManager::RunAuthChecks()
bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
++m_PlayersSinceActive;
pPlayer->Initialize(pszName, pszAddress, pEntity);
/* Get the client's language */
if (m_QueryLang)
{
const char *name;
if (!pPlayer->IsFakeClient() && (name=engine->GetClientConVarValue(client, "cl_language")))
{
unsigned int langid;
pPlayer->m_LangId = (translator->GetLanguageByName(name, &langid)) ? langid : translator->GetServerLanguage();
} else {
pPlayer->m_LangId = translator->GetServerLanguage();
}
}
List<IClientListener *>::iterator iter;
IClientListener *pListener = NULL;
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
@@ -365,38 +451,42 @@ 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);
}
}
cell_t res = 1;
m_Players[client].Initialize(pszName, pszAddress, pEntity);
m_clconnect->PushCell(client);
m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8, SM_PARAM_COPYBACK);
m_clconnect->PushStringEx(reject, maxrejectlen, SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK);
m_clconnect->PushCell(maxrejectlen);
m_clconnect->Execute(&res, NULL);
m_clconnect->Execute(&res);
if (res)
{
if (!m_Players[client].IsAuthorized())
if (!pPlayer->IsAuthorized())
{
m_AuthQueue[++m_AuthQueue[0]] = client;
}
} else {
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = client;
}
else
{
if (!pPlayer->IsFakeClient())
{
RETURN_META_VALUE(MRES_SUPERCEDE, false);
}
}
return true;
}
bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
{
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
bool orig_value = META_RESULT_ORIG_RET(bool);
CPlayer *pPlayer = GetPlayerByIndex(client);
CPlayer *pPlayer = &m_Players[client];
if (orig_value)
{
@@ -408,9 +498,24 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
pListener->OnClientConnected(client);
if (!pPlayer->IsConnected())
{
break;
return true;
}
}
if (!pPlayer->IsFakeClient()
&& m_bIsListenServer
&& strncmp(pszAddress, "127.0.0.1", 9) == 0)
{
m_ListenClient = client;
}
cell_t res;
m_clconnect_post->PushCell(client);
m_clconnect_post->Execute(&res, NULL);
}
else
{
InvalidatePlayer(pPlayer);
}
return true;
@@ -419,9 +524,9 @@ bool PlayerManager::OnClientConnect_Post(edict_t *pEntity, const char *pszName,
void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
CPlayer *pPlayer = GetPlayerByIndex(client);
/* If they're not connected, they're a bot */
if (!pPlayer->IsConnected())
{
@@ -429,6 +534,41 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
char error[255];
const char *authid = engine->GetPlayerNetworkIDString(pEntity);
pPlayer->Authorize(authid);
pPlayer->m_bFakeClient = true;
/*
* While we're already filtered to just bots, we'll do other checks to
* make sure that the requisite services are enabled and that the bots
* have joined at the expected time.
*
* Checking playerinfo's IsHLTV and IsReplay would be better and less
* error-prone but will always show false until later in the frame,
* after PutInServer and Activate, and we want it now!
*/
// This doesn't actually get incremented until OnClientConnect. Fake it to check.
int newCount = m_PlayersSinceActive + 1;
int userId = engine->GetPlayerUserId(pEntity);
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE
if (m_bIsReplayActive && newCount == 1
&& (m_ReplayUserId == userId || strcmp(playername, "Replay") == 0))
{
pPlayer->m_bIsReplay = true;
m_ReplayUserId = userId;
}
#endif
if (m_bIsSourceTVActive
&& ((!m_bIsReplayActive && newCount == 1)
|| (m_bIsReplayActive && newCount == 2))
&& (m_SourceTVUserId == userId || strcmp(playername, "SourceTV") == 0)
)
{
pPlayer->m_bIsSourceTV = true;
m_SourceTVUserId = userId;
}
if (!OnClientConnect(pEntity, playername, "127.0.0.1", error, sizeof(error)))
{
/* :TODO: kick the bot if it's rejected */
@@ -446,6 +586,11 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
return;
}
}
cell_t res;
m_clconnect_post->PushCell(client);
m_clconnect_post->Execute(&res, NULL);
/* Now do authorization */
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
@@ -467,20 +612,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
pPlayer->m_Info = playerinfo->GetPlayerInfo(pEntity);
}
/* Get the client's language */
if (m_QueryLang)
{
const char *name;
if (!pPlayer->IsFakeClient() && (name=engine->GetClientConVarValue(client, "cl_language")))
{
unsigned int langid;
pPlayer->m_LangId = (g_Translator.GetLanguageByName(name, &langid)) ? langid : g_Translator.GetServerLanguage();
} else {
pPlayer->m_LangId = g_Translator.GetServerLanguage();
}
}
m_Players[client].Connect();
pPlayer->Connect();
m_PlayerCount++;
List<IClientListener *>::iterator iter;
@@ -494,9 +626,9 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
m_clputinserver->PushCell(client);
m_clputinserver->Execute(&res, NULL);
if (m_Players[client].IsAuthorized())
if (pPlayer->IsAuthorized())
{
m_Players[client].DoPostConnectAuthorization();
pPlayer->DoPostConnectAuthorization();
}
}
@@ -516,18 +648,21 @@ void PlayerManager::OnSourceModLevelEnd()
void PlayerManager::OnClientDisconnect(edict_t *pEntity)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (m_Players[client].IsConnected())
if (pPlayer->IsConnected())
{
m_cldisconnect->PushCell(client);
m_cldisconnect->Execute(&res, NULL);
} else {
}
else
{
/* We don't care, prevent a double call */
return;
}
if (m_Players[client].WasCountedAsInGame())
if (pPlayer->WasCountedAsInGame())
{
m_PlayerCount--;
}
@@ -540,35 +675,18 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
pListener->OnClientDisconnecting(client);
}
/**
* Remove client from auth queue if necessary
*/
if (!m_Players[client].IsAuthorized())
{
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
if (m_AuthQueue[i] == (unsigned)client)
{
/* Move everything ahead of us back by one */
for (unsigned int j=i+1; j<=m_AuthQueue[0]; j++)
{
m_AuthQueue[j-1] = m_AuthQueue[j];
}
/* Remove us and break */
m_AuthQueue[0]--;
break;
}
}
}
InvalidatePlayer(pPlayer);
m_Players[client].Disconnect();
m_UserIdLookUp[engine->GetPlayerUserId(pEntity)] = 0;
if (m_ListenClient == client)
{
m_ListenClient = 0;
}
}
void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
m_cldisconnect_post->PushCell(client);
m_cldisconnect_post->Execute(&res, NULL);
@@ -582,7 +700,28 @@ void PlayerManager::OnClientDisconnect_Post(edict_t *pEntity)
}
}
#if defined ORANGEBOX_BUILD
void ClientConsolePrint(edict_t *e, const char *fmt, ...)
{
char buffer[512];
va_list ap;
va_start(ap, fmt);
size_t len = vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
if (len >= sizeof(buffer) - 1)
{
buffer[sizeof(buffer) - 2] = '\n';
buffer[sizeof(buffer) - 1] = '\0';
} else {
buffer[len++] = '\n';
buffer[len] = '\0';
}
engine->ClientPrintf(e, buffer);
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void PlayerManager::OnClientCommand(edict_t *pEntity, const CCommand &args)
{
#else
@@ -590,15 +729,53 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
{
CCommand args;
#endif
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
cell_t res = Pl_Continue;
CPlayer *pPlayer = &m_Players[client];
CPlayer *pPlayer = GetPlayerByIndex(client);
if (!pPlayer || !pPlayer->IsConnected())
if (!pPlayer->IsConnected())
{
return;
}
if (strcmp(args.Arg(0), "sm") == 0)
{
if (args.ArgC() > 1 && strcmp(args.Arg(1), "plugins") == 0)
{
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,
"SourceMod would not be possible without:");
ClientConsolePrint(pEntity,
" David \"BAILOPAN\" Anderson, Borja \"faluco\" Ferrer");
ClientConsolePrint(pEntity,
" Scott \"DS\" Ehlert, Matt \"pRED\" Woodrow");
ClientConsolePrint(pEntity,
" Michael \"ferret\" McKoy, Pavol \"PM OnoTo\" Marko");
ClientConsolePrint(pEntity,
"SourceMod is open source under the GNU General Public License.");
RETURN_META(MRES_SUPERCEDE);
}
ClientConsolePrint(pEntity,
"SourceMod %s, by AlliedModders LLC", SM_FULL_VERSION);
ClientConsolePrint(pEntity,
"To see running plugins, type \"sm plugins\"");
ClientConsolePrint(pEntity,
"To see credits, type \"sm credits\"");
ClientConsolePrint(pEntity,
"Visit http://www.sourcemod.net/");
RETURN_META(MRES_SUPERCEDE);
}
g_HL2.PushCommandStack(&args);
int argcount = args.ArgC() - 1;
@@ -616,10 +793,27 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
}
}
if (g_ConsoleDetours.IsEnabled())
{
cell_t res2 = g_ConsoleDetours.InternalDispatch(client, args);
if (res2 >= Pl_Stop)
{
g_HL2.PopCommandStack();
RETURN_META(MRES_SUPERCEDE);
}
else if (res2 > res)
{
res = res2;
}
}
cell_t res2 = Pl_Continue;
m_clcommand->PushCell(client);
m_clcommand->PushCell(argcount);
m_clcommand->Execute(&res2, NULL);
if (pPlayer->IsInGame())
{
m_clcommand->PushCell(client);
m_clcommand->PushCell(argcount);
m_clcommand->Execute(&res2, NULL);
}
if (res2 > res)
{
@@ -645,55 +839,86 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
void PlayerManager::OnClientSettingsChanged(edict_t *pEntity)
{
cell_t res;
int client = engine->IndexOfEdict(pEntity);
int client = IndexOfEdict(pEntity);
CPlayer *pPlayer = &m_Players[client];
if (!m_Players[client].IsConnected())
if (!pPlayer->IsConnected())
{
return;
}
m_clinfochanged->PushCell(engine->IndexOfEdict(pEntity));
m_clinfochanged->PushCell(client);
m_clinfochanged->Execute(&res, NULL);
IPlayerInfo *info = m_Players[client].GetPlayerInfo();
if (pPlayer->IsFakeClient())
{
return;
}
IPlayerInfo *info = pPlayer->GetPlayerInfo();
const char *new_name = info ? info->GetName() : engine->GetClientConVarValue(client, "name");
const char *old_name = m_Players[client].m_Name.c_str();
const char *old_name = pPlayer->m_Name.c_str();
#if 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);
if (id != INVALID_ADMIN_ID && m_Players[client].GetAdminId() != id)
if (id != INVALID_ADMIN_ID && pPlayer->GetAdminId() != id)
{
if (!CheckSetAdminName(client, &m_Players[client], id))
if (!CheckSetAdminName(client, pPlayer, id))
{
m_Players[client].Kick("Your name is reserved by SourceMod; set your password to use it.");
pPlayer->Kick("Your name is reserved by SourceMod; set your password to use it.");
RETURN_META(MRES_IGNORED);
}
} else if ((id = g_Admins.FindAdminByIdentity("name", old_name)) != INVALID_ADMIN_ID) {
if (id == m_Players[client].GetAdminId())
if (id == pPlayer->GetAdminId())
{
/* This player is changing their name; force them to drop admin privileges! */
m_Players[client].SetAdminId(INVALID_ADMIN_ID, false);
pPlayer->SetAdminId(INVALID_ADMIN_ID, false);
}
}
m_Players[client].SetName(new_name);
pPlayer->SetName(new_name);
}
if (m_PassInfoVar.size() > 0)
{
/* Try for a password change */
const char *old_pass = m_Players[client].m_LastPassword.c_str();
const char *old_pass = pPlayer->m_LastPassword.c_str();
const char *new_pass = engine->GetClientConVarValue(client, m_PassInfoVar.c_str());
if (strcmp(old_pass, new_pass) != 0)
{
m_Players[client].m_LastPassword.assign(new_pass);
if (m_Players[client].IsInGame() && m_Players[client].IsAuthorized())
pPlayer->m_LastPassword.assign(new_pass);
if (pPlayer->IsInGame() && pPlayer->IsAuthorized())
{
/* If there is already an admin id assigned, this will just bail out. */
m_Players[client].DoBasicAdminChecks();
pPlayer->DoBasicAdminChecks();
}
}
}
/* Notify Extensions */
List<IClientListener *>::iterator iter;
IClientListener *pListener = NULL;
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
pListener = (*iter);
if (pListener->GetClientListenerVersion() >= 13)
{
pListener->OnClientSettingsChanged(client);
}
}
}
int PlayerManager::GetMaxClients()
@@ -772,7 +997,7 @@ void PlayerManager::RemoveClientListener(IClientListener *listener)
IGamePlayer *PlayerManager::GetGamePlayer(edict_t *pEdict)
{
int index = engine->IndexOfEdict(pEdict);
int index = IndexOfEdict(pEdict);
return GetGamePlayer(index);
}
@@ -841,6 +1066,33 @@ void PlayerManager::UnregisterCommandTargetProcessor(ICommandTargetProcessor *pH
target_processors.remove(pHandler);
}
void PlayerManager::InvalidatePlayer(CPlayer *pPlayer)
{
/**
* Remove client from auth queue if necessary
*/
if (!pPlayer->IsAuthorized())
{
for (unsigned int i=1; i<=m_AuthQueue[0]; i++)
{
if (m_AuthQueue[i] == (unsigned)pPlayer->m_iIndex)
{
/* Move everything ahead of us back by one */
for (unsigned int j=i+1; j<=m_AuthQueue[0]; j++)
{
m_AuthQueue[j-1] = m_AuthQueue[j];
}
/* Remove us and break */
m_AuthQueue[0]--;
break;
}
}
}
m_UserIdLookUp[engine->GetPlayerUserId(pPlayer->m_pEdict)] = 0;
pPlayer->Disconnect();
}
int PlayerManager::InternalFilterCommandTarget(CPlayer *pAdmin, CPlayer *pTarget, int flags)
{
if ((flags & COMMAND_FILTER_CONNECTED) == COMMAND_FILTER_CONNECTED
@@ -1011,10 +1263,18 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
if (strcmp(info->pattern, "@me") == 0 && info->admin != 0)
{
info->targets[0] = info->admin;
info->num_targets = 1;
strncopy(info->target_name, pAdmin->GetName(), info->target_name_maxlength);
info->target_name_style = COMMAND_TARGETNAME_RAW;
info->reason = FilterCommandTarget(pAdmin, pAdmin, info->flags);
if (info->reason == COMMAND_TARGET_VALID)
{
info->targets[0] = info->admin;
info->num_targets = 1;
strncopy(info->target_name, pAdmin->GetName(), info->target_name_maxlength);
info->target_name_style = COMMAND_TARGETNAME_RAW;
}
else
{
info->num_targets = 0;
}
return;
}
@@ -1128,7 +1388,7 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
continue;
}
if (stristr(pTarget->GetName(), info->pattern) != NULL)
if (logicore.stristr(pTarget->GetName(), info->pattern) != NULL)
{
if (found_client)
{
@@ -1166,6 +1426,83 @@ void PlayerManager::ProcessCommandTarget(cmd_target_info_t *info)
}
}
void PlayerManager::OnSourceModMaxPlayersChanged( int newvalue )
{
m_maxClients = newvalue;
}
void PlayerManager::MaxPlayersChanged( int newvalue /*= -1*/ )
{
if (!m_FirstPass)
{
return;
}
if (newvalue == -1)
{
newvalue = gpGlobals->maxClients;
}
if (newvalue == MaxClients())
{
return;
}
/* Notify the rest of core */
SMGlobalClass *pBase = SMGlobalClass::head;
while (pBase)
{
pBase->OnSourceModMaxPlayersChanged(newvalue);
pBase = pBase->m_pGlobalClassNext;
}
/* Notify Extensions */
List<IClientListener *>::iterator iter;
IClientListener *pListener = NULL;
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
pListener = (*iter);
if (pListener->GetClientListenerVersion() >= 8)
{
pListener->OnMaxPlayersChanged(newvalue);
}
}
}
int PlayerManager::GetClientFromSerial(unsigned int serial)
{
serial_t s;
s.value = serial;
int client = s.bits.index;
IGamePlayer *pPlayer = GetGamePlayer(client);
if (!pPlayer)
{
return 0;
}
if (serial == pPlayer->GetSerial())
{
return client;
}
return 0;
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdMaxplayersCallback(const CCommand &command)
{
#else
void CmdMaxplayersCallback()
{
#endif
g_Players.MaxPlayersChanged();
}
/*******************
*** PLAYER CODE ***
*******************/
@@ -1180,9 +1517,14 @@ CPlayer::CPlayer()
m_TempAdmin = false;
m_Info = NULL;
m_bAdminCheckSignalled = false;
m_UserId = -1;
m_bIsInKickQueue = false;
m_LastPassword.clear();
m_LangId = LANGUAGE_ENGLISH;
m_LangId = SOURCEMOD_LANGUAGE_ENGLISH;
m_bFakeClient = false;
m_bIsSourceTV = false;
m_bIsReplay = false;
m_Serial.value = -1;
}
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
@@ -1191,8 +1533,11 @@ void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
m_Name.assign(name);
m_Ip.assign(ip);
m_pEdict = pEntity;
m_iIndex = engine->IndexOfEdict(pEntity);
m_LangId = g_Translator.GetServerLanguage();
m_iIndex = IndexOfEdict(pEntity);
m_LangId = translator->GetServerLanguage();
m_Serial.bits.index = m_iIndex;
m_Serial.bits.serial = g_PlayerSerialCount++;
char ip2[24], *ptr;
strncopy(ip2, ip, sizeof(ip2));
@@ -1213,7 +1558,7 @@ void CPlayer::Connect()
m_IsInGame = true;
const char *var = g_Players.GetPassInfoVar();
int client = engine->IndexOfEdict(m_pEdict);
int client = IndexOfEdict(m_pEdict);
if (var[0] != '\0')
{
const char *pass = engine->GetClientConVarValue(client, var);
@@ -1250,6 +1595,10 @@ void CPlayer::Disconnect()
m_bAdminCheckSignalled = false;
m_UserId = -1;
m_bIsInKickQueue = false;
m_bFakeClient = false;
m_bIsSourceTV = false;
m_bIsReplay = false;
m_Serial.value = -1;
}
void CPlayer::SetName(const char *name)
@@ -1314,7 +1663,17 @@ IPlayerInfo *CPlayer::GetPlayerInfo()
bool CPlayer::IsFakeClient()
{
return (strcmp(m_AuthID.c_str(), "BOT") == 0);
return m_bFakeClient;
}
bool CPlayer::IsSourceTV() const
{
return m_bIsSourceTV;
}
bool CPlayer::IsReplay() const
{
return m_bIsReplay;
}
void CPlayer::SetAdminId(AdminId id, bool temporary)
@@ -1352,8 +1711,22 @@ void CPlayer::Kick(const char *str)
{
MarkAsBeingKicked();
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(m_iIndex));
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
pClient->Disconnect("%s", str);
if (pNetChan == NULL)
{
/* What does this even mean? Hell if I know. */
int userid = GetUserId();
if (userid > 0)
{
char buffer[255];
UTIL_Format(buffer, sizeof(buffer), "kickid %d %s\n", userid, str);
engine->ServerCommand(buffer);
}
}
else
{
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
pClient->Disconnect("%s", str);
}
}
void CPlayer::Authorize_Post()
@@ -1459,7 +1832,7 @@ void CPlayer::DoBasicAdminChecks()
/* First check the name */
AdminId id;
int client = engine->IndexOfEdict(m_pEdict);
int client = IndexOfEdict(m_pEdict);
if ((id = g_Admins.FindAdminByIdentity("name", GetName())) != INVALID_ADMIN_ID)
{
@@ -1480,7 +1853,7 @@ void CPlayer::DoBasicAdminChecks()
}
}
/* Check IP address */
/* Check steam id */
if ((id = g_Admins.FindAdminByIdentity("steam", m_AuthID.c_str())) != INVALID_ADMIN_ID)
{
if (g_Players.CheckSetAdmin(client, this, id))
@@ -1495,6 +1868,11 @@ unsigned int CPlayer::GetLanguageId()
return m_LangId;
}
void CPlayer::SetLanguageId(unsigned int id)
{
m_LangId = id;
}
int CPlayer::GetUserId()
{
if (m_UserId == -1)
@@ -1556,3 +1934,8 @@ int CPlayer::GetLifeState()
return PLAYER_LIFE_DEAD;
}
}
unsigned int CPlayer::GetSerial()
{
return m_Serial.value;
}
+46 -3
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -41,6 +41,7 @@
#include <sh_string.h>
#include <sh_list.h>
#include <sh_vector.h>
#include "ConVarManager.h"
using namespace SourceHook;
@@ -50,6 +51,16 @@ using namespace SourceHook;
#define MIN_API_FOR_ADMINCALLS 7
union serial_t
{
uint32_t value;
struct
{
uint32_t index : 8;
uint32_t serial : 24;
} bits;
};
class CPlayer : public IGamePlayer
{
friend class PlayerManager;
@@ -65,17 +76,21 @@ public:
bool IsConnected();
bool IsAuthorized();
bool IsFakeClient();
bool IsSourceTV() const;
bool IsReplay() const;
void SetAdminId(AdminId id, bool temporary);
AdminId GetAdminId();
void Kick(const char *str);
bool IsInKickQueue();
IPlayerInfo *GetPlayerInfo();
unsigned int GetLanguageId();
void SetLanguageId(unsigned int id);
int GetUserId();
bool RunAdminCacheChecks();
void NotifyPostAdminChecks();
unsigned int GetSerial();
public:
void DoBasicAdminChecks();
bool IsInKickQueue();
void MarkAsBeingKicked();
int GetLifeState();
private:
@@ -105,6 +120,10 @@ private:
int m_iIndex;
unsigned int m_LangId;
int m_UserId;
bool m_bFakeClient;
bool m_bIsSourceTV;
bool m_bIsReplay;
serial_t m_Serial;
};
class PlayerManager :
@@ -120,6 +139,7 @@ public: //SMGlobalClass
void OnSourceModShutdown();
void OnSourceModLevelEnd();
ConfigResult OnSourceModConfigChanged(const char *key, const char *value, ConfigSource source, char *error, size_t maxlength);
void OnSourceModMaxPlayersChanged(int newvalue);
public:
CPlayer *GetPlayerByIndex(int client) const;
void RunAuthChecks();
@@ -131,7 +151,7 @@ public:
void OnClientPutInServer(edict_t *pEntity, char const *playername);
void OnClientDisconnect(edict_t *pEntity);
void OnClientDisconnect_Post(edict_t *pEntity);
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
void OnClientCommand(edict_t *pEntity, const CCommand &args);
#else
void OnClientCommand(edict_t *pEntity);
@@ -152,6 +172,7 @@ public: //IPlayerManager
void RegisterCommandTargetProcessor(ICommandTargetProcessor *pHandler);
void UnregisterCommandTargetProcessor(ICommandTargetProcessor *pHandler);
void ProcessCommandTarget(cmd_target_info_t *info);
int GetClientFromSerial(unsigned int serial);
public:
inline int MaxClients()
{
@@ -161,17 +182,24 @@ public:
{
return m_PlayerCount;
}
inline int ListenClient()
{
return m_ListenClient;
}
bool CheckSetAdmin(int index, CPlayer *pPlayer, AdminId id);
bool CheckSetAdminName(int index, CPlayer *pPlayer, AdminId id);
const char *GetPassInfoVar();
void RecheckAnyAdmins();
unsigned int GetReplyTo();
unsigned int SetReplyTo(unsigned int reply);
void MaxPlayersChanged(int newvalue = -1);
private:
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
void InvalidatePlayer(CPlayer *pPlayer);
private:
List<IClientListener *> m_hooks;
IForward *m_clconnect;
IForward *m_clconnect_post;
IForward *m_cldisconnect;
IForward *m_cldisconnect_post;
IForward *m_clputinserver;
@@ -184,12 +212,27 @@ private:
int *m_UserIdLookUp;
int m_maxClients;
int m_PlayerCount;
int m_PlayersSinceActive;
bool m_FirstPass;
unsigned int *m_AuthQueue;
String m_PassInfoVar;
bool m_QueryLang;
bool m_bIsListenServer;
int m_ListenClient;
bool m_bIsSourceTVActive;
bool m_bIsReplayActive;
int m_SourceTVUserId;
int m_ReplayUserId;
};
#if SOURCE_ENGINE >= SE_ORANGEBOX
void CmdMaxplayersCallback(const CCommand &command);
#else
void CmdMaxplayersCallback();
#endif
extern void ClientConsolePrint(edict_t *e, const char *fmt, ...);
extern PlayerManager g_Players;
extern bool g_OnMapStarted;
extern const unsigned int *g_NumPlayersToAuth;
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -276,7 +276,7 @@ SMCResult CPluginInfoDatabase::ReadSMC_LeavingSection(const SMCStates *states)
{
m_infodb_size *= 2;
}
int newidx = memtab->CreateMem(m_infodb_size, (void **)&table);
int newidx = memtab->CreateMem(m_infodb_size * sizeof(int), (void **)&table);
if (m_infodb != -1)
{
void *oldtable = (int *)memtab->GetAddress(m_infodb);
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
File diff suppressed because it is too large Load Diff
+53 -93
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -43,16 +43,25 @@
#include <sh_vector.h>
#include <sh_string.h>
#include "sm_globals.h"
#include "vm/sp_vm_basecontext.h"
#include "PluginInfoDatabase.h"
#include "sm_trie.h"
#include "sourcemod.h"
#include <IRootConsoleMenu.h>
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE == SE_ALIENSWARM
#include "convar_sm_swarm.h"
#elif (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2)
#include "convar_sm_l4d.h"
#elif (SOURCE_ENGINE == SE_ORANGEBOX) || (SOURCE_ENGINE == SE_BLOODYGOODTIME) || (SOURCE_ENGINE == SE_EYE) || (SOURCE_ENGINE == SE_ORANGEBOXVALVE)
#include "convar_sm_ob.h"
#else
#include "convar_sm.h"
#endif
#include "ITranslator.h"
#include "IGameConfigs.h"
#include "NativeOwner.h"
#include "ShareSys.h"
class CPlayer;
using namespace SourceHook;
@@ -106,35 +115,22 @@ using namespace SourceHook;
* 7. Once all plugins are deemed to be loaded, OnPluginStart() is called
*/
#define SM_CONTEXTVAR_MYSELF 0
struct ContextPair
{
ContextPair() : base(NULL), ctx(NULL), co(NULL)
{
};
BaseContext *base;
sp_context_t *ctx;
ICompilation *co;
IVirtualMachine *vm;
};
struct FakeNative
{
IPluginContext *ctx;
IPluginFunction *call;
String name;
SPVM_NATIVE_FUNC func;
};
enum LoadRes
{
LoadRes_Successful,
LoadRes_AlreadyLoaded,
LoadRes_Failure,
LoadRes_SilentFailure,
LoadRes_NeverLoad
};
enum APLRes
{
APLRes_Success,
APLRes_Failure,
APLRes_SilentFailure
};
struct AutoConfig
{
String autocfg;
@@ -143,18 +139,10 @@ struct AutoConfig
};
class CPlugin;
struct WeakNative
{
WeakNative(CPlugin *plugin, uint32_t index)
{
pl = plugin;
idx = index;
}
CPlugin *pl;
uint32_t idx;
};
class CPlugin : public IPlugin
class CPlugin :
public IPlugin,
public CNativeOwner
{
friend class CPluginManager;
friend class CFunction;
@@ -165,17 +153,21 @@ public:
PluginType GetType();
SourcePawn::IPluginContext *GetBaseContext();
sp_context_t *GetContext();
const sm_plugininfo_t *GetPublicInfo();
void *GetPluginStructure();
const char *GetFilename();
bool IsDebugging();
PluginStatus GetStatus();
bool IsSilentlyFailed();
void SetSilentlyFailed(bool sf);
const sm_plugininfo_t *GetPublicInfo();
bool SetPauseState(bool paused);
unsigned int GetSerial();
const sp_plugin_t *GetPluginStructure();
IdentityToken_t *GetIdentity();
unsigned int CalcMemUsage();
bool SetProperty(const char *prop, void *ptr);
bool GetProperty(const char *prop, void **ptr, bool remove=false);
void DropEverything();
SourcePawn::IPluginRuntime *GetRuntime();
public:
/**
* Creates a plugin object with default values.
@@ -186,16 +178,6 @@ public:
*/
static CPlugin *CreatePlugin(const char *file, char *error, size_t maxlength);
public:
/**
* Starts the initial compilation of a plugin.
* Returns false if another compilation exists or there is a current context set.
*/
ICompilation *StartMyCompile(IVirtualMachine *vm);
/**
* Finalizes a compilation. If error buffer is NULL, the error is saved locally.
*/
bool FinishMyCompile(char *error, size_t maxlength);
void CancelMyCompile();
/**
* Sets an error state on the plugin
@@ -214,7 +196,7 @@ public:
*
* If the error buffer is NULL, the error message is cached locally.
*/
bool Call_AskPluginLoad(char *error, size_t maxlength);
APLRes Call_AskPluginLoad(char *error, size_t maxlength);
/**
* Calls the OnPluginStart function.
@@ -233,30 +215,15 @@ public:
*/
void Call_OnAllPluginsLoaded();
/**
* Toggles debug mode in the plugin
*/
bool ToggleDebugMode(bool debug, char *error, size_t maxlength);
/**
* Returns true if a plugin is usable.
*/
bool IsRunnable();
/**
* Adds a language file index to the plugin's list.
* Get languages info.
*/
void AddLangFile(unsigned int index);
/**
* Get language file count for this plugin.
*/
size_t GetLangFileCount();
/**
* Get language file index based on the vector index.
*/
unsigned int GetLangFileByIndex(unsigned int index);
IPhraseCollection *GetPhrases();
public:
/**
* Returns the modification time during last plugin load.
@@ -275,6 +242,7 @@ public:
Handle_t GetMyHandle();
bool AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
void AddConfig(bool autoCreate, const char *cfg, const char *folder);
unsigned int GetConfigCount();
AutoConfig *GetConfig(unsigned int i);
@@ -283,28 +251,24 @@ public:
m_Libraries.push_back(name);
}
void LibraryActions(bool dropping);
void SyncMaxClients(int max_clients);
protected:
void UpdateInfo();
bool UpdateInfo();
void SetTimeStamp(time_t t);
void DependencyDropped(CPlugin *pOwner);
private:
ContextPair m_ctx;
PluginType m_type;
char m_filename[PLATFORM_MAX_PATH];
PluginStatus m_status;
bool m_bSilentlyFailed;
unsigned int m_serial;
sm_plugininfo_t m_info;
sp_plugin_t *m_plugin;
char m_errormsg[256];
time_t m_LastAccess;
IdentityToken_t *m_ident;
Handle_t m_handle;
bool m_WasRunning;
CVector<unsigned int> m_PhraseFiles;
List<CPlugin *> m_dependents;
List<CPlugin *> m_dependsOn;
List<FakeNative *> m_fakeNatives;
List<WeakNative> m_WeakNatives;
IPhraseCollection *m_pPhrases;
List<String> m_RequiredLibs;
List<String> m_Libraries;
Trie *m_pProps;
@@ -312,6 +276,11 @@ private:
bool m_LibraryMissing;
CVector<AutoConfig *> m_configs;
bool m_bGotAllLoaded;
int m_FileVersion;
char m_DateTime[256];
IPluginRuntime *m_pRuntime;
IPluginContext *m_pContext;
sp_pubvar_t *m_MaxClientsVar;
};
class CPluginManager :
@@ -358,6 +327,8 @@ 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);
bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize);
@@ -390,11 +361,6 @@ public:
*/
bool IsLateLoadTime() const;
/**
* Adds natives from core into the native pool.
*/
void RegisterNativesFromCore(sp_nativeinfo_t *natives);
/**
* Converts a Handle to an IPlugin if possible.
*/
@@ -410,10 +376,7 @@ public:
/**
* Internal version of FindPluginByContext()
*/
inline CPlugin *GetPluginByCtx(const sp_context_t *ctx)
{
return reinterpret_cast<CPlugin *>(ctx->user[SM_CONTEXTVAR_MYSELF]);
}
CPlugin *GetPluginByCtx(const sp_context_t *ctx);
/**
* Gets status text for a status code
@@ -449,6 +412,10 @@ public:
void UnloadAll();
CPlugin *FindPluginByConsoleArg(const char *arg);
void SyncMaxClients(int max_clients);
void ListPluginsToClient(CPlayer *player, const CCommand &args);
private:
LoadRes _LoadPlugin(CPlugin **pPlugin, const char *path, bool debug, PluginType type, char error[], size_t maxlength);
@@ -469,11 +436,6 @@ private:
*/
bool RunSecondPass(CPlugin *pPlugin, char *error, size_t maxlength);
/**
* Adds any globally registered natives to a plugin
*/
void AddCoreNativesToPlugin(CPlugin *pPlugin);
/**
* Runs an extension pass on a plugin.
*/
@@ -495,11 +457,7 @@ public:
{
return m_MyIdent;
}
public:
bool AddFakeNative(IPluginFunction *pFunction, const char *name, SPVM_FAKENATIVE_FUNC func);
SPVM_NATIVE_FUNC FindCoreNative(const char *name);
private:
void AddFakeNativesToPlugin(CPlugin *pPlugin);
void TryRefreshDependencies(CPlugin *pOther);
private:
List<IPluginsListener *> m_listeners;
@@ -509,15 +467,17 @@ private:
Trie *m_LoadLookup;
bool m_AllPluginsLoaded;
IdentityToken_t *m_MyIdent;
Trie *m_pCoreNatives;
/* Dynamic native stuff */
List<FakeNative *> m_Natives;
Trie *m_pNativeLookup;
bool m_LoadingLocked;
// Config
bool m_bBlockBadPlugins;
};
extern CPluginManager g_PluginSys;
#endif //_INCLUDE_SOURCEMOD_PLUGINSYSTEM_H_
+611
View File
@@ -0,0 +1,611 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#include "ShareSys.h"
#include "HandleSys.h"
#include "ExtensionSys.h"
#include "LibrarySys.h"
#include "PluginSys.h"
#include "sm_stringutil.h"
ShareSystem g_ShareSys;
static unsigned int g_mark_serial = 0;
ShareSystem::ShareSystem()
{
m_IdentRoot.ident = 0;
m_TypeRoot = 0;
m_IfaceType = 0;
m_CoreType = 0;
}
IdentityToken_t *ShareSystem::CreateCoreIdentity()
{
if (!m_CoreType)
{
m_CoreType = CreateIdentType("CORE");
}
return CreateIdentity(m_CoreType, this);
}
void ShareSystem::Initialize()
{
TypeAccess sec;
g_HandleSys.InitAccessDefaults(&sec, NULL);
sec.ident = GetIdentRoot();
m_TypeRoot = g_HandleSys.CreateType("Identity", this, 0, &sec, NULL, NULL, NULL);
m_IfaceType = g_HandleSys.CreateType("Interface", this, 0, NULL, NULL, GetIdentRoot(), NULL);
/* Initialize our static identity handle */
m_IdentRoot.ident = g_HandleSys.CreateHandle(m_TypeRoot, NULL, NULL, GetIdentRoot(), NULL);
/* Add the Handle System and others... they are too innocent and pure to do it themselves */
AddInterface(NULL, &g_HandleSys);
AddInterface(NULL, &g_LibSys);
}
void ShareSystem::OnSourceModShutdown()
{
if (m_CoreType)
{
g_HandleSys.RemoveType(m_CoreType, GetIdentRoot());
}
g_HandleSys.RemoveType(m_IfaceType, GetIdentRoot());
g_HandleSys.RemoveType(m_TypeRoot, GetIdentRoot());
}
IdentityType_t ShareSystem::FindIdentType(const char *name)
{
HandleType_t type;
if (g_HandleSys.FindHandleType(name, &type))
{
if (g_HandleSys.TypeCheck(type, m_TypeRoot))
{
return type;
}
}
return 0;
}
IdentityType_t ShareSystem::CreateIdentType(const char *name)
{
if (!m_TypeRoot)
{
return 0;
}
return g_HandleSys.CreateType(name, this, m_TypeRoot, NULL, NULL, GetIdentRoot(), NULL);
}
void ShareSystem::OnHandleDestroy(HandleType_t type, void *object)
{
/* THIS WILL NEVER BE CALLED FOR ANYTHING WITH THE IDENTITY TYPE */
}
IdentityToken_t *ShareSystem::CreateIdentity(IdentityType_t type, void *ptr)
{
if (!m_TypeRoot)
{
return 0;
}
/* :TODO: Cache? */
IdentityToken_t *pToken = new IdentityToken_t;
HandleSecurity sec;
sec.pOwner = sec.pIdentity = GetIdentRoot();
pToken->ident = g_HandleSys.CreateHandleInt(type, NULL, &sec, NULL, NULL, true);
pToken->ptr = ptr;
pToken->type = type;
return pToken;
}
bool ShareSystem::AddInterface(IExtension *myself, SMInterface *iface)
{
if (!iface)
{
return false;
}
IfaceInfo info;
info.owner = myself;
info.iface = iface;
m_Interfaces.push_back(info);
return true;
}
bool ShareSystem::RequestInterface(const char *iface_name,
unsigned int iface_vers,
IExtension *myself,
SMInterface **pIface)
{
/* See if the interface exists */
List<IfaceInfo>::iterator iter;
SMInterface *iface;
IExtension *iface_owner;
bool found = false;
for (iter=m_Interfaces.begin(); iter!=m_Interfaces.end(); iter++)
{
IfaceInfo &info = (*iter);
iface = info.iface;
if (strcmp(iface->GetInterfaceName(), iface_name) == 0)
{
if (iface->GetInterfaceVersion() == iface_vers
|| iface->IsVersionCompatible(iface_vers))
{
iface_owner = info.owner;
found = true;
break;
}
}
}
if (!found)
{
return false;
}
/* Add a dependency node */
if (iface_owner)
{
IfaceInfo info;
info.iface = iface;
info.owner = iface_owner;
g_Extensions.BindDependency(myself, &info);
}
if (pIface)
{
*pIface = iface;
}
return true;
}
void ShareSystem::AddNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
CNativeOwner *pOwner;
pOwner = g_Extensions.GetNativeOwner(myself);
pOwner->AddNatives(natives);
}
void ShareSystem::DestroyIdentity(IdentityToken_t *identity)
{
HandleSecurity sec;
sec.pOwner = GetIdentRoot();
sec.pIdentity = GetIdentRoot();
g_HandleSys.FreeHandle(identity->ident, &sec);
delete identity;
}
void ShareSystem::DestroyIdentType(IdentityType_t type)
{
g_HandleSys.RemoveType(type, GetIdentRoot());
}
void ShareSystem::RemoveInterfaces(IExtension *pExtension)
{
List<IfaceInfo>::iterator iter = m_Interfaces.begin();
while (iter != m_Interfaces.end())
{
if ((*iter).owner == pExtension)
{
iter = m_Interfaces.erase(iter);
}
else
{
iter++;
}
}
}
void ShareSystem::AddDependency(IExtension *myself, const char *filename, bool require, bool autoload)
{
g_Extensions.AddDependency(myself, filename, require, autoload);
}
void ShareSystem::RegisterLibrary(IExtension *myself, const char *name)
{
g_Extensions.AddLibrary(myself, name);
}
void ShareSystem::OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives)
{
unsigned int i;
NativeEntry *pEntry;
CNativeOwner *pOwner;
pOwner = g_Extensions.GetNativeOwner(myself);
for (i = 0; natives[i].func != NULL && natives[i].name != NULL; i++)
{
if ((pEntry = FindNative(natives[i].name)) == NULL)
{
continue;
}
if (pEntry->owner != g_pCoreNatives)
{
continue;
}
if (pEntry->replacement.owner != NULL)
{
continue;
}
/* Now it's safe to add the override */
pEntry->replacement.func = natives[i].func;
pEntry->replacement.owner = pOwner;
pOwner->AddReplacedNative(pEntry);
}
}
NativeEntry *ShareSystem::FindNative(const char *name)
{
NativeEntry **ppEntry;
if ((ppEntry = m_NtvCache.retrieve(name)) == NULL)
{
return NULL;
}
return *ppEntry;
}
void ShareSystem::BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly)
{
NativeEntry *pEntry;
sp_native_t *native;
uint32_t i, native_count;
IPluginContext *pContext;
pContext = pPlugin->GetBaseContext();
/* Generate a new serial ID, mark our dependencies with it. */
g_mark_serial++;
pPlugin->PropogateMarkSerial(g_mark_serial);
native_count = pContext->GetNativesNum();
for (i = 0; i < native_count; i++)
{
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
continue;
}
/* If we're bound, check if there is a replacement available.
* If not, this native is totally finalized.
*/
if (native->status == SP_NATIVE_BOUND)
{
pEntry = (NativeEntry *)native->user;
assert(pEntry != NULL);
if (pEntry->replacement.owner == NULL
|| (pEntry->replacement.owner != NULL
&& pEntry->replacement.func == native->pfn))
{
continue;
}
}
/* Otherwise, the native must be in our cache. */
else if ((pEntry = FindNative(native->name)) == NULL)
{
continue;
}
if (bCoreOnly && pEntry->owner != g_pCoreNatives)
{
continue;
}
BindNativeToPlugin(pPlugin, native, i, pEntry);
}
}
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, NativeEntry *pEntry)
{
uint32_t i;
sp_native_t *native;
IPluginContext *pContext;
pContext = pPlugin->GetBaseContext();
if (pContext->FindNativeByName(pEntry->name, &i) != SP_ERROR_NONE)
{
return;
}
if (pContext->GetNativeByIndex(i, &native) != SP_ERROR_NONE)
{
return;
}
if (native->status == SP_NATIVE_BOUND)
{
return;
}
BindNativeToPlugin(pPlugin, native, i, pEntry);
}
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin,
sp_native_t *native,
uint32_t index,
NativeEntry *pEntry)
{
/* Mark as bound... we do the rest next. */
native->status = SP_NATIVE_BOUND;
native->user = pEntry;
/* See if a replacement is available. */
if (pEntry->replacement.owner != NULL)
{
/* Perform a replacement bind. */
native->pfn = pEntry->replacement.func;
pEntry->replacement.owner->AddWeakRef(WeakNative(pPlugin, index, pEntry));
}
else
{
/* Perform a normal bind. */
native->pfn = pEntry->func;
/* We don't bother with dependency crap if the owner is Core. */
if (pEntry->owner != g_pCoreNatives)
{
/* The native is optional, this is a special case */
if ((native->flags & SP_NTVFLAG_OPTIONAL) == SP_NTVFLAG_OPTIONAL)
{
/* Only add if there is a valid owner. */
if (pEntry->owner != NULL)
{
pEntry->owner->AddWeakRef(WeakNative(pPlugin, index));
}
else
{
native->status = SP_NATIVE_UNBOUND;
}
}
/* Otherwise, we're a strong dependent and not a weak one */
else
{
/* See if this has already been marked as a dependent.
* If it has, it means this relationship has already occurred,
* and there is no reason to do it again.
*/
if (pEntry->owner != pPlugin
&& pEntry->owner->GetMarkSerial() != g_mark_serial)
{
/* This has not been marked as a dependency yet */
//pPlugin->AddDependency(pEntry->owner);
pEntry->owner->AddDependent(pPlugin);
pEntry->owner->SetMarkSerial(g_mark_serial);
}
}
}
}
}
NativeEntry *ShareSystem::AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv)
{
NativeEntry *pEntry;
if ((pEntry = FindNative(ntv->name)) == NULL)
{
pEntry = new NativeEntry;
pEntry->owner = pOwner;
pEntry->name = ntv->name;
pEntry->func = ntv->func;
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
pEntry->fake = NULL;
m_NtvCache.insert(ntv->name, pEntry);
return pEntry;
}
if (pEntry->owner != NULL)
{
return NULL;
}
pEntry->owner = pOwner;
pEntry->func = ntv->func;
pEntry->name = ntv->name;
return pEntry;
}
void ShareSystem::ClearNativeFromCache(CNativeOwner *pOwner, const char *name)
{
NativeEntry *pEntry;
if ((pEntry = FindNative(name)) == NULL)
{
return;
}
if (pEntry->owner != pOwner)
{
return;
}
if (pEntry->fake != NULL)
{
g_pSourcePawn2->DestroyFakeNative(pEntry->func);
delete pEntry->fake;
pEntry->fake = NULL;
}
pEntry->func = NULL;
pEntry->name = NULL;
pEntry->owner = NULL;
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
}
NativeEntry *ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func)
{
FakeNative *pFake;
NativeEntry *pEntry;
SPVM_NATIVE_FUNC gate;
if ((pEntry = FindNative(name)) != NULL && pEntry->owner != NULL)
{
return NULL;
}
pFake = new FakeNative;
if ((gate = g_pSourcePawn2->CreateFakeNative(func, pFake)) == NULL)
{
delete pFake;
return NULL;
}
if (pEntry == NULL)
{
pEntry = new NativeEntry;
m_NtvCache.insert(name, pEntry);
}
pFake->call = pFunc;
pFake->ctx = pFunc->GetParentContext();
strncopy(pFake->name, name, sizeof(pFake->name));
pEntry->fake = pFake;
pEntry->func = gate;
pEntry->name = pFake->name;
pEntry->owner = g_PluginSys.GetPluginByCtx(pFake->ctx->GetContext());
pEntry->replacement.func = NULL;
pEntry->replacement.owner = NULL;
return pEntry;
}
void ShareSystem::AddCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name)
{
if (m_caps.retrieve(name) != NULL)
return;
Capability cap;
cap.ext = myself;
cap.provider = provider;
m_caps.insert(name, cap);
}
void ShareSystem::DropCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name)
{
Capability *pCap = m_caps.retrieve(name);
if (pCap == NULL)
return;
if (pCap->ext != myself || pCap->provider != provider)
return;
m_caps.remove(name);
}
FeatureStatus ShareSystem::TestFeature(IPluginRuntime *pRuntime, FeatureType feature,
const char *name)
{
switch (feature)
{
case FeatureType_Native:
return TestNative(pRuntime, name);
case FeatureType_Capability:
return TestCap(name);
default:
break;
}
return FeatureStatus_Unknown;
}
FeatureStatus ShareSystem::TestNative(IPluginRuntime *pRuntime, const char *name)
{
uint32_t index;
if (pRuntime->FindNativeByName(name, &index) == SP_ERROR_NONE)
{
sp_native_t *native;
if (pRuntime->GetNativeByIndex(index, &native) == SP_ERROR_NONE)
{
if (native->status == SP_NATIVE_BOUND)
return FeatureStatus_Available;
else
return FeatureStatus_Unknown;
}
}
NativeEntry *entry = FindNative(name);
if (entry == NULL)
return FeatureStatus_Unknown;
if ((entry->replacement.owner != NULL || entry->owner != NULL) &&
(entry->replacement.func != NULL || entry->func != NULL))
{
return FeatureStatus_Available;
}
else
{
return FeatureStatus_Unavailable;
}
}
FeatureStatus ShareSystem::TestCap(const char *name)
{
Capability *cap = m_caps.retrieve(name);
if (cap == NULL)
return FeatureStatus_Unknown;
return cap->provider->GetFeatureStatus(FeatureType_Capability, name);
}
+57 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,6 +35,7 @@
#include <IShareSys.h>
#include <IHandleSys.h>
#include <sh_list.h>
#include <sm_trie_tpl.h>
#include "sm_globals.h"
#include "sourcemod.h"
@@ -60,11 +61,44 @@ struct IfaceInfo
IExtension *owner;
};
class ShareSystem :
class CNativeOwner;
class CPlugin;
struct NativeEntry;
struct ReplaceNative
{
CNativeOwner *owner;
SPVM_NATIVE_FUNC func;
};
struct FakeNative
{
char name[64];
IPluginContext *ctx;
IPluginFunction *call;
};
struct NativeEntry
{
CNativeOwner *owner;
SPVM_NATIVE_FUNC func;
const char *name;
ReplaceNative replacement;
FakeNative *fake;
};
struct Capability
{
IExtension *ext;
IFeatureProvider *provider;
};
class ShareSystem :
public IShareSys,
public SMGlobalClass,
public IHandleTypeDispatch
{
friend class CNativeOwner;
public:
ShareSystem();
public: //IShareSys
@@ -82,6 +116,10 @@ public: //IShareSys
void AddDependency(IExtension *myself, const char *filename, bool require, bool autoload);
void RegisterLibrary(IExtension *myself, const char *name);
void OverrideNatives(IExtension *myself, const sp_nativeinfo_t *natives);
void AddCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name);
void DropCapabilityProvider(IExtension *myself, IFeatureProvider *provider,
const char *name);
public: //SMGlobalClass
/* Pre-empt in case anything tries to register idents early */
void Initialize();
@@ -91,17 +129,34 @@ public: //IHandleTypeDispatch
public:
IdentityToken_t *CreateCoreIdentity();
void RemoveInterfaces(IExtension *pExtension);
FeatureStatus TestFeature(IPluginRuntime *pRuntime, FeatureType feature, const char *name);
FeatureStatus TestNative(IPluginRuntime *pRuntime, const char *name);
FeatureStatus TestCap(const char *name);
public:
inline IdentityToken_t *GetIdentRoot()
{
return &m_IdentRoot;
}
public:
void BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly);
void BindNativeToPlugin(CPlugin *pPlugin, NativeEntry *pEntry);
NativeEntry *AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
NativeEntry *FindNative(const char *name);
private:
NativeEntry *AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv);
void ClearNativeFromCache(CNativeOwner *pOwner, const char *name);
void BindNativeToPlugin(CPlugin *pPlugin,
sp_native_t *ntv,
uint32_t index,
NativeEntry *pEntry);
private:
List<IfaceInfo> m_Interfaces;
HandleType_t m_TypeRoot;
IdentityToken_t m_IdentRoot;
HandleType_t m_IfaceType;
IdentityType_t m_CoreType;
KTrie<NativeEntry *> m_NtvCache;
KTrie<Capability> m_caps;
};
extern ShareSystem g_ShareSys;
+1 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
+2 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -78,11 +78,11 @@ public: //ITimerSystem
float GetTickedTime();
void NotifyOfGameStart(float offset /* = 0.0f */);
bool GetMapTimeLeft(float *pTime);
IMapTimer *GetMapTimer();
public:
void RunFrame();
void RemoveMapChangeTimers();
void GameFrame(bool simulating);
IMapTimer *GetMapTimer();
private:
List<ITimer *> m_SingleTimers;
List<ITimer *> m_LoopTimers;
+73 -14
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -34,7 +34,11 @@
UserMessages g_UserMsgs;
#if SOURCE_ENGINE >= SE_LEFT4DEAD
SH_DECL_HOOK3(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int, const char *);
#else
SH_DECL_HOOK2(IVEngineServer, UserMessageBegin, SH_NOATTRIB, 0, bf_write *, IRecipientFilter *, int);
#endif
SH_DECL_HOOK0_void(IVEngineServer, MessageEnd, SH_NOATTRIB, 0);
UserMessages::UserMessages() : m_InterceptBuffer(m_pBase, 2500)
@@ -164,9 +168,17 @@ bf_write *UserMessages::StartMessage(int msg_id, const cell_t players[], unsigne
if (m_CurFlags & USERMSG_BLOCKHOOKS)
{
#if SOURCE_ENGINE >= SE_LEFT4DEAD
buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
#else
buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
#endif
} else {
#if SOURCE_ENGINE >= SE_LEFT4DEAD
buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
#else
buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
#endif
}
return buffer;
@@ -193,7 +205,31 @@ bool UserMessages::EndMessage()
return true;
}
bool UserMessages::HookUserMessage2(int msg_id,
IUserMessageListener *pListener,
bool intercept)
{
return InternalHook(msg_id, pListener, intercept, true);
}
bool UserMessages::UnhookUserMessage2(int msg_id,
IUserMessageListener *pListener,
bool intercept)
{
return InternalUnhook(msg_id, pListener, intercept, true);
}
bool UserMessages::HookUserMessage(int msg_id, IUserMessageListener *pListener, bool intercept)
{
return InternalHook(msg_id, pListener, intercept, false);
}
bool UserMessages::UnhookUserMessage(int msg_id, IUserMessageListener *pListener, bool intercept)
{
return InternalUnhook(msg_id, pListener, intercept, false);
}
bool UserMessages::InternalHook(int msg_id, IUserMessageListener *pListener, bool intercept, bool isNew)
{
if (msg_id < 0 || msg_id >= 255)
{
@@ -212,6 +248,7 @@ bool UserMessages::HookUserMessage(int msg_id, IUserMessageListener *pListener,
pInfo->Callback = pListener;
pInfo->IsHooked = false;
pInfo->KillMe = false;
pInfo->IsNew = isNew;
if (!m_HookCount++)
{
@@ -231,8 +268,8 @@ bool UserMessages::HookUserMessage(int msg_id, IUserMessageListener *pListener,
return true;
}
bool UserMessages::UnhookUserMessage(int msg_id, IUserMessageListener *pListener, bool intercept)
{
bool UserMessages::InternalUnhook(int msg_id, IUserMessageListener *pListener, bool intercept, bool isNew)
{
MsgList *pList;
MsgIter iter;
ListenerInfo *pInfo;
@@ -247,7 +284,7 @@ bool UserMessages::UnhookUserMessage(int msg_id, IUserMessageListener *pListener
for (iter=pList->begin(); iter!=pList->end(); iter++)
{
pInfo = (*iter);
if (pInfo->Callback == pListener)
if (pInfo->Callback == pListener && pInfo->IsNew == isNew)
{
if (pInfo->IsHooked)
{
@@ -279,7 +316,11 @@ void UserMessages::_DecRefCounter()
}
}
#if SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
#else
bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type)
#endif
{
bool is_intercept_empty = m_msgIntercepts[msg_type].empty();
bool is_hook_empty = m_msgHooks[msg_type].empty();
@@ -305,7 +346,11 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ
RETURN_META_VALUE(MRES_IGNORED, NULL);
}
#if SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)
#else
bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type)
#endif
{
if (!m_InHook)
{
@@ -319,7 +364,7 @@ bf_write *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_ty
void UserMessages::OnMessageEnd_Post()
{
if (!m_InHook || m_BlockEndPost)
if (!m_InHook)
{
RETURN_META(MRES_IGNORED);
}
@@ -328,12 +373,22 @@ void UserMessages::OnMessageEnd_Post()
MsgIter iter;
ListenerInfo *pInfo;
m_InHook = false;
pList = &m_msgIntercepts[m_CurId];
for (iter=pList->begin(); iter!=pList->end(); )
{
pInfo = (*iter);
if (m_BlockEndPost && !pInfo->IsNew)
{
continue;
}
pInfo->IsHooked = true;
pInfo->Callback->OnUserMessageSent(m_CurId);
if (pInfo->IsNew)
{
pInfo->Callback->OnPostUserMessage(m_CurId, !m_BlockEndPost);
}
if (pInfo->KillMe)
{
@@ -347,14 +402,20 @@ void UserMessages::OnMessageEnd_Post()
iter++;
}
m_InHook = false;
pList = &m_msgHooks[m_CurId];
for (iter=pList->begin(); iter!=pList->end(); )
{
pInfo = (*iter);
if (m_BlockEndPost && !pInfo->IsNew)
{
continue;
}
pInfo->IsHooked = true;
pInfo->Callback->OnUserMessageSent(m_CurId);
if (pInfo->IsNew)
{
pInfo->Callback->OnPostUserMessage(m_CurId, !m_BlockEndPost);
}
if (pInfo->KillMe)
{
@@ -435,16 +496,15 @@ void UserMessages::OnMessageEnd_Pre()
iter++;
}
if (handled)
{
goto supercede;
}
if (intercepted)
if (!handled && intercepted)
{
bf_write *engine_bfw;
#if SOURCE_ENGINE >= SE_LEFT4DEAD
engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId, g_SMAPI->GetUserMessage(m_CurId));
#else
engine_bfw = ENGINE_CALL(UserMessageBegin)(m_CurRecFilter, m_CurId);
#endif
m_ReadBuffer.StartReading(m_InterceptBuffer.GetBasePointer(), m_InterceptBuffer.GetNumBytesWritten());
engine_bfw->WriteBitsFromBuffer(&m_ReadBuffer, m_InterceptBuffer.GetNumBitsWritten());
ENGINE_CALL(MessageEnd)();
@@ -471,7 +531,6 @@ void UserMessages::OnMessageEnd_Pre()
RETURN_META((intercepted) ? MRES_SUPERCEDE : MRES_IGNORED);
supercede:
m_InHook = false;
m_BlockEndPost = true;
RETURN_META(MRES_SUPERCEDE);
}
+15 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -48,6 +48,7 @@ struct ListenerInfo
IUserMessageListener *Callback;
bool IsHooked;
bool KillMe;
bool IsNew;
};
typedef List<ListenerInfo *> MsgList;
@@ -71,12 +72,25 @@ public: //IUserMessages
bool UnhookUserMessage(int msg_id, IUserMessageListener *pListener, bool intercept=false);
bf_write *StartMessage(int msg_id, const cell_t players[], unsigned int playersNum, int flags);
bool EndMessage();
bool HookUserMessage2(int msg_id,
IUserMessageListener *pListener,
bool intercept=false);
bool UnhookUserMessage2(int msg_id,
IUserMessageListener *pListener,
bool intercept=false);
public:
#if SOURCE_ENGINE >= SE_LEFT4DEAD
bf_write *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name);
bf_write *OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name);
#else
bf_write *OnStartMessage_Pre(IRecipientFilter *filter, int msg_type);
bf_write *OnStartMessage_Post(IRecipientFilter *filter, int msg_type);
#endif
void OnMessageEnd_Pre();
void OnMessageEnd_Post();
private:
bool InternalHook(int msg_id, IUserMessageListener *pListener, bool intercept, bool isNew);
bool InternalUnhook(int msg_id, IUserMessageListener *pListener, bool intercept, bool isNew);
void _DecRefCounter();
private:
List<ListenerInfo *> m_msgHooks[255];
+35 -21
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,9 +35,13 @@
#include "concmd_cleaner.h"
#include "sm_stringutil.h"
#include "sourcemm_api.h"
#include "compat_wrappers.h"
#if defined ORANGEBOX_BUILD
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK1_void(ICvar, UnregisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
SH_DECL_HOOK1_void(ICvar, RegisterConCommand, SH_NOATTRIB, 0, ConCommandBase *);
#else
SH_DECL_HOOK1_void(ICvar, RegisterConCommandBase, SH_NOATTRIB, 0, ConCommandBase *);
#endif
using namespace SourceHook;
@@ -50,29 +54,55 @@ struct ConCommandInfo
};
List<ConCommandInfo *> tracked_bases;
IConCommandLinkListener *IConCommandLinkListener::head = NULL;
ConCommandBase *FindConCommandBase(const char *name);
class ConCommandCleaner : public SMGlobalClass
{
public:
#if defined ORANGEBOX_BUILD
void OnSourceModAllInitialized()
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_ADD_HOOK_MEMFUNC(ICvar, UnregisterConCommand, icvar, this, &ConCommandCleaner::UnlinkConCommandBase, false);
SH_ADD_HOOK_MEMFUNC(ICvar, RegisterConCommand, icvar, this, &ConCommandCleaner::LinkConCommandBase, false);
#else
SH_ADD_HOOK_MEMFUNC(ICvar, RegisterConCommandBase, icvar, this, &ConCommandCleaner::LinkConCommandBase, false);
#endif
}
void OnSourceModShutdown()
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
SH_REMOVE_HOOK_MEMFUNC(ICvar, UnregisterConCommand, icvar, this, &ConCommandCleaner::UnlinkConCommandBase, false);
}
SH_REMOVE_HOOK_MEMFUNC(ICvar, RegisterConCommand, icvar, this, &ConCommandCleaner::LinkConCommandBase, false);
#else
SH_REMOVE_HOOK_MEMFUNC(ICvar, RegisterConCommandBase, icvar, this, &ConCommandCleaner::LinkConCommandBase, false);
#endif
}
void LinkConCommandBase(ConCommandBase *pBase)
{
IConCommandLinkListener *listener = IConCommandLinkListener::head;
while (listener)
{
listener->OnLinkConCommand(pBase);
listener = listener->next;
}
}
void UnlinkConCommandBase(ConCommandBase *pBase)
{
ConCommandInfo *pInfo;
List<ConCommandInfo *>::iterator iter = tracked_bases.begin();
IConCommandLinkListener *listener = IConCommandLinkListener::head;
while (listener)
{
listener->OnUnlinkConCommand(pBase);
listener = listener->next;
}
if (pBase)
{
while (iter != tracked_bases.end())
@@ -95,7 +125,7 @@ public:
while (iter != tracked_bases.end())
{
/* This is just god-awful! */
if (FindConCommandBase((*iter)->name) != (*iter)->pBase)
if (FindCommandBase((*iter)->name) != (*iter)->pBase)
{
pInfo = (*iter);
iter = tracked_bases.erase(iter);
@@ -143,22 +173,6 @@ public:
}
} s_ConCmdTracker;
ConCommandBase *FindConCommandBase(const char *name)
{
const ConCommandBase *pBase = icvar->GetCommands();
while (pBase != NULL)
{
if (strcmp(pBase->GetName(), name) == 0)
{
return const_cast<ConCommandBase *>(pBase);
}
pBase = pBase->GetNext();
}
return NULL;
}
void TrackConCommandBase(ConCommandBase *pBase, IConCommandTracker *me)
{
s_ConCmdTracker.AddTarget(pBase, me);
+23 -2
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -38,9 +38,30 @@ public:
virtual void OnUnlinkConCommandBase(ConCommandBase *pBase, const char *name, bool is_read_safe) = 0;
};
ConCommandBase *FindConCommandBase(const char *name);
void TrackConCommandBase(ConCommandBase *pBase, IConCommandTracker *me);
void UntrackConCommandBase(ConCommandBase *pBase, IConCommandTracker *me);
void Global_OnUnlinkConCommandBase(ConCommandBase *pBase);
class IConCommandLinkListener
{
friend class ConCommandCleaner;
static IConCommandLinkListener *head;
IConCommandLinkListener *next;
public:
IConCommandLinkListener()
{
next = head;
head = this;
}
virtual void OnLinkConCommand(ConCommandBase *pBase)
{
}
virtual void OnUnlinkConCommand(ConCommandBase *pBase)
{
}
};
#endif //_INCLUDE_CONCMD_TRACKER_H_
+718
View File
@@ -0,0 +1,718 @@
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $NoKeywords: $
//===========================================================================//
#ifndef CONVAR_H
#define CONVAR_H
#if _WIN32
#pragma once
#endif
#include "tier0/dbg.h"
#include "tier1/iconvar.h"
#include "tier1/utlvector.h"
#include "tier1/utlstring.h"
#include "icvar.h"
#ifdef _WIN32
#define FORCEINLINE_CVAR FORCEINLINE
#elif defined _LINUX || defined __APPLE__
#define FORCEINLINE_CVAR inline
#else
#error "implement me"
#endif
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class ConVar;
class CCommand;
class ConCommand;
class ConCommandBase;
struct characterset_t;
//-----------------------------------------------------------------------------
// Any executable that wants to use ConVars need to implement one of
// these to hook up access to console variables.
//-----------------------------------------------------------------------------
class IConCommandBaseAccessor
{
public:
// Flags is a combination of FCVAR flags in cvar.h.
// hOut is filled in with a handle to the variable.
virtual bool RegisterConCommandBase( ConCommandBase *pVar ) = 0;
};
//-----------------------------------------------------------------------------
// Helper method for console development
//-----------------------------------------------------------------------------
#if defined( _X360 ) && !defined( _RETAIL )
void ConVar_PublishToVXConsole();
#endif
//-----------------------------------------------------------------------------
// Called when a ConCommand needs to execute
//-----------------------------------------------------------------------------
typedef void ( *FnCommandCallbackV1_t )( void );
typedef void ( *FnCommandCallback_t )( const CCommand &command );
#define COMMAND_COMPLETION_MAXITEMS 64
#define COMMAND_COMPLETION_ITEM_LENGTH 64
//-----------------------------------------------------------------------------
// Returns 0 to COMMAND_COMPLETION_MAXITEMS worth of completion strings
//-----------------------------------------------------------------------------
typedef int ( *FnCommandCompletionCallback )( const char *partial, char commands[ COMMAND_COMPLETION_MAXITEMS ][ COMMAND_COMPLETION_ITEM_LENGTH ] );
//-----------------------------------------------------------------------------
// Interface version
//-----------------------------------------------------------------------------
class ICommandCallback
{
public:
virtual void CommandCallback( const CCommand &command ) = 0;
};
class ICommandCompletionCallback
{
public:
virtual int CommandCompletionCallback( const char *pPartial, CUtlVector< CUtlString > &commands ) = 0;
};
//-----------------------------------------------------------------------------
// Purpose: The base console invoked command/cvar interface
//-----------------------------------------------------------------------------
class ConCommandBase
{
friend class CCvar;
friend class ConVar;
friend class ConCommand;
friend void ConVar_Register( int nCVarFlag, IConCommandBaseAccessor *pAccessor );
friend void ConVar_PublishToVXConsole();
// FIXME: Remove when ConVar changes are done
friend class CDefaultCvar;
public:
ConCommandBase( void );
ConCommandBase( const char *pName, const char *pHelpString = 0,
int flags = 0 );
virtual ~ConCommandBase( void );
virtual bool IsCommand( void ) const;
// Check flag
virtual bool IsFlagSet( int flag ) const;
// Set flag
virtual void AddFlags( int flags );
// Remove flag
virtual void RemoveFlags( int flags );
// Get flags
virtual int GetFlags( void ) const;
// Return name of cvar
virtual const char *GetName( void ) const;
// Return help text for cvar
virtual const char *GetHelpText( void ) const;
// Deal with next pointer
const ConCommandBase *GetNext( void ) const;
ConCommandBase *GetNext( void );
inline void SetNext(ConCommandBase *pBase)
{
m_pNext = pBase;
}
virtual bool IsRegistered( void ) const;
// Returns the DLL identifier
virtual CVarDLLIdentifier_t GetDLLIdentifier() const;
protected:
virtual void Create( const char *pName, const char *pHelpString = 0,
int flags = 0 );
// Used internally by OneTimeInit to initialize/shutdown
virtual void Init();
void Shutdown();
// Internal copy routine ( uses new operator from correct module )
char *CopyString( const char *from );
private:
// Next ConVar in chain
// Prior to register, it points to the next convar in the DLL.
// Once registered, though, m_pNext is reset to point to the next
// convar in the global list
ConCommandBase *m_pNext;
// Has the cvar been added to the global list?
bool m_bRegistered;
// Static data
const char *m_pszName;
const char *m_pszHelpString;
// ConVar flags
int m_nFlags;
protected:
// ConVars add themselves to this list for the executable.
// Then ConVar_Register runs through all the console variables
// and registers them into a global list stored in vstdlib.dll
static ConCommandBase *s_pConCommandBases;
// ConVars in this executable use this 'global' to access values.
static IConCommandBaseAccessor *s_pAccessor;
public:
inline void SetFlags(int flags)
{
m_nFlags = flags;
}
};
//-----------------------------------------------------------------------------
// Command tokenizer
//-----------------------------------------------------------------------------
class CCommand
{
public:
CCommand();
CCommand( int nArgC, const char **ppArgV );
bool Tokenize( const char *pCommand, characterset_t *pBreakSet = NULL );
void Reset();
int ArgC() const;
const char **ArgV() const;
const char *ArgS() const; // All args that occur after the 0th arg, in string form
const char *GetCommandString() const; // The entire command in string form, including the 0th arg
const char *operator[]( int nIndex ) const; // Gets at arguments
const char *Arg( int nIndex ) const; // Gets at arguments
// Helper functions to parse arguments to commands.
const char* FindArg( const char *pName ) const;
int FindArgInt( const char *pName, int nDefaultVal ) const;
static int MaxCommandLength();
static characterset_t* DefaultBreakSet();
private:
enum
{
COMMAND_MAX_ARGC = 64,
COMMAND_MAX_LENGTH = 512,
};
int m_nArgc;
int m_nArgv0Size;
char m_pArgSBuffer[ COMMAND_MAX_LENGTH ];
char m_pArgvBuffer[ COMMAND_MAX_LENGTH ];
const char* m_ppArgv[ COMMAND_MAX_ARGC ];
};
inline int CCommand::MaxCommandLength()
{
return COMMAND_MAX_LENGTH - 1;
}
inline int CCommand::ArgC() const
{
return m_nArgc;
}
inline const char **CCommand::ArgV() const
{
return m_nArgc ? (const char**)m_ppArgv : NULL;
}
inline const char *CCommand::ArgS() const
{
return m_nArgv0Size ? &m_pArgSBuffer[m_nArgv0Size] : "";
}
inline const char *CCommand::GetCommandString() const
{
return m_nArgc ? m_pArgSBuffer : "";
}
inline const char *CCommand::Arg( int nIndex ) const
{
// FIXME: Many command handlers appear to not be particularly careful
// about checking for valid argc range. For now, we're going to
// do the extra check and return an empty string if it's out of range
if ( nIndex < 0 || nIndex >= m_nArgc )
return "";
return m_ppArgv[nIndex];
}
inline const char *CCommand::operator[]( int nIndex ) const
{
return Arg( nIndex );
}
//-----------------------------------------------------------------------------
// Purpose: The console invoked command
//-----------------------------------------------------------------------------
class ConCommand : public ConCommandBase
{
friend class CCvar;
public:
typedef ConCommandBase BaseClass;
ConCommand( const char *pName, FnCommandCallbackV1_t callback,
const char *pHelpString = 0, int flags = 0, FnCommandCompletionCallback completionFunc = 0 );
ConCommand( const char *pName, FnCommandCallback_t callback,
const char *pHelpString = 0, int flags = 0, FnCommandCompletionCallback completionFunc = 0 );
ConCommand( const char *pName, ICommandCallback *pCallback,
const char *pHelpString = 0, int flags = 0, ICommandCompletionCallback *pCommandCompletionCallback = 0 );
virtual ~ConCommand( void );
virtual bool IsCommand( void ) const;
virtual int AutoCompleteSuggest( const char *partial, CUtlVector< CUtlString > &commands );
virtual bool CanAutoComplete( void );
// Invoke the function
virtual void Dispatch( const CCommand &command );
private:
// NOTE: To maintain backward compat, we have to be very careful:
// All public virtual methods must appear in the same order always
// since engine code will be calling into this code, which *does not match*
// in the mod code; it's using slightly different, but compatible versions
// of this class. Also: Be very careful about adding new fields to this class.
// Those fields will not exist in the version of this class that is instanced
// in mod code.
// Call this function when executing the command
union
{
FnCommandCallbackV1_t m_fnCommandCallbackV1;
FnCommandCallback_t m_fnCommandCallback;
ICommandCallback *m_pCommandCallback;
};
union
{
FnCommandCompletionCallback m_fnCompletionCallback;
ICommandCompletionCallback *m_pCommandCompletionCallback;
};
bool m_bHasCompletionCallback : 1;
bool m_bUsingNewCommandCallback : 1;
bool m_bUsingCommandCallbackInterface : 1;
public:
inline FnCommandCallback_t GetCallback() const
{
return m_fnCommandCallback;
}
};
//-----------------------------------------------------------------------------
// Purpose: A console variable
//-----------------------------------------------------------------------------
class ConVar : public ConCommandBase, public IConVar
{
friend class CCvar;
friend class ConVarRef;
public:
typedef ConCommandBase BaseClass;
ConVar( const char *pName, const char *pDefaultValue, int flags = 0);
ConVar( const char *pName, const char *pDefaultValue, int flags,
const char *pHelpString );
ConVar( const char *pName, const char *pDefaultValue, int flags,
const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax );
ConVar( const char *pName, const char *pDefaultValue, int flags,
const char *pHelpString, FnChangeCallback_t callback );
ConVar( const char *pName, const char *pDefaultValue, int flags,
const char *pHelpString, bool bMin, float fMin, bool bMax, float fMax,
FnChangeCallback_t callback );
virtual ~ConVar( void );
virtual bool IsCommand( void ) const;
virtual bool IsFlagSet( int flag ) const;
virtual void AddFlags( int flags );
virtual int GetFlags( void ) const;
virtual const char *GetName( void ) const;
virtual const char* GetHelpText( void ) const;
virtual bool IsRegistered( void ) const;
// Install a change callback (there shouldn't already be one....)
void InstallChangeCallback( FnChangeCallback_t callback );
// Retrieve value
FORCEINLINE_CVAR float GetFloat( void ) const;
FORCEINLINE_CVAR int GetInt( void ) const;
FORCEINLINE_CVAR bool GetBool() const { return !!GetInt(); }
FORCEINLINE_CVAR char const *GetString( void ) const;
// Used internally by OneTimeInit to initialize.
virtual void Init();
virtual const char *GetBaseName( void ) const;
virtual int GetSplitScreenPlayerSlot ( void ) const;
// Any function that allocates/frees memory needs to be virtual or else you'll have crashes
// from alloc/free across dll/exe boundaries.
// These just call into the IConCommandBaseAccessor to check flags and set the var (which ends up calling InternalSetValue).
virtual void SetValue( const char *value );
virtual void SetValue( float value );
virtual void SetValue( int value );
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
virtual void SetValue( Color value );
#endif
// Reset to default value
void Revert( void );
// True if it has a min/max setting
bool GetMin( float& minVal ) const;
bool GetMax( float& maxVal ) const;
const char *GetDefault( void ) const;
private:
// Called by CCvar when the value of a var is changing.
virtual void InternalSetValue(const char *value);
// For CVARs marked FCVAR_NEVER_AS_STRING
virtual void InternalSetFloatValue( float fNewValue );
virtual void InternalSetIntValue( int nValue );
#if SOURCE_ENGINE >= SE_LEFT4DEAD2
virtual void InternalSetColorValue( Color value );
#endif
virtual bool ClampValue( float& value );
virtual void ChangeStringValue( const char *tempVal, float flOldValue );
virtual void Create( const char *pName, const char *pDefaultValue, int flags = 0,
const char *pHelpString = 0, bool bMin = false, float fMin = 0.0,
bool bMax = false, float fMax = false, FnChangeCallback_t callback = 0 );
private:
// This either points to "this" or it points to the original declaration of a ConVar.
// This allows ConVars to exist in separate modules, and they all use the first one to be declared.
// m_pParent->m_pParent must equal m_pParent (ie: m_pParent must be the root, or original, ConVar).
ConVar *m_pParent;
// Static data
const char *m_pszDefaultValue;
// Value
// Dynamically allocated
char *m_pszString;
int m_StringLength;
// Values
float m_fValue;
int m_nValue;
// Min/Max values
bool m_bHasMin;
float m_fMinVal;
bool m_bHasMax;
float m_fMaxVal;
// Call this function when ConVar changes
FnChangeCallback_t m_fnChangeCallback;
public:
inline FnChangeCallback_t GetCallback() const
{
return m_fnChangeCallback;
}
inline void SetMin(bool set, float min=0.0)
{
m_bHasMin = set;
m_fMinVal = min;
}
inline void SetMax(bool set, float max=0.0)
{
m_bHasMax = set;
m_fMaxVal = max;
}
};
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as a float
// Output : float
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR float ConVar::GetFloat( void ) const
{
return m_pParent->m_fValue;
}
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as an int
// Output : int
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR int ConVar::GetInt( void ) const
{
return m_pParent->m_nValue;
}
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as a string, return "" for bogus string pointer, etc.
// Output : const char *
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR const char *ConVar::GetString( void ) const
{
if ( m_nFlags & FCVAR_NEVER_AS_STRING )
return "FCVAR_NEVER_AS_STRING";
return ( m_pParent->m_pszString ) ? m_pParent->m_pszString : "";
}
//-----------------------------------------------------------------------------
// Used to read/write convars that already exist (replaces the FindVar method)
//-----------------------------------------------------------------------------
class ConVarRef
{
public:
ConVarRef( const char *pName );
ConVarRef( const char *pName, bool bIgnoreMissing );
ConVarRef( IConVar *pConVar );
void Init( const char *pName, bool bIgnoreMissing );
bool IsValid() const;
bool IsFlagSet( int nFlags ) const;
IConVar *GetLinkedConVar();
// Get/Set value
float GetFloat( void ) const;
int GetInt( void ) const;
bool GetBool() const { return !!GetInt(); }
const char *GetString( void ) const;
void SetValue( const char *pValue );
void SetValue( float flValue );
void SetValue( int nValue );
void SetValue( bool bValue );
const char *GetName() const;
const char *GetDefault() const;
private:
// High-speed method to read convar data
IConVar *m_pConVar;
ConVar *m_pConVarState;
};
//-----------------------------------------------------------------------------
// Did we find an existing convar of that name?
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR bool ConVarRef::IsFlagSet( int nFlags ) const
{
return ( m_pConVar->IsFlagSet( nFlags ) != 0 );
}
FORCEINLINE_CVAR IConVar *ConVarRef::GetLinkedConVar()
{
return m_pConVar;
}
FORCEINLINE_CVAR const char *ConVarRef::GetName() const
{
return m_pConVar->GetName();
}
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as a float
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR float ConVarRef::GetFloat( void ) const
{
return m_pConVarState->m_fValue;
}
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as an int
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR int ConVarRef::GetInt( void ) const
{
return m_pConVarState->m_nValue;
}
//-----------------------------------------------------------------------------
// Purpose: Return ConVar value as a string, return "" for bogus string pointer, etc.
//-----------------------------------------------------------------------------
FORCEINLINE_CVAR const char *ConVarRef::GetString( void ) const
{
Assert( !IsFlagSet( FCVAR_NEVER_AS_STRING ) );
return m_pConVarState->m_pszString;
}
FORCEINLINE_CVAR void ConVarRef::SetValue( const char *pValue )
{
m_pConVar->SetValue( pValue );
}
FORCEINLINE_CVAR void ConVarRef::SetValue( float flValue )
{
m_pConVar->SetValue( flValue );
}
FORCEINLINE_CVAR void ConVarRef::SetValue( int nValue )
{
m_pConVar->SetValue( nValue );
}
FORCEINLINE_CVAR void ConVarRef::SetValue( bool bValue )
{
m_pConVar->SetValue( bValue ? 1 : 0 );
}
FORCEINLINE_CVAR const char *ConVarRef::GetDefault() const
{
return m_pConVarState->m_pszDefaultValue;
}
//-----------------------------------------------------------------------------
// Called by the framework to register ConCommands with the ICVar
//-----------------------------------------------------------------------------
void ConVar_Register( int nCVarFlag = 0, IConCommandBaseAccessor *pAccessor = NULL );
void ConVar_Unregister( );
//-----------------------------------------------------------------------------
// Utility methods
//-----------------------------------------------------------------------------
void ConVar_PrintFlags( const ConCommandBase *var );
void ConVar_PrintDescription( const ConCommandBase *pVar );
//-----------------------------------------------------------------------------
// Purpose: Utility class to quickly allow ConCommands to call member methods
//-----------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning (disable : 4355 )
#endif
template< class T >
class CConCommandMemberAccessor : public ConCommand, public ICommandCallback, public ICommandCompletionCallback
{
typedef ConCommand BaseClass;
typedef void ( T::*FnMemberCommandCallback_t )( const CCommand &command );
typedef int ( T::*FnMemberCommandCompletionCallback_t )( const char *pPartial, CUtlVector< CUtlString > &commands );
public:
CConCommandMemberAccessor( T* pOwner, const char *pName, FnMemberCommandCallback_t callback, const char *pHelpString = 0,
int flags = 0, FnMemberCommandCompletionCallback_t completionFunc = 0 ) :
BaseClass( pName, this, pHelpString, flags, ( completionFunc != 0 ) ? this : NULL )
{
m_pOwner = pOwner;
m_Func = callback;
m_CompletionFunc = completionFunc;
}
~CConCommandMemberAccessor()
{
Shutdown();
}
void SetOwner( T* pOwner )
{
m_pOwner = pOwner;
}
virtual void CommandCallback( const CCommand &command )
{
Assert( m_pOwner && m_Func );
(m_pOwner->*m_Func)( command );
}
virtual int CommandCompletionCallback( const char *pPartial, CUtlVector< CUtlString > &commands )
{
Assert( m_pOwner && m_CompletionFunc );
return (m_pOwner->*m_CompletionFunc)( pPartial, commands );
}
private:
T* m_pOwner;
FnMemberCommandCallback_t m_Func;
FnMemberCommandCompletionCallback_t m_CompletionFunc;
};
#ifdef _MSC_VER
#pragma warning ( default : 4355 )
#endif
//-----------------------------------------------------------------------------
// Purpose: Utility macros to quicky generate a simple console command
//-----------------------------------------------------------------------------
#define CON_COMMAND( name, description ) \
static void name( const CCommand &args ); \
static ConCommand name##_command( #name, name, description ); \
static void name( const CCommand &args )
#define CON_COMMAND_F( name, description, flags ) \
static void name( const CCommand &args ); \
static ConCommand name##_command( #name, name, description, flags ); \
static void name( const CCommand &args )
#define CON_COMMAND_F_COMPLETION( name, description, flags, completion ) \
static void name( const CCommand &args ); \
static ConCommand name##_command( #name, name, description, flags, completion ); \
static void name( const CCommand &args )
#define CON_COMMAND_EXTERN( name, _funcname, description ) \
void _funcname( const CCommand &args ); \
static ConCommand name##_command( #name, _funcname, description ); \
void _funcname( const CCommand &args )
#define CON_COMMAND_EXTERN_F( name, _funcname, description, flags ) \
void _funcname( const CCommand &args ); \
static ConCommand name##_command( #name, _funcname, description, flags ); \
void _funcname( const CCommand &args )
#define CON_COMMAND_MEMBER_F( _thisclass, name, _funcname, description, flags ) \
void _funcname( const CCommand &args ); \
friend class CCommandMemberInitializer_##_funcname; \
class CCommandMemberInitializer_##_funcname \
{ \
public: \
CCommandMemberInitializer_##_funcname() : m_ConCommandAccessor( NULL, name, &_thisclass::_funcname, description, flags ) \
{ \
m_ConCommandAccessor.SetOwner( GET_OUTER( _thisclass, m_##_funcname##_register ) ); \
} \
private: \
CConCommandMemberAccessor< _thisclass > m_ConCommandAccessor; \
}; \
\
CCommandMemberInitializer_##_funcname m_##_funcname##_register; \
#endif // CONVAR_H
+1 -1
View File
@@ -24,7 +24,7 @@
#ifdef _WIN32
#define FORCEINLINE_CVAR FORCEINLINE
#elif _LINUX
#elif defined _LINUX || defined __APPLE__
#define FORCEINLINE_CVAR inline
#else
#error "implement me"
File diff suppressed because it is too large Load Diff
+63 -3
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -35,15 +35,75 @@
#include "MenuStyle_Valve.h"
#include "MenuStyle_Radio.h"
#include "PlayerManager.h"
#include "CoreConfig.h"
#include <sm_queue.h>
#include <IThreader.h>
float g_LastMenuTime = 0.0f;
float g_LastAuthCheck = 0.0f;
static IMutex *frame_mutex;
static Queue<FrameAction> *frame_queue;
static Queue<FrameAction> *frame_actions;
static float g_LastMenuTime = 0.0f;
static float g_LastAuthCheck = 0.0f;
bool g_PendingInternalPush = false;
class FrameActionInit : public SMGlobalClass
{
public:
void OnSourceModAllInitialized()
{
frame_queue = new Queue<FrameAction>();
frame_actions = new Queue<FrameAction>();
frame_mutex = g_pThreader->MakeMutex();
}
void OnSourceModShutdown()
{
delete frame_queue;
delete frame_actions;
frame_mutex->DestroyThis();
}
} s_FrameActionInit;
void AddFrameAction(const FrameAction & action)
{
frame_mutex->Lock();
frame_queue->push(action);
frame_mutex->Unlock();
}
void RunFrameHooks(bool simulating)
{
/* It's okay if this check races. */
if (frame_queue->size())
{
Queue<FrameAction> *temp;
/* Very quick lock to move queue/actions back and forth */
frame_mutex->Lock();
temp = frame_queue;
frame_queue = frame_actions;
frame_actions = temp;
frame_mutex->Unlock();
/* The server will now be adding to the other queue, so we can process events. */
while (!frame_actions->empty())
{
FrameAction &item = frame_actions->first();
frame_actions->pop();
item.action(item.data);
}
}
/* Frame based hooks */
g_DBMan.RunFrame();
g_HL2.ProcessFakeCliCmdQueue();
g_HL2.ProcessDelayedKicks();
if (g_PendingInternalPush)
{
SM_InternalCmdTrigger();
}
g_SourceMod.ProcessGameFrameHooks(simulating);
float curtime = *g_pUniversalTime;
+17 -1
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -32,6 +32,22 @@
#ifndef _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
#define _INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
#include <ISourceMod.h>
using namespace SourceMod;
struct FrameAction
{
FrameAction(FRAMEACTION a, void *d) : data(d), action(a)
{
}
void *data;
FRAMEACTION action;
};
extern bool g_PendingInternalPush;
void AddFrameAction(const FrameAction & action);
void RunFrameHooks(bool simulating);
#endif //_INCLUDE_SOURCEMOD_FRAME_HOOKS_H_
+59
View File
@@ -0,0 +1,59 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
compiler = SM.DefaultCompiler()
base = AMBuild.sourceFolder
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
compiler['CXXINCLUDES'].append(os.path.join(base, 'core', 'logic'))
compiler['CXXINCLUDES'].append(os.path.join(base, 'public'))
compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'sourcepawn'))
compiler['CDEFINES'].append('SM_DEFAULT_THREADER')
compiler['CDEFINES'].append('SM_LOGIC')
if AMBuild.target['platform'] == 'linux':
compiler['POSTLINKFLAGS'].append('-lpthread')
if AMBuild.target['platform'] == 'darwin':
compiler['POSTLINKFLAGS'].extend(['-framework', 'CoreServices'])
extension = AMBuild.AddJob('sourcemod.logic')
binary = Cpp.LibraryBuilder('sourcemod.logic', AMBuild, extension, compiler)
files = [
'common_logic.cpp',
'smn_adt_array.cpp',
'smn_sorting.cpp',
'smn_maplists.cpp',
'smn_adt_stack.cpp',
'thread/ThreadWorker.cpp',
'thread/BaseWorker.cpp',
'ThreadSupport.cpp',
'smn_float.cpp',
'TextParsers.cpp',
'smn_textparse.cpp',
'smn_adt_trie.cpp',
'Profiler.cpp',
'smn_functions.cpp',
'smn_timers.cpp',
'smn_players.cpp',
'MemoryUtils.cpp',
'smn_admin.cpp',
'smn_banning.cpp',
'stringutil.cpp',
'Translator.cpp',
'PhraseCollection.cpp',
'smn_lang.cpp',
'smn_string.cpp',
'smn_handles.cpp',
'smn_datapacks.cpp',
'smn_gameconfigs.cpp',
'GameConfigs.cpp',
'sm_crc32.cpp',
'smn_profiler.cpp'
]
if AMBuild.target['platform'] == 'windows':
files.append('thread/WinThreads.cpp')
else:
files.append('thread/PosixThreads.cpp')
binary.AddSourceFiles('core/logic', files)
SM.AutoVersion('core/logic', binary)
binary.SendToJob()
+92
View File
@@ -0,0 +1,92 @@
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2009 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#ifndef _INCLUDE_SOURCEMOD_AUTO_HANDLE_ROOTER_H_
#define _INCLUDE_SOURCEMOD_AUTO_HANDLE_ROOTER_H_
#include "common_logic.h"
#include <IHandleSys.h>
class AutoHandleRooter
{
public:
AutoHandleRooter(Handle_t hndl)
{
if (hndl != BAD_HANDLE)
this->hndl = handlesys->FastCloneHandle(hndl);
else
this->hndl = BAD_HANDLE;
}
~AutoHandleRooter()
{
if (hndl != BAD_HANDLE)
{
HandleSecurity sec(g_pCoreIdent, g_pCoreIdent);
handlesys->FreeHandle(hndl, &sec);
}
}
Handle_t getHandle()
{
return hndl;
}
private:
Handle_t hndl;
};
class AutoHandleCloner
{
Handle_t original;
HandleSecurity sec;
AutoHandleRooter ahr;
public:
AutoHandleCloner(Handle_t original, HandleSecurity sec)
: original(original), sec(sec), ahr(original)
{
}
~AutoHandleCloner()
{
if (original != BAD_HANDLE)
{
handlesys->FreeHandle(original, &sec);
}
}
Handle_t getClone()
{
return ahr.getHandle();
}
};
#endif /* _INCLUDE_SOURCEMOD_AUTO_HANDLE_ROOTER_H_ */
+19 -3
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -29,7 +29,10 @@
* Version: $Id$
*/
#include <malloc.h>
#ifndef _INCLUDE_SOURCEMOD_CELLARRAY_H_
#define _INCLUDE_SOURCEMOD_CELLARRAY_H_
#include <stdlib.h>
#include <string.h>
extern HandleType_t htCellArray;
@@ -40,14 +43,17 @@ public:
CellArray(size_t blocksize) : m_Data(NULL), m_BlockSize(blocksize), m_AllocSize(0), m_Size(0)
{
}
~CellArray()
{
free(m_Data);
}
size_t size() const
{
return m_Size;
}
cell_t *push()
{
if (!GrowIfNeeded(1))
@@ -58,18 +64,22 @@ public:
m_Size++;
return arr;
}
cell_t *at(size_t b) const
{
return &m_Data[b * m_BlockSize];
}
size_t blocksize() const
{
return m_BlockSize;
}
void clear()
{
m_Size = 0;
}
bool swap(size_t item1, size_t item2)
{
/* Make sure there is extra space available */
@@ -90,6 +100,7 @@ public:
return true;
}
void remove(size_t index)
{
/* If we're at the end, take the easy way out */
@@ -107,6 +118,7 @@ public:
m_Size--;
}
cell_t *insert_at(size_t index)
{
/* Make sure it'll fit */
@@ -124,6 +136,7 @@ public:
return src;
}
bool resize(size_t count)
{
if (count <= m_Size)
@@ -132,7 +145,7 @@ public:
return true;
}
if(!GrowIfNeeded(count - m_Size))
if (!GrowIfNeeded(count - m_Size))
{
return false;
}
@@ -194,3 +207,6 @@ private:
size_t m_AllocSize;
size_t m_Size;
};
#endif /* _INCLUDE_SOURCEMOD_CELLARRAY_H_ */
File diff suppressed because it is too large Load Diff
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -32,12 +32,12 @@
#ifndef _INCLUDE_SOURCEMOD_CGAMECONFIGS_H_
#define _INCLUDE_SOURCEMOD_CGAMECONFIGS_H_
#include "common_logic.h"
#include <IGameConfigs.h>
#include <ITextParsers.h>
#include <sh_list.h>
#include "sm_trie.h"
#include "sm_globals.h"
#include "sm_memtable.h"
#include <sm_trie_tpl.h>
using namespace SourceMod;
using namespace SourceHook;
@@ -54,6 +54,7 @@ public:
~CGameConfig();
public:
bool Reparse(char *error, size_t maxlength);
bool EnterFile(const char *file, char *error, size_t maxlength);
public: //ITextListener_SMC
SMCResult ReadSMC_NewSection(const SMCStates *states, const char *name);
SMCResult ReadSMC_KeyValue(const SMCStates *states, const char *key, const char *value);
@@ -63,16 +64,18 @@ public: //IGameConfig
bool GetOffset(const char *key, int *value);
SendProp *GetSendProp(const char *key);
bool GetMemSig(const char *key, void **addr);
bool GetAddress(const char *key, void **addr);
public:
void IncRefCount();
unsigned int DecRefCount();
private:
BaseStringTable *m_pStrings;
char *m_pFile;
Trie *m_pOffsets;
Trie *m_pProps;
Trie *m_pKeys;
Trie *m_pSigs;
char m_File[PLATFORM_MAX_PATH];
char m_CurFile[PLATFORM_MAX_PATH];
KTrie<int> m_Offsets;
KTrie<SendProp *> m_Props;
KTrie<int> m_Keys;
KTrie<void *> m_Sigs;
unsigned int m_RefCount;
/* Parse states */
int m_ParseState;
@@ -82,6 +85,32 @@ private:
char m_offset[64];
char m_Game[256];
bool bShouldBeReadingDefault;
bool had_game;
bool matched_game;
bool had_engine;
bool matched_engine;
/* Custom Sections */
unsigned int m_CustomLevel;
ITextListener_SMC *m_CustomHandler;
/* Support for reading Addresses */
struct AddressConf
{
char signatureName[64];
int readCount;
int read[8];
AddressConf(char *sigName, unsigned sigLength, unsigned readCount, int *read);
AddressConf() {}
};
char m_Address[64];
char m_AddressSignature[64];
int m_AddressReadCount;
int m_AddressRead[8];
KTrie<AddressConf> *m_pAddresses;
};
class GameConfigManager :
@@ -97,13 +126,19 @@ public: //IGameConfigManager
IGameConfig *ReadHandle(Handle_t hndl,
IdentityToken_t *ident,
HandleError *err);
void AddUserConfigHook(const char *sectionname, ITextListener_SMC *listener);
void RemoveUserConfigHook(const char *sectionname, ITextListener_SMC *listener);
void AcquireLock();
void ReleaseLock();
public: //SMGlobalClass
void OnSourceModStartup(bool late);
void OnSourceModAllInitialized();
void OnSourceModAllShutdown();
private:
List<CGameConfig *> m_cfgs;
Trie *m_pLookup;
KTrie<CGameConfig *> m_Lookup;
public:
KTrie<ITextListener_SMC *> m_customHandlers;
};
extern GameConfigManager g_GameConfigs;

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