Compare commits
55
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76e8e7e50c | ||
|
|
40d049e1f6 | ||
|
|
48012ccf08 | ||
|
|
80ceb149b0 | ||
|
|
1ef60a13d0 | ||
|
|
e8e40d126e | ||
|
|
c7033827f5 | ||
|
|
ff27214615 | ||
|
|
7b45e963d5 | ||
|
|
96965ef7cd | ||
|
|
8f7ce184fb | ||
|
|
4bed0a2893 | ||
|
|
6ab2e23d9d | ||
|
|
dd27de8d85 | ||
|
|
8c79a6df33 | ||
|
|
e8111f3c0a | ||
|
|
a038181193 | ||
|
|
52fe916311 | ||
|
|
d01d7b1879 | ||
|
|
d8406a3efc | ||
|
|
d74204aded | ||
|
|
77be859667 | ||
|
|
71193c67b2 | ||
|
|
cc1493aa66 | ||
|
|
43946e6b6f | ||
|
|
5776909b13 | ||
|
|
048c227fcc | ||
|
|
95ab81f0db | ||
|
|
2fb01e412e | ||
|
|
6e9b4bf276 | ||
|
|
b344e81816 | ||
|
|
fec133bee6 | ||
|
|
594cc249ef | ||
|
|
0967035dd0 | ||
|
|
7e93cf8f6b | ||
|
|
7f20a7b6bb | ||
|
|
a9de6ed52c | ||
|
|
f0f50aa7bb | ||
|
|
36fab677a0 | ||
|
|
6c0d2a3743 | ||
|
|
e71eb5f704 | ||
|
|
4532b8a38d | ||
|
|
a089235b21 | ||
|
|
9f9f2baae2 | ||
|
|
49a643f411 | ||
|
|
8d7e8b2a85 | ||
|
|
848bc927a0 | ||
|
|
18d0f2a140 | ||
|
|
91a796b24d | ||
|
|
7e7544e036 | ||
|
|
9d676ed440 | ||
|
|
bad5252ee3 | ||
|
|
a2951b9ea8 | ||
|
|
f98cd68341 | ||
|
|
45b9573348 |
+3
-3
@@ -14,9 +14,9 @@
|
||||
*.user
|
||||
|
||||
# Build directories
|
||||
CrazyDebug.*/
|
||||
Debug.*/
|
||||
Release.*/
|
||||
CrazyDebug*/
|
||||
Debug*/
|
||||
Release*/
|
||||
LIB-Release/
|
||||
LIB-Debug/
|
||||
|
||||
|
||||
+604
@@ -1,5 +1,609 @@
|
||||
SourceMod Changelog
|
||||
|
||||
SourceMod 1.6.1 [2014-08-17]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.1_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated game support for CS:GO and Fistful of Frags.
|
||||
- Added support for Romanian language.
|
||||
- Re-added languages.cfg, missing from 1.6.0, causing all clients to use server language.
|
||||
- Fixed a regression in version 1.6.0 that caused certain SDKHooks usage patterns to cause a server crash (PR 107).
|
||||
- Improved error reporting in basebans plugin when banreasons.txt is missing (PR 115).
|
||||
- Fixed incorrect logged gravity value for sm_gravity command (Ryan "VoiDeD" Stecker) (PR 116).
|
||||
- Fixed a regression in version 1.6.0 causing SDKHook_ReloadPost hooks to not fire in plugins (Peace-Maker) (PR 96).
|
||||
- Added workaround for game bug in TF2_RemoveWeaponSlot to avoid wearable entities left on map (Ryan "VoiDeD" Stecker) (bug 6206, PR 121).
|
||||
- Removed DisableJIT option from core.cfg. (It was never meant for normal use.)
|
||||
|
||||
Developer Changes:
|
||||
- Added new TF2_RemoveWearable native (Ryan "VoiDeD" Stecker, WildCard65) (PR 114).
|
||||
- Added new functions for interacting with and playing scripted game sounds (Ross "Powerlord" Bemrose) (bug 5942, PR 65).
|
||||
- Added new StringToKeyValues natives (Ryan "VoiDeD" Stecker) (PR 74).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.6.0 [2014-07-03]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.6.0_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Added support for Dota 2 (bug 5656, bug 6068).
|
||||
- Added support for Source SDK 2013 mods (bug 5917).
|
||||
- Added support for Insurgency (bug 5951).
|
||||
- Added support for Contagion (bug 6007).
|
||||
- Added support for Blade Symphony (bug 5949).
|
||||
- Updated support for some mods that moved to SDK 2013 - No More Room In Hell, Fistful of Frags, Empires, Synergy.
|
||||
- Updated gamedata and other support for TF2, DoD:S, HL2:DM, CS:S, CS:GO, Left 4 Dead, and Nuclear Dawn.
|
||||
- Added support for customizing ban reasons in basebans.sp (bug 5762) (Matthias "House" Kollek).
|
||||
- Added support for searching all gameinfo search paths when seeking mapcycle file (bug 5839).
|
||||
- Added sm_reload_translations command (bug 5750).
|
||||
- Added support for single-file gamedata custom overrides (bug 5386) (Ondrej "RavuAlHemio" Hošek).
|
||||
- Re-enabled SteamAuthstringValidation config option by default (bug 5791, PR 20).
|
||||
- Fixed plugins not reaching ext dep lists, making dependent plugin not unload on ext unload (bug 5851) (Peace-Maker).
|
||||
- Added printing of SendProp flags to netprop dumps (bug 6082).
|
||||
- Removed support for obsolete plugin_settings.cfg (bug 5605).
|
||||
- Fixed topmenu sorting not getting refreshed after reloading sorting config (bug 6032) (Peace-Maker).
|
||||
- Fixed error log filename date sometimes being incorrect (bug 5761) (Matheus "M28" Valadares).
|
||||
- Dump handle information when a plugin is forcefully unloaded. (bug 5666).
|
||||
- Fixed sm_cancelvote not resetting rtv state. (bug 5808) (Peace-Maker).
|
||||
- Fixed Mapchooser dying on single map rotation servers (bug 5179).
|
||||
- Fixed various problems with unloading ClientPrefs and SourceMod (bug 5874).
|
||||
- Fixed "sm version" command reporting incorrect compile time in many cases (bug 6078) (SystematicMania).
|
||||
- Clear default database driver reference if backing extension is unloaded (bug 5934) (Peace-Maker).
|
||||
- Moved funcommands material and sound definitions to gamedata for easier cross-game support (bug 6085).
|
||||
- Implement a watchdog timer for scripts that take too long to execute (bug 5837).
|
||||
- Use Linux game data for offsets and signatures/symbols on OS X if Mac-specific data is not available (bug 6056).
|
||||
|
||||
Developer Changes:
|
||||
- Added an API for off-thread SQL transactions. (bug 3775, PR 26).
|
||||
- Added string literal concatenation using ellipses "..." (bug 4261, PR 5) (Peace-Maker).
|
||||
- Added support for nested datatables. (bug 5446).
|
||||
- Added PbRemoveRepeatedFieldValue native (bug 6066).
|
||||
- Added support for getting/setting protobuf enum values with PbGetInt, PbSetInt, and PbAddInt natives.
|
||||
- Removed deprecated PbReadRepeated natives that existed briefly in 1.5.0-dev prerelease versions.
|
||||
- Added RequestFrame native for one-off next-frame actions (bug 5965).
|
||||
- Added CS_DMG_HEADSHOT define for CS:S and CS:GO (PR 7) (Bara20).
|
||||
- Added CS_SLOT_KNIFE define for CS:S and CS:GO (bug 6131).
|
||||
- Updated TF_WEAPON enum (PR 37) (FlaminSarge).
|
||||
- Added TFHoliday_AprilFools to TFHoliday enum (bug 6092) (Ross "Powerlord" Bemrose).
|
||||
- Added new TF2_IsHolidayActive native to TF2 Ext (bug 6095) (Ross "Powerlord" Bemrose).
|
||||
- Switch TF2 extension to hook CTFGameRules::IsHolidayActive for holiday forward (bug 6137, PR 42).
|
||||
- Added GetPlayerJingleFile native. (bug 5690) (FlaminSarge).
|
||||
- Added PrepSDKCall_SetAddress and Address support to PrepSDKCall_SetFromConf (bug 5261).
|
||||
- Added ability to disable TopMenu Title Caching (bug 6034) (Peace-Maker).
|
||||
- Added DisplayTopMenuCategory native (bug 6033) (Peace-Maker).
|
||||
- Added support for Valve search paths to GetFileSize native (bug 5931).
|
||||
- Fixed invalid entities sometimes passed to OnEntityCreated and OnEntityDestroyed (bug 6119).
|
||||
- Fixed inconsistencies with OnClientDisconnected foward calls (bug 5988, PR 16).
|
||||
- Changed OnClientSayCommand to now pass non-silent chat triggers onward (bug 5926) (SystematicMania).
|
||||
- Changed OnClientSayCommand forwards to strip quotes from chat (bug 5986) (SystematicMania).
|
||||
- Fixed FindStringIndex native not returning INVALID_STRING_INDEX when string not found (bug 6144, PR 40).
|
||||
- Fixed GroundEntChanged hooks not being called (bug 6050) (Peace-Maker).
|
||||
- Fixed INetChannelInfo natives to no longer require clients to be ingame (bug 5775) (SystematicMania).
|
||||
- Fixed replace param being respected inconsistently in SetTrieArray (bug 6113).
|
||||
- Fixed crash creating a timer when there are no handles available. (bug 5317) (Peace-Maker).
|
||||
- Fixed crash in ReconnectClient and InactivateClient natives when IServer ptr is null (bug 6122).
|
||||
- Fixed StoreFromAddress and LoadFromAddress continuing with bad values, usually crashing after error (bug 6080).
|
||||
- Fixed compiler bug with multidimensional array variable release (bug 6100).
|
||||
- Changed float comparison operators to return false for NaN (bug 6107).
|
||||
- Added support in spcomp for sp/inc files > 32767 lines (bug 5959).
|
||||
- Fixed FindFlagChar returning '?' for Admin_Custom6.
|
||||
- Fixed AllPluginsLoaded activities happening before SM is loaded.
|
||||
- Deduplicated a number of files used by extensions by moving them to the public directory (bug 5341).
|
||||
- Removed 'state' keyword from compiler (bug 4572) (Ryan "VoiDeD" Stecker).
|
||||
- Removed LogMessageEx definition from logging.inc because it never existed (bug 5897) (Peace-Maker).
|
||||
- Removed native override API (bug 5852).
|
||||
- Call OnLibraryAdded for all available libraries (bug 5925, PR 4).
|
||||
- Made IGameConfig::GetMemSig return value clearer (bug 6081).
|
||||
- Switched StringToInt(Ex) from using strtol to strtoul internally (bug 5939).
|
||||
- Added an spcomp option to print #included files (bug 5997).
|
||||
- Recompiled Regex extension libpcre against v8.32, enabling utf8, unicode props, and jit (bug 5593).
|
||||
- Optimized native calls if statically bound (bug 5842).
|
||||
|
||||
Internal Changes:
|
||||
- Now using new AlliedModders Template Library (AMTL) in many places, https://github.com/alliedmodders/amtl
|
||||
- Ported buildscripts to new AMBuild2 platform, https://github.com/alliedmodders/ambuild
|
||||
- Moved much logic from core to logic binary to reduce file sizes and compile times (bug 5606, bug 5607, bug 5680, bug 5953, PR 12, PR 13).
|
||||
- Refactored the JIT to use a newer, simpler macro assembler. (bug 5827).
|
||||
- Added sourcepawn interpreter (bug 5902).
|
||||
- Added support for compiling spcomp with emscripten.
|
||||
- Rewrite IThreader implementation around new synchronization primitives (bug 5862).
|
||||
- Rewrite DBManager to use the new synchronization primitives (bug 5870).
|
||||
- Overhauled internals of ClientPrefs extension for improved stability (bug 5538).
|
||||
- Changed ShareSys to store C++ native lists more optimally (bug 5852).
|
||||
- Simplified NativeEntry state (bug 5852).
|
||||
- Changed NativeEntry to use Refcounted to manage (bug 5852).
|
||||
- Switched Translator and GameConfigs to hash tables (bug 5878).
|
||||
- Switched numerous subsystems from KTrie to AMTL NameHashSet (bug 5884).
|
||||
- Refactored Trie natives to use AMTL HashMap instead of KTrie (bug 5892).
|
||||
- Removed usages of memtables from many subsystems (bug 5899).
|
||||
- Changed EventHook name storage to use AMTL AString (bug 6188).
|
||||
- Replaced SH List usages in game extensions with AMTL variants (PR 23).
|
||||
- Replaced SourceHook list usages in clientprefs with AMTL (PR 25).
|
||||
- Changed floating-point operations to use SSE when available (bug 5841).
|
||||
- Moved tracker related opcodes entirely to C++.
|
||||
- Statically align the stack at function boundaries (bug 5842).
|
||||
- Removed InfoVars, reassigned DAT from EBP to ESI to preserve C++ stacktraces in JIT code (5844).
|
||||
- Fixed dereferencing potential null pointer in CPlugin::GetProperty (bug 5725).
|
||||
- Fixed memory corruption when parsing natives. (bug 5840).
|
||||
- Fixed some memory errors (bug 5904).
|
||||
- Fixed unaligned memory access in spcomp.
|
||||
- Move versioning to a static library to improve trivial build speed (bug 5997).
|
||||
- Added many missing handle security checks (bug 5595).
|
||||
- Made GetEntityClassname get and cache m_iClassname offset from worldspawn for ents not having it in datadesc (bug 5654).
|
||||
- Cache m_iEFlags offset for datamaps dump instead of getting for each ent (bug 5657).
|
||||
- Fixed mismatched delete [] on thunks in JIT CompData dtor (bug 5639).
|
||||
- Fixed various memory issues. (bug 5766).
|
||||
- Added reference counting and use it for CGameConfig and IDatabase (bug 5876).
|
||||
- Added atomic reference counting and port DBI (bug 5876).
|
||||
- Replaced usages of deprecated Sourcehook Add/Remove macros (bug 5631).
|
||||
- Fixed SDKHooks hook ent validation missing first datatable name (bug 5881).
|
||||
- Fixed case where bots leave server without disconnect notice (hibernation) (PR 20).
|
||||
- Changed FindConVar to utilize convar cache for improved performance (PR 27) (VoiDeD).
|
||||
- Gave define value (of 1) to PLATFORM defs to match the same-name defs in some SDKs (PR 10).
|
||||
- Wrapped ClientPrintf into IGamePlayer (bug 6021).
|
||||
- Consolidated FileExists usage in logic bin (bug 5931).
|
||||
- Removed hardcoded paths to tier0/vstdlib in ICommandLine lookup.
|
||||
- Use updated IServerTools iface on TF2 for getting tempent list and FindEntityByClassname (PR 33).
|
||||
- Added early exit in entity output detour if entity has no classname to prevent crash.
|
||||
- Updated SDKTools entity output functions to use core's GetEntityClassname instead of own (PR 39).
|
||||
- Consolidated SDKTools entity factory lookups.
|
||||
- Changed SDKTools PlayerRunCmd to a global vtable hook to improve performance (bug 6051).
|
||||
- Changed SDKHooks to use global vtable hooks to improve performance (bug 6070).
|
||||
- Added client validation checks to EmitSound SoundsHooks (bug 5873).
|
||||
- Added missing meta results to some pre-hooks in SDKHooks.
|
||||
- Replaced magic numbers for sm_show_activity with named constants (PR 14).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.5.3 [2014-03-22]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.5.3_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated support for CS:GO after multiple breaking game updates.
|
||||
- Updated gamedata support for GoldenEye: Source (Peace-Maker).
|
||||
- Fixed crash on SDKHooks extension load in Alien Swarm (bug 6059).
|
||||
- Fixed memory leak from unmanaged forwards never being freed (bug 6025).
|
||||
- Fixed possible crash when unloading the CStrike extension.
|
||||
- Fixed crash in SDKHooks Reload post-hook (Peace-Maker).
|
||||
- Fixed FakeClientCommandEx always leaking memory (bug 5678).
|
||||
- Fixed extra entity networking occuring with SetEntProp natives on some games.
|
||||
- Fixed being able to nominate same map multiple times (bug 5109).
|
||||
- Fixed spurious FindEntityByClassname error being logged on some games and platforms.
|
||||
- Fixed an Anti-Flood bypass exploit (bug 5394).
|
||||
- Removed part of Addresses gamedata error handling which could cause false errors to be logged (bug 6044).
|
||||
- Fixed mapchooser not resetting nominations count when clearing nominations list (bug 5359).
|
||||
- Improved performances of client convar query handling (bug 6003).
|
||||
|
||||
Developer Changes:
|
||||
- Added GiveAmmo native to SDKTools (bug 6039) (Peace-Maker).
|
||||
- Added SQL_SetCharset native to (re)set charset even after reconnect (bug 5786) (Peace-Maker).
|
||||
- Added support for entity references in SDKHooks natives (bug 6069).
|
||||
- Added support for server passwords to DisplayAskConnectBox stock (bug 5984) (FlaminSarge).
|
||||
- Renamed SortFunc2D parameters to match documentation (bug 6014) (Peace-Maker).
|
||||
- Fixed param order in AddToTopMenu function doc (bug 6035) (Peace-Maker).
|
||||
- Added |any| tag to WritePackCell and ReadPackCell native param/return values (bug 6001).
|
||||
- Updated SDKHook_TakeDamage native for game updates.
|
||||
- Added default infinite value for TF2_AddCondition duration.
|
||||
- Added support for conditions >= 64 in TF2_OnConditionAdded/Removed (bug 5565, bug 5976) (FlaminSarge).
|
||||
- Updated TFCond and TF customkill enum values (bug 6012) (FlaminSarge).
|
||||
- Fixed regression causing incorrect return and inability to block in TF2_OnCalcIsAttackCritical forward.
|
||||
- Fixed TE_* natives operating on incorrect data for some tempents (bug 6072).
|
||||
- Fixed CS_AliasToWeaponID not returning a valid weaponID for cz75a.
|
||||
- Fixed CS_GetWeaponPrice returning incorrect value for M4A1 in CS:GO (bug 6045).
|
||||
- Increased max gamedata byte signature length.
|
||||
- Ported SM build scripts to AMBuild2 (bug 5997).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.5.2 [2013-10-29]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.5.2_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated gamedata support for TF2, CS:S, CS:GO, and HL2:DM.
|
||||
- Fixed crash from regression in SDKTools SetClientListening hook refcounting (bug 5956) (KyleS).
|
||||
- Fixed potential crash when having maps with format characters in name.
|
||||
- Fixed some nextmap issues with long map names.
|
||||
- SDKTools no longer requires gamedata for sm_dump_datamaps on TF2, CS:S, HL2:DM, and DoD:S (bug 5968).
|
||||
|
||||
Developer Changes:
|
||||
- Updated TFCond and TF custom dmg enums.
|
||||
- Updated TF2 critical hit detection logic in TF2_OnCalcIsAttackCritical to handle more cases, including when criticals are disabled (bug 5894).
|
||||
- Fixed GetEngineVersion native returning a bad value when running on MM:S 1.9.x or earlier (bug 5697).
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.5.1 [2013-09-10]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.5.1_Release_Notes
|
||||
|
||||
User Changes:
|
||||
- Updated gamedata support for TF2.
|
||||
- Added missing DispatchKeyValue gamedata for HL2 CTF (bug 5114) (peace-maker).
|
||||
- Fixed translations not being loaded if identifier was not two or three characters (fixes Portuguese) (bug 5888).
|
||||
- Fixed runoff voting occurring when receiving the exact number of required votes (bug 5890).
|
||||
- Fixed reserve slot plugin hiding too many slots on Orangebox gamesif SourceTV and/or Replay are present (bug 5499).
|
||||
- Fixed some crashes in TF2 and unexpected behavior in all games with SDKHook_TakeDamage due to uninitialized var.
|
||||
- Fixed attempted triggers from gagged users displaying in chat (bug 5918).
|
||||
- Fixed errors in Italian translation (Oktober).
|
||||
- Added Norwegian translation (checkster).
|
||||
|
||||
Developer Changes:
|
||||
- Added CS_UpdateClientModel native to CStrike extension for CS:S and CS:GO (bug 5905) (Drifter).
|
||||
- Fixed setting weapon param in SDKHook_TakeDamage overwriting attacker instead of setting weapon (bug 5911) (KyleS)
|
||||
|
||||
----------------------------------------------------------
|
||||
SourceMod 1.5.0 [2013-08-25]
|
||||
|
||||
URL: http://wiki.alliedmods.net/SourceMod_1.5.0_Release_Notes
|
||||
|
||||
User Changes:
|
||||
|
||||
- Added support for Counter-Strike: Global Offensive (bug 5299, bug 5579).
|
||||
- Split CS:S, TF2, DoD:S, HL2:DM, and ND to separate binaries (bug 5370, bug 5813).
|
||||
- Added support for runoff voting in mapchooser (bug 4218).
|
||||
- Added option to require Steam validation before granting admin access (bug 4837) (VoiDeD).
|
||||
- Added localization support for many more core and base plugin messages (bug 5120, bug 5146).
|
||||
- Added the ability to override RegConsoleCommand-created commands (bug 5199).
|
||||
- Added support for "fuzzy" (partial) map names in map-related natives and cmds for L4D and later (bug 5599).
|
||||
- Updated Reserved Slots to use max humans as max count (bug 5444).
|
||||
- Added support for custom maxitems on radio menus (bug 5371).
|
||||
- Improved console config editing (bug 5470).
|
||||
- Increased map name buffer sizes in mapchooser to better account for nested maps (bug 5609) (Peace-Maker).
|
||||
- Fixed JIT conflicts with SELinux (bug 5581).
|
||||
- Added logged error when PlayerRunCommand offset lookup fails (bug 5535) (GoD-Tony).
|
||||
- Fixed double print when sending psay to self (bug 5649) (Peace-Maker).
|
||||
- Fixed check against uninitialized string in extension loader (bug 5546) (KyleS).
|
||||
- Fixed possible runtime errors in basetriggers for not-ingame clients (bug 5191) (Peace-Maker).
|
||||
- Check all possible mapcycle paths on newer orangebox games (bug 5719).
|
||||
- Fixed ReadMapList not seeing maps in all valve search paths (bug 5715) (VoiDeD).
|
||||
- Fixed typo in too-many-params native error message (Peace-Maker).
|
||||
- Fixed various issues in clientprefs (bug 5538) (KyleS).
|
||||
- Removed debug printout from PerformGravity (bug 5679) (KyleS).
|
||||
- Fixed broken translating in some plugins and natives (bug 5612) (KyleS).
|
||||
- Fixed issues with COMMAND_FILTER_NO_BOTS and @bots multi-target.
|
||||
- Fixed crash in SDKHooks when throwing bad ent type error on logical ent (KyleS).
|
||||
|
||||
Developer Changes:
|
||||
|
||||
- Added support for CS:GO to the CStrike extension (bug 5299) (Drifter).
|
||||
- Added support for new protobuf usermessages used in newer games (bug 5579, bug 5588, bug 5590, bug 5633).
|
||||
- Added latest SDKHooks version as first-party extension.
|
||||
- Updated SQLite to version 3.7.15.1 (bug 5235).
|
||||
- Added natives for changing team score and mvp stars on CSS/CSGO (bug 5295) (Drifter).
|
||||
- Added global pre and post forwards for client chat (bug 5394) (KyleS).
|
||||
- Added TF2_CanPlayerTeleport forward to the TF2 game extension (bug 5283) (VoiDeD).
|
||||
- Added GetEntityAddress native (bug 5269) (ProdigySim).
|
||||
- Added more parameters to PlayerRunCommand forward (bug 5346) (GoD-Tony).
|
||||
- Added forwards to basecomm plugin (bug 5466) (Drifter).
|
||||
- Added symbol lookup support to gamedata on Windows (bug 5511) (GoD-Tony).
|
||||
- Exposed GetLanguageInfo in ITranslator interface (bug 5249) (VoiDeD).
|
||||
- Increase maximum .sp line length to 4095 characters. (bug 5347) (theY4Kman).
|
||||
- Improved netprop dump output (bug 5471).
|
||||
- Added int64 typename to netprop dumps (bug 5655).
|
||||
- Added GetMaxHumanPlayers native exposing IServerGameClients func (bug 5551).
|
||||
- Added WeaponIDToAlias native to CStrike extension (bug 5460) (KyleS).
|
||||
- Fixed OnLibraryAdded/Removed not being called in all plugins (bug 5431).
|
||||
- Made thread worker processing limits configurable at runtime (bug 5326).
|
||||
- Added support in TF2 ext for detection of player conds >= 64 (bug 5565).
|
||||
- Updated button defines in entity_prop_stocks (bug 5564).
|
||||
- Added GetPlayerResourceEntity to SDKTools to replace old, semi-broken TF2-only version (bug 5491).
|
||||
- Exposed third parameter of TF2's AddCond in TF2_AddCondition (bug 5641) (FlaminSarge).
|
||||
- Added GetSteamAccountID function to IPlayerHelpers and native for sp (bug 5548) (KyleS).
|
||||
- Added ISDKHooks interface with entity listeners (bug 5602) (GoD-Tony).
|
||||
- Added file upload support to webternet extension.
|
||||
- Added more alternative names for TFClass_Heavy (bug 5338) (Afronanny).
|
||||
- Throw error instead of crash when calling SetTeamScore between maps (bug 5718) (KyleS).
|
||||
- Fixed clients not being marked as in kick queue in some cases (bug 5746) (SystematicMania).
|
||||
- Made compile.sh set working dir to own dir (bug 5710) (KyleS).
|
||||
- Added CS_IsValidWeaponID native and validity checks to other natives (bug 5566) (Drifter).
|
||||
- Numerous code documentation fixups (bug 5720) (Tsunami).
|
||||
- Fixed cmd listener callback return behavior to match func doc (bug 5882).
|
||||
|
||||
Internal Changes:
|
||||
|
||||
- Fixed handle misuse in clientprefs plugin (bug 5805) (KyleS).
|
||||
- Removed call to getchar() in debug build of compiler (bug 5626) (KyleS).
|
||||
- Fixed instability issues with cloned handles (bug 5245, bug 5240) (KyleS).
|
||||
- Changed extension unload order to avoid exposing finalization window (bug 5556) (KyleS).
|
||||
- Call OnPluginEnd before finalizer hooks have run (bug 4519).
|
||||
- Fixed potential for reading out of library bounds in MemoryUtils::FindPattern.
|
||||
- Fixed typo in TF2 ext asm.c causing accidental assignment instead of compare.
|
||||
- Overhauled versioning information (bug 5453).
|
||||
- Changed from RemoveEdict to using the Kill input for TF2_RemoveWeapon.
|
||||
- Fixed accidental assignment in each of SDKTools and sp compiler (bug 5745) (KyleS).
|
||||
- Fixed potential deadlock in HandleSystem::TryAndFreeSomeHandles (bug 5665) (KyleS).
|
||||
|
||||
----------------------------------------------------------
|
||||
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]
|
||||
|
||||
@@ -132,13 +132,5 @@
|
||||
* passed. You can disable this feature by setting the value to "0".
|
||||
*/
|
||||
"SlowScriptTimeout" "8"
|
||||
|
||||
/**
|
||||
* Disable the SourcePawn just-in-time compiler. This is intended for C++ developers using
|
||||
* debugging tools and finding it difficult to inspect JIT stack frames. The interpreter
|
||||
* is not as well-tested as the JIT and will make script execution roughly 10X slower, so
|
||||
* it is not intended for general purpose use.
|
||||
*/
|
||||
"DisableJIT" "no"
|
||||
}
|
||||
|
||||
|
||||
+12
-2
@@ -648,8 +648,11 @@ QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char
|
||||
return InvalidQueryCvarCookie;
|
||||
}
|
||||
|
||||
ConVarQuery query = {cookie, pCallback, (cell_t)hndl, IndexOfEdict(pPlayer)};
|
||||
m_ConVarQueries.push_back(query);
|
||||
if (pCallback != NULL)
|
||||
{
|
||||
ConVarQuery query = { cookie, pCallback, (cell_t) hndl, IndexOfEdict(pPlayer) };
|
||||
m_ConVarQueries.push_back(query);
|
||||
}
|
||||
#endif
|
||||
|
||||
return cookie;
|
||||
@@ -753,6 +756,13 @@ void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, CEntityIn
|
||||
void ConVarManager::OnQueryCvarValueFinished(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
|
||||
#endif // SE_DOTA
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
if (g_Players.HandleConVarQuery(cookie, pPlayer, result, cvarName, cvarValue))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
IPluginFunction *pCallback = NULL;
|
||||
cell_t value = 0;
|
||||
List<ConVarQuery>::iterator iter;
|
||||
|
||||
@@ -502,6 +502,9 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
|
||||
/* Get the client's language */
|
||||
if (m_QueryLang)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
pPlayer->m_LangId = translator->GetServerLanguage();
|
||||
#else
|
||||
const char *name;
|
||||
if (!pPlayer->IsFakeClient() && (name=engine->GetClientConVarValue(client, "cl_language")))
|
||||
{
|
||||
@@ -510,6 +513,7 @@ bool PlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const
|
||||
} else {
|
||||
pPlayer->m_LangId = translator->GetServerLanguage();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
List<IClientListener *>::iterator iter;
|
||||
@@ -727,6 +731,13 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
}
|
||||
pPlayer->Authorize_Post();
|
||||
}
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
else
|
||||
{
|
||||
// Not a bot
|
||||
pPlayer->m_LanguageCookie = g_ConVarManager.QueryClientConVar(pEntity, "cl_language", NULL, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (playerinfo)
|
||||
{
|
||||
@@ -1862,6 +1873,24 @@ void CmdMaxplayersCallback()
|
||||
g_Players.MaxPlayersChanged();
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
bool PlayerManager::HandleConVarQuery(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue)
|
||||
{
|
||||
for (int i = 1; i <= m_maxClients; i++)
|
||||
{
|
||||
if (m_Players[i].m_LanguageCookie == cookie)
|
||||
{
|
||||
unsigned int langid;
|
||||
m_Players[i].m_LangId = (translator->GetLanguageByName(cvarValue, &langid)) ? langid : translator->GetServerLanguage();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************
|
||||
*** PLAYER CODE ***
|
||||
@@ -1886,6 +1915,9 @@ CPlayer::CPlayer()
|
||||
m_bIsReplay = false;
|
||||
m_Serial.value = -1;
|
||||
m_SteamAccountID = 0;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|
||||
@@ -1966,6 +1998,9 @@ void CPlayer::Disconnect()
|
||||
m_bIsReplay = false;
|
||||
m_Serial.value = -1;
|
||||
m_SteamAccountID = 0;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
m_LanguageCookie = InvalidQueryCvarCookie;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CPlayer::SetName(const char *name)
|
||||
|
||||
@@ -131,6 +131,9 @@ private:
|
||||
bool m_bIsReplay;
|
||||
serial_t m_Serial;
|
||||
unsigned int m_SteamAccountID;
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
QueryCvarCookie_t m_LanguageCookie;
|
||||
#endif
|
||||
};
|
||||
|
||||
class PlayerManager :
|
||||
@@ -211,6 +214,9 @@ public:
|
||||
unsigned int GetReplyTo();
|
||||
unsigned int SetReplyTo(unsigned int reply);
|
||||
void MaxPlayersChanged(int newvalue = -1);
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
bool HandleConVarQuery(QueryCvarCookie_t cookie, edict_t *pPlayer, EQueryCvarValueStatus result, const char *cvarName, const char *cvarValue);
|
||||
#endif
|
||||
private:
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void OnServerActivate();
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "sm_memtable.h"
|
||||
|
||||
HandleType_t htCellTrie;
|
||||
HandleType_t htSnapshot;
|
||||
|
||||
enum EntryType
|
||||
{
|
||||
@@ -168,22 +167,6 @@ struct CellTrie : public ke::Refcounted<CellTrie>
|
||||
StringHashMap<Entry> map;
|
||||
};
|
||||
|
||||
struct TrieSnapshot
|
||||
{
|
||||
TrieSnapshot()
|
||||
: strings(128)
|
||||
{ }
|
||||
|
||||
size_t mem_usage()
|
||||
{
|
||||
return length * sizeof(int) + strings.GetMemTable()->GetMemUsage();
|
||||
}
|
||||
|
||||
size_t length;
|
||||
ke::AutoArray<int> keys;
|
||||
BaseStringTable strings;
|
||||
};
|
||||
|
||||
class TrieHelpers :
|
||||
public SMGlobalClass,
|
||||
public IHandleTypeDispatch
|
||||
@@ -192,11 +175,9 @@ public: //SMGlobalClass
|
||||
void OnSourceModAllInitialized()
|
||||
{
|
||||
htCellTrie = handlesys->CreateType("Trie", this, 0, NULL, NULL, g_pCoreIdent, NULL);
|
||||
htSnapshot = handlesys->CreateType("TrieSnapshot", this, 0, NULL, NULL, g_pCoreIdent, NULL);
|
||||
}
|
||||
void OnSourceModShutdown()
|
||||
{
|
||||
handlesys->RemoveType(htSnapshot, g_pCoreIdent);
|
||||
handlesys->RemoveType(htCellTrie, g_pCoreIdent);
|
||||
}
|
||||
public: //IHandleTypeDispatch
|
||||
@@ -206,9 +187,6 @@ public: //IHandleTypeDispatch
|
||||
{
|
||||
CellTrie *pTrie = (CellTrie *)object;
|
||||
pTrie->Release();
|
||||
} else {
|
||||
TrieSnapshot *snapshot = (TrieSnapshot *)object;
|
||||
delete snapshot;
|
||||
}
|
||||
}
|
||||
bool GetHandleApproxSize(HandleType_t type, void *object, unsigned int *pSize)
|
||||
@@ -217,9 +195,6 @@ public: //IHandleTypeDispatch
|
||||
{
|
||||
CellTrie *pArray = (CellTrie *)object;
|
||||
*pSize = sizeof(CellTrie) + pArray->map.mem_usage();
|
||||
} else {
|
||||
TrieSnapshot *snapshot = (TrieSnapshot *)object;
|
||||
*pSize = sizeof(TrieSnapshot) + snapshot->mem_usage();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -540,100 +515,6 @@ static cell_t GetTrieSize(IPluginContext *pContext, const cell_t *params)
|
||||
return pTrie->map.elements();
|
||||
}
|
||||
|
||||
static cell_t CreateTrieSnapshot(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
HandleError err;
|
||||
HandleSecurity sec = HandleSecurity(pContext->GetIdentity(), g_pCoreIdent);
|
||||
|
||||
Handle_t hndl = params[1];
|
||||
|
||||
CellTrie *pTrie;
|
||||
if ((err = handlesys->ReadHandle(hndl, htCellTrie, &sec, (void **)&pTrie))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
TrieSnapshot *snapshot = new TrieSnapshot;
|
||||
snapshot->length = pTrie->map.elements();
|
||||
snapshot->keys = new int[snapshot->length];
|
||||
size_t i = 0;
|
||||
for (StringHashMap<Entry>::iterator iter = pTrie->map.iter(); !iter.empty(); iter.next(), i++)
|
||||
snapshot->keys[i] = snapshot->strings.AddString(iter->key.chars(), iter->key.length());
|
||||
assert(i == snapshot->length);
|
||||
|
||||
if ((hndl = handlesys->CreateHandle(htSnapshot, snapshot, pContext->GetIdentity(), g_pCoreIdent, NULL))
|
||||
== BAD_HANDLE)
|
||||
{
|
||||
delete snapshot;
|
||||
return BAD_HANDLE;
|
||||
}
|
||||
|
||||
return hndl;
|
||||
}
|
||||
|
||||
static cell_t TrieSnapshotLength(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
HandleError err;
|
||||
HandleSecurity sec = HandleSecurity(pContext->GetIdentity(), g_pCoreIdent);
|
||||
|
||||
Handle_t hndl = params[1];
|
||||
|
||||
TrieSnapshot *snapshot;
|
||||
if ((err = handlesys->ReadHandle(hndl, htSnapshot, &sec, (void **)&snapshot))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
return snapshot->length;
|
||||
}
|
||||
|
||||
static cell_t TrieSnapshotKeyBufferSize(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
HandleError err;
|
||||
HandleSecurity sec = HandleSecurity(pContext->GetIdentity(), g_pCoreIdent);
|
||||
|
||||
Handle_t hndl = params[1];
|
||||
|
||||
TrieSnapshot *snapshot;
|
||||
if ((err = handlesys->ReadHandle(hndl, htSnapshot, &sec, (void **)&snapshot))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
unsigned index = params[2];
|
||||
if (index >= snapshot->length)
|
||||
return pContext->ThrowNativeError("Invalid index %d", index);
|
||||
|
||||
return strlen(snapshot->strings.GetString(snapshot->keys[index])) + 1;
|
||||
}
|
||||
|
||||
static cell_t GetTrieSnapshotKey(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
HandleError err;
|
||||
HandleSecurity sec = HandleSecurity(pContext->GetIdentity(), g_pCoreIdent);
|
||||
|
||||
Handle_t hndl = params[1];
|
||||
|
||||
TrieSnapshot *snapshot;
|
||||
if ((err = handlesys->ReadHandle(hndl, htSnapshot, &sec, (void **)&snapshot))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid Handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
unsigned index = params[2];
|
||||
if (index >= snapshot->length)
|
||||
return pContext->ThrowNativeError("Invalid index %d", index);
|
||||
|
||||
size_t written;
|
||||
const char *str = snapshot->strings.GetString(snapshot->keys[index]);
|
||||
pContext->StringToLocalUTF8(params[3], params[4], str, &written);
|
||||
return written;
|
||||
}
|
||||
|
||||
REGISTER_NATIVES(trieNatives)
|
||||
{
|
||||
{"ClearTrie", ClearTrie},
|
||||
@@ -646,9 +527,5 @@ REGISTER_NATIVES(trieNatives)
|
||||
{"SetTrieString", SetTrieString},
|
||||
{"SetTrieValue", SetTrieValue},
|
||||
{"GetTrieSize", GetTrieSize},
|
||||
{"CreateTrieSnapshot", CreateTrieSnapshot},
|
||||
{"TrieSnapshotLength", TrieSnapshotLength},
|
||||
{"TrieSnapshotKeyBufferSize", TrieSnapshotKeyBufferSize},
|
||||
{"GetTrieSnapshotKey", GetTrieSnapshotKey},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
@@ -1672,6 +1672,8 @@ public:
|
||||
failure_->PushCell(failIndex_);
|
||||
failure_->PushArray(data, txn_->entries.length());
|
||||
failure_->Execute(NULL);
|
||||
|
||||
handlesys->FreeHandle(dbh, &sec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-1
@@ -797,6 +797,32 @@ static cell_t smn_FileToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
||||
return g_HL2.KVLoadFromFile(kv, basefilesystem, path);
|
||||
}
|
||||
|
||||
static cell_t smn_StringToKeyValues(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
HandleError herr;
|
||||
HandleSecurity sec;
|
||||
KeyValueStack *pStk;
|
||||
KeyValues *kv;
|
||||
|
||||
sec.pOwner = NULL;
|
||||
sec.pIdentity = g_pCoreIdent;
|
||||
|
||||
if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
|
||||
!= HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr);
|
||||
}
|
||||
|
||||
char *buffer;
|
||||
char *resourceName;
|
||||
pCtx->LocalToString(params[2], &buffer);
|
||||
pCtx->LocalToString(params[3], &resourceName);
|
||||
|
||||
kv = pStk->pCurRoot.front();
|
||||
return kv->LoadFromBuffer(resourceName, buffer);
|
||||
}
|
||||
|
||||
static cell_t smn_KvSetEscapeSequences(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||
@@ -1101,6 +1127,7 @@ REGISTER_NATIVES(keyvaluenatives)
|
||||
{"KvGetDataType", smn_KvGetDataType},
|
||||
{"KeyValuesToFile", smn_KeyValuesToFile},
|
||||
{"FileToKeyValues", smn_FileToKeyValues},
|
||||
{"StringToKeyValues", smn_StringToKeyValues},
|
||||
{"KvSetEscapeSequences", smn_KvSetEscapeSequences},
|
||||
{"KvDeleteThis", smn_KvDeleteThis},
|
||||
{"KvDeleteKey", smn_KvDeleteKey},
|
||||
@@ -1113,4 +1140,4 @@ REGISTER_NATIVES(keyvaluenatives)
|
||||
{"KvGetVector", smn_KvGetVector},
|
||||
{"KvSetVector", smn_KvSetVector},
|
||||
{NULL, NULL}
|
||||
};
|
||||
};
|
||||
@@ -152,12 +152,20 @@ DETOUR_DECL_MEMBER1(DetourTerminateRound, void, int, reason)
|
||||
#endif
|
||||
}
|
||||
|
||||
DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, something, bool, toss)
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, Vector, vec, bool, unknown)
|
||||
#else
|
||||
DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, bDropShield, bool, bThrowForward)
|
||||
#endif
|
||||
{
|
||||
if (g_pIgnoreCSWeaponDropDetour)
|
||||
{
|
||||
g_pIgnoreCSWeaponDropDetour = false;
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, something, toss);
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, vec, unknown);
|
||||
#else
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bDropShield, bThrowForward);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -170,8 +178,14 @@ DETOUR_DECL_MEMBER3(DetourCSWeaponDrop, void, CBaseEntity *, weapon, bool, somet
|
||||
g_pCSWeaponDropForward->Execute(&result);
|
||||
|
||||
|
||||
if (result == Pl_Continue)
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, something, toss);
|
||||
if (result >= Pl_Continue)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, vec, unknown);
|
||||
#else
|
||||
DETOUR_MEMBER_CALL(DetourCSWeaponDrop)(weapon, bDropShield, bThrowForward);
|
||||
#endif
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -226,6 +226,20 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
if (!pWrapper)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
REGISTER_NATIVE_ADDR("CSWeaponDrop",
|
||||
PassInfo pass[3]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].type = PassType_Basic; \
|
||||
pass[0].size = sizeof(CBaseEntity *); \
|
||||
pass[1].flags = PASSFLAG_BYVAL; \
|
||||
pass[1].type = PassType_Basic; \
|
||||
pass[1].size = sizeof(Vector); \
|
||||
pass[2].flags = PASSFLAG_BYVAL; \
|
||||
pass[2].type = PassType_Basic; \
|
||||
pass[2].size = sizeof(bool); \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 3))
|
||||
#else
|
||||
REGISTER_NATIVE_ADDR("CSWeaponDrop",
|
||||
PassInfo pass[3]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
@@ -238,6 +252,7 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
|
||||
pass[2].type = PassType_Basic; \
|
||||
pass[2].size = sizeof(bool); \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 3))
|
||||
#endif
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
@@ -270,7 +285,11 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
|
||||
if (params[4] == 1 && g_pCSWeaponDropDetoured)
|
||||
g_pIgnoreCSWeaponDropDetour = true;
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
unsigned char vstk[sizeof(CBaseEntity *) * 2 + sizeof(bool) + sizeof(Vector)];
|
||||
#else
|
||||
unsigned char vstk[sizeof(CBaseEntity *) * 2 + sizeof(bool) * 2];
|
||||
#endif
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
// <psychonic> first one is always false. second is true to toss, false to just drop
|
||||
@@ -278,9 +297,15 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
|
||||
vptr += sizeof(CBaseEntity *);
|
||||
*(CBaseEntity **)vptr = pWeapon;
|
||||
vptr += sizeof(CBaseEntity *);
|
||||
#if SOURCE_ENGINE == SE_CSGO
|
||||
*(Vector *)vptr = vec3_origin;
|
||||
vptr += sizeof(Vector);
|
||||
*(bool *)vptr = false;
|
||||
#else
|
||||
*(bool *)vptr = false;
|
||||
vptr += sizeof(bool);
|
||||
*(bool *)vptr = (params[3]) ? true : false;
|
||||
#endif
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
@@ -347,12 +372,10 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
float delay = sp_ctof(params[1]);
|
||||
int reason = params[2];
|
||||
signed int unknown = 1;//We might want to find what this is?
|
||||
__asm
|
||||
{
|
||||
push reason
|
||||
movss xmm1, delay
|
||||
mov edi, unknown
|
||||
mov ecx, gamerules
|
||||
call addr
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ static cell_t MatchRegex(IPluginContext *pCtx, const cell_t *params)
|
||||
|
||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
||||
return pCtx->ThrowNativeError("Invalid regex handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
if (!x)
|
||||
@@ -159,7 +159,7 @@ static cell_t GetRegexSubString(IPluginContext *pCtx, const cell_t *params)
|
||||
|
||||
if ((err=g_pHandleSys->ReadHandle(hndl, g_RegexHandle, &sec, (void **)&x)) != HandleError_None)
|
||||
{
|
||||
return pCtx->ThrowNativeError("Invalid file handle %x (error %d)", hndl, err);
|
||||
return pCtx->ThrowNativeError("Invalid regex handle %x (error %d)", hndl, err);
|
||||
}
|
||||
|
||||
if (!x)
|
||||
|
||||
@@ -438,6 +438,21 @@ FeatureStatus SDKHooks::GetFeatureStatus(FeatureType type, const char *name)
|
||||
/**
|
||||
* Functions
|
||||
*/
|
||||
|
||||
static void PopulateCallbackList(const ke::Vector<HookList> &source, ke::Vector<IPluginFunction *> &destination, int entity)
|
||||
{
|
||||
destination.ensure(8); /* Skip trivial allocations as AMTL uses length<<1. */
|
||||
for (size_t iter = 0; iter < source.length(); ++iter)
|
||||
{
|
||||
if (source[iter].entity != entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
destination.append(source[iter].callback);
|
||||
}
|
||||
}
|
||||
|
||||
cell_t SDKHooks::Call(int entity, SDKHookType type, int other)
|
||||
{
|
||||
return Call(gamehelpers->ReferenceToEntity(entity), type, gamehelpers->ReferenceToEntity(other));
|
||||
@@ -461,17 +476,14 @@ cell_t SDKHooks::Call(CBaseEntity *pEnt, SDKHookType type, CBaseEntity *pOther)
|
||||
continue;
|
||||
}
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEnt);
|
||||
int other = gamehelpers->EntityToBCompatRef(pOther);
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(other);
|
||||
|
||||
@@ -914,15 +926,11 @@ void SDKHooks::Hook_FireBulletsPost(const FireBulletsInfo_t &info)
|
||||
|
||||
const char *weapon = pInfo->GetWeaponName();
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.m_iShots);
|
||||
callback->PushString(weapon?weapon:"");
|
||||
@@ -956,15 +964,11 @@ int SDKHooks::Hook_GetMaxHealth()
|
||||
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&new_max);
|
||||
callback->Execute(&res);
|
||||
@@ -1013,15 +1017,11 @@ int SDKHooks::Hook_OnTakeDamage(CTakeDamageInfoHack &info)
|
||||
|
||||
cell_t res, ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&attacker);
|
||||
callback->PushCellByRef(&inflictor);
|
||||
@@ -1095,15 +1095,11 @@ int SDKHooks::Hook_OnTakeDamagePost(CTakeDamageInfoHack &info)
|
||||
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.GetAttacker());
|
||||
callback->PushCell(info.GetInflictor());
|
||||
@@ -1168,15 +1164,11 @@ bool SDKHooks::Hook_Reload()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->Execute(&res);
|
||||
}
|
||||
@@ -1195,7 +1187,7 @@ bool SDKHooks::Hook_ReloadPost()
|
||||
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
|
||||
|
||||
CVTableHook vhook(pEntity);
|
||||
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Reload];
|
||||
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ReloadPost];
|
||||
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
|
||||
{
|
||||
if (vhook != vtablehooklist[entry]->vtablehook)
|
||||
@@ -1206,15 +1198,11 @@ bool SDKHooks::Hook_ReloadPost()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t origreturn = META_RESULT_ORIG_RET(bool) ? 1 : 0;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(origreturn);
|
||||
callback->Execute(NULL);
|
||||
@@ -1253,15 +1241,11 @@ bool SDKHooks::Hook_ShouldCollide(int collisionGroup, int contentsMask)
|
||||
cell_t origRet = ((META_RESULT_STATUS >= MRES_OVERRIDE)?(META_RESULT_OVERRIDE_RET(bool)):(META_RESULT_ORIG_RET(bool))) ? 1 : 0;
|
||||
cell_t res = 0;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(collisionGroup);
|
||||
callback->PushCell(contentsMask);
|
||||
@@ -1301,15 +1285,11 @@ void SDKHooks::Hook_Spawn()
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
cell_t res = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->Execute(&res);
|
||||
}
|
||||
@@ -1399,15 +1379,11 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir,
|
||||
int ammotype = info.GetAmmoType();
|
||||
cell_t res, ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCellByRef(&attacker);
|
||||
callback->PushCellByRef(&inflictor);
|
||||
@@ -1477,15 +1453,11 @@ void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vec
|
||||
|
||||
int entity = gamehelpers->EntityToBCompatRef(pEntity);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(info.GetAttacker());
|
||||
callback->PushCell(info.GetInflictor());
|
||||
@@ -1521,15 +1493,11 @@ void SDKHooks::Hook_Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
|
||||
int caller = gamehelpers->EntityToBCompatRef(pCaller);
|
||||
cell_t ret = Pl_Continue;
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(activator);
|
||||
callback->PushCell(caller);
|
||||
@@ -1564,15 +1532,11 @@ void SDKHooks::Hook_UsePost(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
|
||||
int activator = gamehelpers->EntityToBCompatRef(pActivator);
|
||||
int caller = gamehelpers->EntityToBCompatRef(pCaller);
|
||||
|
||||
ke::Vector<HookList> &pawnlist = vtablehooklist[entry]->hooks;
|
||||
for (entry = 0; entry < pawnlist.length(); ++entry)
|
||||
ke::Vector<IPluginFunction *> callbackList;
|
||||
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
|
||||
for (entry = 0; entry < callbackList.length(); ++entry)
|
||||
{
|
||||
if (entity != pawnlist[entry].entity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IPluginFunction *callback = pawnlist[entry].callback;
|
||||
IPluginFunction *callback = callbackList[entry];
|
||||
callback->PushCell(entity);
|
||||
callback->PushCell(activator);
|
||||
callback->PushCell(caller);
|
||||
|
||||
@@ -66,6 +66,7 @@ IPlayerInfoManager *playerinfomngr = NULL;
|
||||
ICvar *icvar = NULL;
|
||||
IServer *iserver = NULL;
|
||||
CGlobalVars *gpGlobals;
|
||||
ISoundEmitterSystemBase *soundemitterbase = NULL;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
IServerTools *servertools = NULL;
|
||||
@@ -258,6 +259,7 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
GET_V_IFACE_ANY(GetServerFactory, servertools, IServerTools, VSERVERTOOLS_INTERFACE_VERSION);
|
||||
#endif
|
||||
GET_V_IFACE_ANY(GetEngineFactory, soundemitterbase, ISoundEmitterSystemBase, SOUNDEMITTERSYSTEM_INTERFACE_VERSION);
|
||||
|
||||
gpGlobals = ismm->GetCGlobals();
|
||||
enginePatch = SH_GET_CALLCLASS(engine);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <convar.h>
|
||||
#include <iserver.h>
|
||||
#include <cdll_int.h>
|
||||
#include "SoundEmitterSystem/isoundemittersystembase.h"
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#include <itoolentity.h>
|
||||
@@ -124,6 +125,7 @@ extern CGlobalVars *gpGlobals;
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
extern IServerTools *servertools;
|
||||
#endif
|
||||
extern ISoundEmitterSystemBase *soundemitterbase;
|
||||
/* Interfaces from SourceMod */
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
|
||||
@@ -115,9 +115,13 @@ void EntityOutputManager::FireEventDetour(void *pOutput, CBaseEntity *pActivator
|
||||
// Fast lookup failed - check the slow way for hooks that haven't fired yet
|
||||
if ((fastLookup = EntityOutputs->Retrieve(sOutput, (void **)&pOutputName)) == false)
|
||||
{
|
||||
const char *classname = GetEntityClassname(pCaller);
|
||||
const char *outputname = FindOutputName(pOutput, pCaller);
|
||||
|
||||
const char *classname = gamehelpers->GetEntityClassname(pCaller);
|
||||
if (!classname)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const char *outputname = FindOutputName(pOutput, pCaller);
|
||||
if (!outputname)
|
||||
{
|
||||
return;
|
||||
@@ -349,21 +353,3 @@ const char *EntityOutputManager::FindOutputName(void *pOutput, CBaseEntity *pCal
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *EntityOutputManager::GetEntityClassname(CBaseEntity *pEntity)
|
||||
{
|
||||
static int offset = -1;
|
||||
if (offset == -1)
|
||||
{
|
||||
datamap_t *pMap = gamehelpers->GetDataMap(pEntity);
|
||||
sm_datatable_info_t info;
|
||||
if (!gamehelpers->FindDataMapInfo(pMap, "m_iClassname", &info))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
offset = info.actual_offset;
|
||||
}
|
||||
|
||||
return *(const char **)(((unsigned char *)pEntity) + offset);
|
||||
}
|
||||
|
||||
@@ -108,8 +108,6 @@ public:
|
||||
void OnHookAdded();
|
||||
void OnHookRemoved();
|
||||
|
||||
const char *GetEntityClassname(CBaseEntity *pEntity);
|
||||
|
||||
private:
|
||||
bool enabled;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ cell_t HookSingleEntityOutput(IPluginContext *pContext, const cell_t *params)
|
||||
return pContext->ThrowNativeError("Invalid Entity index %i (%i)", gamehelpers->ReferenceToIndex(params[1]), params[1]);
|
||||
}
|
||||
|
||||
const char *classname = g_OutputManager.GetEntityClassname(pEntity);
|
||||
const char *classname = gamehelpers->GetEntityClassname(pEntity);
|
||||
|
||||
char *outputname;
|
||||
pContext->LocalToString(params[2], &outputname);
|
||||
@@ -226,7 +226,7 @@ cell_t UnHookSingleEntityOutput(IPluginContext *pContext, const cell_t *params)
|
||||
return pContext->ThrowNativeError("Invalid Entity index %i (%i)", gamehelpers->ReferenceToIndex(params[1]), params[1]);
|
||||
}
|
||||
|
||||
const char *classname = g_OutputManager.GetEntityClassname(pEntity);
|
||||
const char *classname = gamehelpers->GetEntityClassname(pEntity);
|
||||
|
||||
char *outputname;
|
||||
pContext->LocalToString(params[2], &outputname);
|
||||
|
||||
@@ -130,6 +130,9 @@ bool UTIL_VerifySignature(const void *addr, const char *sig, size_t len)
|
||||
|
||||
void GetIServer()
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
iserver = engine->GetIServer();
|
||||
#else
|
||||
void *addr;
|
||||
const char *sigstr;
|
||||
char sig[32];
|
||||
@@ -188,6 +191,7 @@ void GetIServer()
|
||||
|
||||
/* Finally we have the interface we were looking for */
|
||||
iserver = *reinterpret_cast<IServer **>(reinterpret_cast<unsigned char *>(vfunc) + offset);
|
||||
#endif // !TF2
|
||||
}
|
||||
|
||||
void GetResourceEntity()
|
||||
|
||||
@@ -512,6 +512,74 @@ RETURN_META_NEWPARAMS(
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetSoundParams(CSoundParameters *soundParams, const char *soundname, cell_t entindex)
|
||||
{
|
||||
if ( !soundname[0] )
|
||||
return false;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_PORTAL2
|
||||
HSOUNDSCRIPTHASH index = (HSOUNDSCRIPTHASH)soundemitterbase->GetSoundIndex(soundname);
|
||||
#else
|
||||
HSOUNDSCRIPTHANDLE index = (HSOUNDSCRIPTHANDLE)soundemitterbase->GetSoundIndex(soundname);
|
||||
#endif
|
||||
if (!soundemitterbase->IsValidIndex(index))
|
||||
return false;
|
||||
|
||||
gender_t gender = GENDER_NONE;
|
||||
|
||||
// I don't know if gender applies to any mutliplayer games, but just in case...
|
||||
// Of course, if it's SOUND_FROM_PLAYER, we have no idea which gender it is
|
||||
int ent = SoundReferenceToIndex(entindex);
|
||||
if (ent > 0)
|
||||
{
|
||||
edict_t *edict = gamehelpers->EdictOfIndex(ent);
|
||||
if (edict != NULL && !edict->IsFree())
|
||||
{
|
||||
IServerEntity *serverEnt = edict->GetIServerEntity();
|
||||
if (serverEnt != NULL)
|
||||
{
|
||||
const char *actormodel = STRING(serverEnt->GetModelName());
|
||||
gender = soundemitterbase->GetActorGender(actormodel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return soundemitterbase->GetParametersForSoundEx(soundname, index, *soundParams, gender);
|
||||
}
|
||||
|
||||
bool InternalPrecacheScriptSound(const char *soundname)
|
||||
{
|
||||
int soundIndex = soundemitterbase->GetSoundIndex(soundname);
|
||||
if (!soundemitterbase->IsValidIndex(soundIndex))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
CSoundParametersInternal *internal = soundemitterbase->InternalGetParametersForSound(soundIndex);
|
||||
|
||||
if (!internal)
|
||||
return false;
|
||||
|
||||
int waveCount = internal->NumSoundNames();
|
||||
|
||||
if (!waveCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int wave = 0; wave < waveCount; wave++)
|
||||
{
|
||||
const char* waveName = soundemitterbase->GetWaveName(internal->GetSoundNames()[wave].symbol);
|
||||
// return true even if we precache no new wavs
|
||||
if (!engsound->IsSoundPrecached(waveName))
|
||||
{
|
||||
engsound->PrecacheSound(waveName);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/************************
|
||||
* *
|
||||
* Sound Related Natives *
|
||||
@@ -1135,6 +1203,51 @@ static cell_t smn_GetDistGainFromSoundLevel(IPluginContext *pContext, const cell
|
||||
return sp_ftoc(engsound->GetDistGainFromSoundLevel((soundlevel_t)decibel, distance));
|
||||
}
|
||||
|
||||
// native bool:GetGameSoundParams(const String:gameSound[], &channel, &soundLevel, &Float:volume, &pitch, String:sample[], maxlength, entity=SOUND_FROM_WORLD)
|
||||
static cell_t smn_GetGameSoundParams(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *soundname;
|
||||
pContext->LocalToString(params[1], &soundname);
|
||||
|
||||
CSoundParameters soundParams;
|
||||
|
||||
if (!GetSoundParams(&soundParams, soundname, params[8]))
|
||||
return false;
|
||||
|
||||
cell_t *channel;
|
||||
cell_t *fakeVolume;
|
||||
cell_t *pitch;
|
||||
cell_t *soundLevel;
|
||||
|
||||
pContext->LocalToPhysAddr(params[2], &channel);
|
||||
pContext->LocalToPhysAddr(params[3], &soundLevel);
|
||||
pContext->LocalToPhysAddr(params[4], &fakeVolume);
|
||||
pContext->LocalToPhysAddr(params[5], &pitch);
|
||||
|
||||
*channel = soundParams.channel;
|
||||
*pitch = soundParams.pitch;
|
||||
*soundLevel = (cell_t)soundParams.soundlevel;
|
||||
*fakeVolume = sp_ftoc(soundParams.volume);
|
||||
|
||||
pContext->StringToLocal(params[6], params[7], soundParams.soundname);
|
||||
|
||||
// Precache the sound we're returning
|
||||
if (!engsound->IsSoundPrecached(soundParams.soundname))
|
||||
{
|
||||
InternalPrecacheScriptSound(soundname);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// native bool:PrecacheScriptSound(const String:soundname[])
|
||||
static cell_t smn_PrecacheScriptSound(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
char *soundname;
|
||||
pContext->LocalToString(params[1], &soundname);
|
||||
return InternalPrecacheScriptSound(soundname);
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_SoundNatives[] =
|
||||
{
|
||||
{"EmitAmbientSound", EmitAmbientSound},
|
||||
@@ -1149,5 +1262,7 @@ sp_nativeinfo_t g_SoundNatives[] =
|
||||
{"RemoveAmbientSoundHook", smn_RemoveAmbientSoundHook},
|
||||
{"RemoveNormalSoundHook", smn_RemoveNormalSoundHook},
|
||||
{"GetDistGainFromSoundLevel", smn_GetDistGainFromSoundLevel},
|
||||
{"GetGameSoundParams", smn_GetGameSoundParams},
|
||||
{"PrecacheScriptSound", smn_PrecacheScriptSound},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
@@ -113,7 +113,15 @@ static cell_t FindStringIndex(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pContext->LocalToString(params[2], &str);
|
||||
|
||||
return pTable->FindStringIndex(str);
|
||||
int strindex = pTable->FindStringIndex(str);
|
||||
|
||||
// INVALID_STRING_INDEX is 65535 at time of writing, but already defined in sp inc files as -1
|
||||
if (strindex == INVALID_STRING_INDEX)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return strindex;
|
||||
}
|
||||
|
||||
static cell_t ReadStringTable(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "teleporter.h"
|
||||
#include "CDetour/detours.h"
|
||||
#include "ISDKHooks.h"
|
||||
#include "ISDKTools.h"
|
||||
|
||||
/**
|
||||
* @file extension.cpp
|
||||
@@ -54,6 +55,7 @@ IGameConfig *g_pGameConf = NULL;
|
||||
|
||||
IBinTools *g_pBinTools = NULL;
|
||||
ISDKHooks *g_pSDKHooks = NULL;
|
||||
ISDKTools *g_pSDKTools = NULL;
|
||||
|
||||
SMEXT_LINK(&g_TF2Tools);
|
||||
|
||||
@@ -94,6 +96,7 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
|
||||
sharesys->AddDependency(myself, "bintools.ext", true, true);
|
||||
sharesys->AddDependency(myself, "sdkhooks.ext", true, true);
|
||||
sharesys->AddDependency(myself, "sdktools.ext", false, true);
|
||||
|
||||
char conf_error[255] = "";
|
||||
if (!gameconfs->LoadGameConfigFile("sm-tf2.games", &g_pGameConf, conf_error, sizeof(conf_error)))
|
||||
@@ -116,7 +119,6 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
playerhelpers->AddClientListener(this);
|
||||
|
||||
g_critForward = forwards->CreateForward("TF2_CalcIsAttackCritical", ET_Hook, 4, NULL, Param_Cell, Param_Cell, Param_String, Param_CellByRef);
|
||||
g_isHolidayForward = forwards->CreateForward("TF2_OnIsHolidayActive", ET_Event, 2, NULL, Param_Cell, Param_CellByRef);
|
||||
g_addCondForward = forwards->CreateForward("TF2_OnConditionAdded", ET_Ignore, 2, NULL, Param_Cell, Param_Cell);
|
||||
g_removeCondForward = forwards->CreateForward("TF2_OnConditionRemoved", ET_Ignore, 2, NULL, Param_Cell, Param_Cell);
|
||||
g_waitingPlayersStartForward = forwards->CreateForward("TF2_OnWaitingForPlayersStart", ET_Ignore, 0, NULL);
|
||||
@@ -126,11 +128,12 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
g_pCVar = icvar;
|
||||
|
||||
m_CritDetoursEnabled = false;
|
||||
m_IsHolidayDetourEnabled = false;
|
||||
m_CondChecksEnabled = false;
|
||||
m_RulesDetoursEnabled = false;
|
||||
m_TeleportDetourEnabled = false;
|
||||
|
||||
g_HolidayManager.OnSDKLoad(late);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -164,6 +167,8 @@ void TF2Tools::SDK_OnUnload()
|
||||
{
|
||||
SH_REMOVE_HOOK(IServerGameDLL, ServerActivate, gamedll, SH_STATIC(OnServerActivate), true);
|
||||
|
||||
g_HolidayManager.OnSDKUnload();
|
||||
|
||||
g_RegNatives.UnregisterAll();
|
||||
gameconfs->CloseGameConfigFile(g_pGameConf);
|
||||
playerhelpers->UnregisterCommandTargetProcessor(this);
|
||||
@@ -172,7 +177,6 @@ void TF2Tools::SDK_OnUnload()
|
||||
plsys->RemovePluginsListener(this);
|
||||
|
||||
forwards->ReleaseForward(g_critForward);
|
||||
forwards->ReleaseForward(g_isHolidayForward);
|
||||
forwards->ReleaseForward(g_addCondForward);
|
||||
forwards->ReleaseForward(g_removeCondForward);
|
||||
forwards->ReleaseForward(g_waitingPlayersStartForward);
|
||||
@@ -189,6 +193,7 @@ void TF2Tools::SDK_OnAllLoaded()
|
||||
{
|
||||
SM_GET_LATE_IFACE(BINTOOLS, g_pBinTools);
|
||||
SM_GET_LATE_IFACE(SDKHOOKS, g_pSDKHooks);
|
||||
SM_GET_LATE_IFACE(SDKTOOLS, g_pSDKTools);
|
||||
|
||||
if (g_pSDKHooks != NULL)
|
||||
{
|
||||
@@ -227,6 +232,11 @@ bool TF2Tools::QueryInterfaceDrop(SMInterface *pInterface)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pInterface == g_pSDKTools)
|
||||
{
|
||||
g_pSDKTools = NULL;
|
||||
}
|
||||
|
||||
return IExtensionInterface::QueryInterfaceDrop(pInterface);
|
||||
}
|
||||
|
||||
@@ -238,6 +248,7 @@ void TF2Tools::NotifyInterfaceDrop(SMInterface *pInterface)
|
||||
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
{
|
||||
g_resourceEntity = FindResourceEntity();
|
||||
g_HolidayManager.OnServerActivated();
|
||||
}
|
||||
|
||||
bool TF2Tools::ProcessCommandTarget(cmd_target_info_t *info)
|
||||
@@ -342,11 +353,6 @@ void TF2Tools::OnPluginLoaded(IPlugin *plugin)
|
||||
m_CritDetoursEnabled = g_CritManager.TryEnable();
|
||||
}
|
||||
|
||||
if (!m_IsHolidayDetourEnabled && g_isHolidayForward->GetFunctionCount())
|
||||
{
|
||||
m_IsHolidayDetourEnabled = InitialiseIsHolidayDetour();
|
||||
}
|
||||
|
||||
if (!m_CondChecksEnabled
|
||||
&& ( g_addCondForward->GetFunctionCount() || g_removeCondForward->GetFunctionCount() )
|
||||
)
|
||||
@@ -374,11 +380,6 @@ void TF2Tools::OnPluginUnloaded(IPlugin *plugin)
|
||||
g_CritManager.Disable();
|
||||
m_CritDetoursEnabled = false;
|
||||
}
|
||||
if (m_IsHolidayDetourEnabled && !g_isHolidayForward->GetFunctionCount())
|
||||
{
|
||||
RemoveIsHolidayDetour();
|
||||
m_IsHolidayDetourEnabled = false;
|
||||
}
|
||||
if (m_CondChecksEnabled)
|
||||
{
|
||||
if (!g_addCondForward->GetFunctionCount() && !g_removeCondForward->GetFunctionCount())
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#include <server_class.h>
|
||||
#include <igameevents.h>
|
||||
|
||||
namespace SourceMod {
|
||||
class ISDKTools;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sample implementation of the SDK Extension.
|
||||
* Note: Uncomment one of the pre-defined virtual functions in order to use it.
|
||||
@@ -116,7 +120,6 @@ public:
|
||||
#endif
|
||||
private:
|
||||
bool m_CritDetoursEnabled;
|
||||
bool m_IsHolidayDetourEnabled;
|
||||
bool m_CondChecksEnabled;
|
||||
bool m_RulesDetoursEnabled;
|
||||
bool m_TeleportDetourEnabled;
|
||||
@@ -139,6 +142,7 @@ enum TFClassType
|
||||
TFClassType ClassnameToType(const char *classname);
|
||||
|
||||
extern IBinTools *g_pBinTools;
|
||||
extern ISDKTools *g_pSDKTools;
|
||||
extern IGameConfig *g_pGameConf;
|
||||
extern sm_sendprop_info_t *playerSharedOffset;
|
||||
|
||||
|
||||
+115
-31
@@ -31,49 +31,133 @@
|
||||
|
||||
#include "holiday.h"
|
||||
|
||||
CDetour *isHolidayDetour = NULL;
|
||||
SH_DECL_MANUALHOOK1(IsHolidayActive, 0, 0, 0, bool, int);
|
||||
SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, 0);
|
||||
|
||||
IForward *g_isHolidayForward = NULL;
|
||||
HolidayManager g_HolidayManager;
|
||||
|
||||
DETOUR_DECL_STATIC1(IsHolidayActive, bool, int, holiday)
|
||||
HolidayManager::HolidayManager() :
|
||||
m_iHookID(0),
|
||||
m_isHolidayForward(NULL),
|
||||
m_bInMap(false)
|
||||
{
|
||||
bool actualres = DETOUR_STATIC_CALL(IsHolidayActive)(holiday);
|
||||
if (!g_isHolidayForward)
|
||||
}
|
||||
|
||||
void HolidayManager::OnSDKLoad(bool bLate)
|
||||
{
|
||||
m_bInMap = bLate;
|
||||
|
||||
plsys->AddPluginsListener(this);
|
||||
m_isHolidayForward = forwards->CreateForward("TF2_OnIsHolidayActive", ET_Event, 2, NULL, Param_Cell, Param_CellByRef);
|
||||
|
||||
SH_ADD_HOOK(IServerGameDLL, LevelShutdown, gamedll, SH_MEMBER(this, &HolidayManager::Hook_LevelShutdown), false);
|
||||
}
|
||||
|
||||
void HolidayManager::OnSDKUnload()
|
||||
{
|
||||
UnhookIfNecessary();
|
||||
SH_REMOVE_HOOK(IServerGameDLL, LevelShutdown, gamedll, SH_MEMBER(this, &HolidayManager::Hook_LevelShutdown), false);
|
||||
|
||||
plsys->RemovePluginsListener(this);
|
||||
forwards->ReleaseForward(m_isHolidayForward);
|
||||
}
|
||||
|
||||
void HolidayManager::OnServerActivated()
|
||||
{
|
||||
m_bInMap = true;
|
||||
|
||||
HookIfNecessary();
|
||||
}
|
||||
|
||||
void HolidayManager::Hook_LevelShutdown()
|
||||
{
|
||||
// GameRules is going away momentarily. Unhook before it does.
|
||||
UnhookIfNecessary();
|
||||
|
||||
m_bInMap = false;
|
||||
}
|
||||
|
||||
void HolidayManager::HookIfNecessary()
|
||||
{
|
||||
// Already hooked
|
||||
if (m_iHookID)
|
||||
return;
|
||||
|
||||
// Nothing wants us
|
||||
if (m_isHolidayForward->GetFunctionCount() == 0)
|
||||
return;
|
||||
|
||||
void *pGameRules = GetGameRules();
|
||||
if (!pGameRules)
|
||||
{
|
||||
if (m_bInMap)
|
||||
{
|
||||
g_pSM->LogError(myself, "Gamerules ptr not found. TF2_OnIsHolidayActive will not be available.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static int offset = -1;
|
||||
if (offset == -1)
|
||||
{
|
||||
if (!g_pGameConf->GetOffset("IsHolidayActive", &offset))
|
||||
{
|
||||
g_pSM->LogError(myself, "IsHolidayActive gamedata offset missing. TF2_OnIsHolidayActive will not be available.");
|
||||
return;
|
||||
}
|
||||
|
||||
SH_MANUALHOOK_RECONFIGURE(IsHolidayActive, offset, 0, 0);
|
||||
}
|
||||
|
||||
m_iHookID = SH_ADD_MANUALHOOK(IsHolidayActive, pGameRules, SH_MEMBER(this, &HolidayManager::Hook_IsHolidayActive), false);
|
||||
}
|
||||
|
||||
void HolidayManager::UnhookIfNecessary()
|
||||
{
|
||||
// Not hooked
|
||||
if (!m_iHookID)
|
||||
return;
|
||||
|
||||
// We're still wanted
|
||||
if (m_isHolidayForward->GetFunctionCount() > 0)
|
||||
return;
|
||||
|
||||
SH_REMOVE_HOOK_ID(m_iHookID);
|
||||
m_iHookID = 0;
|
||||
}
|
||||
|
||||
void HolidayManager::OnPluginLoaded(IPlugin *plugin)
|
||||
{
|
||||
HookIfNecessary();
|
||||
}
|
||||
|
||||
void HolidayManager::OnPluginUnloaded(IPlugin *plugin)
|
||||
{
|
||||
UnhookIfNecessary();
|
||||
}
|
||||
|
||||
bool HolidayManager::Hook_IsHolidayActive(int holiday)
|
||||
{
|
||||
void *pGameRules = META_IFACEPTR(void *);
|
||||
|
||||
bool actualres = SH_MCALL(pGameRules, IsHolidayActive)(holiday);
|
||||
if (!m_isHolidayForward)
|
||||
{
|
||||
g_pSM->LogMessage(myself, "Invalid Forward");
|
||||
return actualres;
|
||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||
}
|
||||
|
||||
cell_t result = 0;
|
||||
cell_t newres = actualres ? 1 : 0;
|
||||
|
||||
g_isHolidayForward->PushCell(holiday);
|
||||
g_isHolidayForward->PushCellByRef(&newres);
|
||||
g_isHolidayForward->Execute(&result);
|
||||
|
||||
m_isHolidayForward->PushCell(holiday);
|
||||
m_isHolidayForward->PushCellByRef(&newres);
|
||||
m_isHolidayForward->Execute(&result);
|
||||
|
||||
if (result > Pl_Continue)
|
||||
{
|
||||
return (newres == 0) ? false : true;
|
||||
RETURN_META_VALUE(MRES_SUPERCEDE, (newres == 0) ? false : true);
|
||||
}
|
||||
|
||||
return actualres;
|
||||
}
|
||||
|
||||
bool InitialiseIsHolidayDetour()
|
||||
{
|
||||
isHolidayDetour = DETOUR_CREATE_STATIC(IsHolidayActive, "IsHolidayActive");
|
||||
|
||||
if (isHolidayDetour != NULL)
|
||||
{
|
||||
isHolidayDetour->EnableDetour();
|
||||
return true;
|
||||
}
|
||||
|
||||
g_pSM->LogError(myself, "IsHolidayActive detour failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
void RemoveIsHolidayDetour()
|
||||
{
|
||||
isHolidayDetour->Destroy();
|
||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||
}
|
||||
|
||||
@@ -33,13 +33,46 @@
|
||||
#define _INCLUDE_SOURCEMOD_HOLIDAY_H_
|
||||
|
||||
#include "extension.h"
|
||||
#include <jit/jit_helpers.h>
|
||||
#include <jit/x86/x86_macros.h>
|
||||
#include "CDetour/detours.h"
|
||||
#include <ISDKTools.h>
|
||||
|
||||
bool InitialiseIsHolidayDetour();
|
||||
void RemoveIsHolidayDetour();
|
||||
class HolidayManager : public IPluginsListener
|
||||
{
|
||||
public:
|
||||
HolidayManager();
|
||||
|
||||
extern IForward *g_isHolidayForward;
|
||||
public:
|
||||
void OnSDKLoad(bool bLate);
|
||||
void OnSDKUnload();
|
||||
void OnServerActivated();
|
||||
|
||||
public: //IPluginsListener
|
||||
void OnPluginLoaded(IPlugin *plugin);
|
||||
void OnPluginUnloaded(IPlugin *plugin);
|
||||
|
||||
public:
|
||||
bool Hook_IsHolidayActive(int holiday);
|
||||
void Hook_LevelShutdown();
|
||||
|
||||
private:
|
||||
bool IsHookEnabled() const { return m_iHookID != 0; }
|
||||
void *GetGameRules();
|
||||
void HookIfNecessary();
|
||||
void UnhookIfNecessary();
|
||||
|
||||
private:
|
||||
int m_iHookID;
|
||||
IForward *m_isHolidayForward;
|
||||
bool m_bInMap;
|
||||
};
|
||||
|
||||
inline void *HolidayManager::GetGameRules()
|
||||
{
|
||||
if (!g_pSDKTools)
|
||||
return NULL;
|
||||
|
||||
return g_pSDKTools->GetGameRules();
|
||||
}
|
||||
|
||||
extern HolidayManager g_HolidayManager;
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_HOLIDAY_H_
|
||||
|
||||
+83
-15
@@ -34,6 +34,8 @@
|
||||
#include "time.h"
|
||||
#include "RegNatives.h"
|
||||
|
||||
#include <ISDKTools.h>
|
||||
|
||||
// native TF2_MakeBleed(client, attacker, Float:duration)
|
||||
cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
@@ -553,25 +555,41 @@ cell_t TF2_IsPlayerInDuel(IPluginContext *pContext, const cell_t *params)
|
||||
// native bool:TF2_IsHolidayActive(TFHoliday:holiday);
|
||||
cell_t TF2_IsHolidayActive(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// UTIL_IsHolidayActive(int)
|
||||
if (!pWrapper)
|
||||
void *pGameRules;
|
||||
if (!g_pSDKTools || !(pGameRules = g_pSDKTools->GetGameRules()))
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("IsHolidayActive",
|
||||
PassInfo pass[1]; \
|
||||
pass[0].flags = PASSFLAG_BYVAL; \
|
||||
pass[0].size = sizeof(int); \
|
||||
pass[0].type = PassType_Basic; \
|
||||
PassInfo ret; \
|
||||
ret.flags = PASSFLAG_BYVAL; \
|
||||
ret.size = sizeof(bool); \
|
||||
ret.type = PassType_Basic; \
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_Cdecl, &ret, pass, 1))
|
||||
return pContext->ThrowNativeError("Failed to find GameRules");
|
||||
}
|
||||
|
||||
unsigned char vstk[sizeof(int)];
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
// CTFGameRules::IsHolidayActive(int)
|
||||
if (!pWrapper)
|
||||
{
|
||||
int offset;
|
||||
if (!g_pGameConf->GetOffset("IsHolidayActive", &offset))
|
||||
{
|
||||
return pContext->ThrowNativeError("Failed to locate function");
|
||||
}
|
||||
|
||||
PassInfo pass[1];
|
||||
pass[0].flags = PASSFLAG_BYVAL;
|
||||
pass[0].size = sizeof(int);
|
||||
pass[0].type = PassType_Basic;
|
||||
PassInfo ret;
|
||||
ret.flags = PASSFLAG_BYVAL;
|
||||
ret.size = sizeof(bool);
|
||||
ret.type = PassType_Basic;
|
||||
|
||||
pWrapper = g_pBinTools->CreateVCall(offset, 0, 0, &ret, pass, 1);
|
||||
|
||||
g_RegNatives.Register(pWrapper);
|
||||
}
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(int)];
|
||||
unsigned char *vptr = vstk;
|
||||
*(void **)vptr = pGameRules;
|
||||
vptr += sizeof(void *);
|
||||
*(int *)vptr = params[1];
|
||||
|
||||
bool retValue;
|
||||
@@ -581,6 +599,55 @@ cell_t TF2_IsHolidayActive(IPluginContext *pContext, const cell_t *params)
|
||||
return (retValue) ? 1 : 0;
|
||||
}
|
||||
|
||||
cell_t TF2_RemoveWearable(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
|
||||
//CBasePlayer::RemoveWearable(CEconWearable *)
|
||||
|
||||
if (!pWrapper)
|
||||
{
|
||||
int offset;
|
||||
|
||||
if (!g_pGameConf->GetOffset("RemoveWearable", &offset))
|
||||
{
|
||||
return pContext->ThrowNativeError("Failed to locate function");
|
||||
}
|
||||
|
||||
PassInfo pass[1];
|
||||
pass[0].flags = PASSFLAG_BYVAL;
|
||||
pass[0].size = sizeof(CBaseEntity *);
|
||||
pass[0].type = PassType_Basic;
|
||||
|
||||
pWrapper = g_pBinTools->CreateVCall(offset, 0, 0, NULL, pass, 1);
|
||||
|
||||
g_RegNatives.Register(pWrapper);
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity = UTIL_GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
CBaseEntity *pWearable;
|
||||
if (!(pWearable = UTIL_GetCBaseEntity(params[2], false)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Wearable index %d is not valid", params[2]);
|
||||
}
|
||||
|
||||
unsigned char vstk[sizeof(void *) + sizeof(CBaseEntity *)];
|
||||
unsigned char *vptr = vstk;
|
||||
|
||||
*(void **)vptr = (void *)pEntity;
|
||||
vptr += sizeof(void *);
|
||||
*(CBaseEntity **)vptr = pWearable;
|
||||
|
||||
pWrapper->Execute(vstk, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_TFNatives[] =
|
||||
{
|
||||
{"TF2_IgnitePlayer", TF2_Burn},
|
||||
@@ -598,5 +665,6 @@ sp_nativeinfo_t g_TFNatives[] =
|
||||
{"TF2_MakeBleed", TF2_MakeBleed},
|
||||
{"TF2_IsPlayerInDuel", TF2_IsPlayerInDuel},
|
||||
{"TF2_IsHolidayActive", TF2_IsHolidayActive},
|
||||
{"TF2_RemoveWearable", TF2_RemoveWearable},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -1077,6 +1077,9 @@ bool TopMenu::LoadConfiguration(const char *file, char *error, size_t maxlength)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_SerialNo++;
|
||||
m_bCatsNeedResort = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1161,6 +1164,17 @@ SMCResult TopMenu::ReadSMC_NewSection(const SMCStates *states, const char *name)
|
||||
cur_cat->name = m_Config.strings.AddString(name);
|
||||
m_Config.cats.push_back(cur_cat);
|
||||
current_parse_state = PARSE_STATE_CATEGORY;
|
||||
|
||||
// This category needs reordering now that the sorting file is defining something new for it.
|
||||
for (unsigned int i = 0; i < (unsigned int)m_Categories.size(); i++)
|
||||
{
|
||||
if (strcmp(name, m_Categories[i]->obj->name) == 0)
|
||||
{
|
||||
m_Categories[i]->reorder = true;
|
||||
m_Categories[i]->serial++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -233,6 +233,7 @@
|
||||
"game" "nmrih"
|
||||
"game" "berimbau"
|
||||
"game" "cstrike"
|
||||
"game" "synergy"
|
||||
}
|
||||
|
||||
"Keys"
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
"EntityFactoryCaller"
|
||||
{
|
||||
"library" "server"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x89\x45"
|
||||
"linux" "\xA1\x2A\x2A\x2A\x2A\xC7\x2A\x2A\x00\x00\x00\x00\xC7\x2A\x2A\x00\x00\x00\x00\x85\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x89\x2A\x2A\x89\x2A\x2A\xE8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
// This is the offset into the address found by the EntityFactoryCaller signature.
|
||||
"EntityFactoryCallOffset"
|
||||
{
|
||||
"linux" "10"
|
||||
"linux" "41"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,127 +11,6 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "synergy"
|
||||
"game" "nmrih"
|
||||
"game" "empires"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CBaseTempEntity constructor */
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"windows" "19"
|
||||
"linux" "20"
|
||||
}
|
||||
"GetTEName"
|
||||
{
|
||||
"windows" "4"
|
||||
"linux" "4"
|
||||
"mac" "4"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows" "8"
|
||||
"linux" "8"
|
||||
"mac" "8"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows" "0"
|
||||
"linux" "0"
|
||||
"mac" "0"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"CBaseTempEntity"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
|
||||
"linux" "\x55\x89\xE5\x8B\x45\x08\x8B\x55\x0C\xC7\x2A\x2A\x2A\x2A\x2A\x89\x50\x04\x8B\x15\x2A\x2A\x2A\x2A\xA3"
|
||||
}
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CGlobalEntityList */
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "synergy"
|
||||
"game" "nmrih"
|
||||
"game" "empires"
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* Functions in CGlobalEntityList */
|
||||
"FindEntityByClassname"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x83\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x85\xC0\x74\x2A\x8B\x10\x89\x04\x24\xFF\x52\x0C\x8B\x55\x08\x8B\x00\x25\xFF\x0F\x00\x00\xC1\xE0\x04\x8B\x2A\x2A\x2A\xEB\x15\x66"
|
||||
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* General GameRules */
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "synergy"
|
||||
"game" "nmrih"
|
||||
"game" "empires"
|
||||
}
|
||||
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "2"
|
||||
"linux" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* This signature sometimes has multiple matches, but this
|
||||
* does not matter as g_pGameRules is involved in all of them.
|
||||
* The same g_pGameRules offset applies to each match.
|
||||
*
|
||||
* Sometimes this block of bytes is at the beginning of the static
|
||||
* CreateGameRulesObject function and sometimes it is in the middle
|
||||
* of an entirely different function. This depends on the game.
|
||||
*/
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
|
||||
"linux" "\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x85\xC0\x74\x08\x8B\x10\x89"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@g_pGameRules"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* IServer interface pointer */
|
||||
"#default"
|
||||
{
|
||||
@@ -169,7 +48,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* EntityFactoryDictionary function */
|
||||
/* No longer necessary. Remove later. */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
@@ -184,26 +63,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"#default"
|
||||
{
|
||||
"#supported"
|
||||
{
|
||||
"game" "synergy"
|
||||
"game" "empires"
|
||||
}
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\x2A\x8B\x45\x2A\x53\x56\x8B\x2A\x2A\x57\x8B\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\xC7"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x65\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x31\xC0\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* SetUserInfo data */
|
||||
"#default"
|
||||
{
|
||||
|
||||
@@ -11,6 +11,121 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CBaseTempEntity constructor */
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"windows" "19"
|
||||
"linux" "20"
|
||||
}
|
||||
"GetTEName"
|
||||
{
|
||||
"windows" "4"
|
||||
"linux" "4"
|
||||
"mac" "4"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows" "8"
|
||||
"linux" "8"
|
||||
"mac" "8"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows" "0"
|
||||
"linux" "0"
|
||||
"mac" "0"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"CBaseTempEntity"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
|
||||
"linux" "\x55\x89\xE5\x8B\x45\x08\x8B\x55\x0C\xC7\x2A\x2A\x2A\x2A\x2A\x89\x50\x04\x8B\x15\x2A\x2A\x2A\x2A\xA3"
|
||||
}
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CGlobalEntityList */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
/* Functions in CGlobalEntityList */
|
||||
"FindEntityByClassname"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x83\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x85\xC0\x74\x2A\x8B\x10\x89\x04\x24\xFF\x52\x0C\x8B\x55\x08\x8B\x00\x25\xFF\x0F\x00\x00\xC1\xE0\x04\x8B\x2A\x2A\x2A\xEB\x15\x66"
|
||||
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* General GameRules */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "2"
|
||||
"linux" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* This signature sometimes has multiple matches, but this
|
||||
* does not matter as g_pGameRules is involved in all of them.
|
||||
* The same g_pGameRules offset applies to each match.
|
||||
*
|
||||
* Sometimes this block of bytes is at the beginning of the static
|
||||
* CreateGameRulesObject function and sometimes it is in the middle
|
||||
* of an entirely different function. This depends on the game.
|
||||
*/
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
|
||||
"linux" "\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x85\xC0\x74\x08\x8B\x10\x89"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@g_pGameRules"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\x2A\x8B\x45\x2A\x53\x56\x8B\x2A\x2A\x57\x8B\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\xC7"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x65\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x31\xC0\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"empires"
|
||||
{
|
||||
"Offsets"
|
||||
|
||||
@@ -167,9 +167,9 @@
|
||||
}
|
||||
"CommitSuicide"
|
||||
{
|
||||
"windows" "441"
|
||||
"linux" "441"
|
||||
"mac" "441"
|
||||
"windows" "442"
|
||||
"linux" "442"
|
||||
"mac" "442"
|
||||
}
|
||||
"GetVelocity"
|
||||
{
|
||||
|
||||
@@ -11,6 +11,119 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CBaseTempEntity constructor */
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"windows" "19"
|
||||
}
|
||||
"GetTEName"
|
||||
{
|
||||
"windows" "4"
|
||||
"linux" "4"
|
||||
"mac" "4"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows" "8"
|
||||
"linux" "8"
|
||||
"mac" "8"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows" "0"
|
||||
"linux" "0"
|
||||
"mac" "0"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"CBaseTempEntity"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\xC1\x8B\x4D\x2A\xC7\x00\x2A\x2A\x2A\x2A\x89\x48"
|
||||
}
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"library" "server"
|
||||
"linux" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
|
||||
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CGlobalEntityList */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
/* Functions in CGlobalEntityList */
|
||||
"FindEntityByClassname"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x2A\x57\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\xFF\xD2\x8B\x00\x25\xFF\x0F\x00\x00\x40\x03\xC0\x8B\x3C\xC6\xEB\x2A\x8B"
|
||||
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* General GameRules */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "2"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* This signature sometimes has multiple matches, but this
|
||||
* does not matter as g_pGameRules is involved in all of them.
|
||||
* The same g_pGameRules offset applies to each match.
|
||||
*
|
||||
* Sometimes this block of bytes is at the beginning of the static
|
||||
* CreateGameRulesObject function and sometimes it is in the middle
|
||||
* of an entirely different function. This depends on the game.
|
||||
*/
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2A\x8B\x01\x8B\x50\x2A\x6A\x01\xFF\xD2"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"library" "server"
|
||||
"linux" "@g_pGameRules"
|
||||
"mac" "@g_pGameRules"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57\x89"
|
||||
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* No More Room in Hell */
|
||||
"nmrih"
|
||||
{
|
||||
@@ -107,15 +220,5 @@
|
||||
"mac" "253"
|
||||
}
|
||||
}
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x71\x2A\x57\x89"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x65\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x31\xC0\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89\x2A\x2A\x2A\x2A\x2A\x89"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,121 @@
|
||||
|
||||
"Games"
|
||||
{
|
||||
/* General Temp Entities */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CBaseTempEntity constructor */
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"windows" "16"
|
||||
"linux" "20"
|
||||
}
|
||||
"GetTEName"
|
||||
{
|
||||
"windows" "4"
|
||||
"linux" "4"
|
||||
"mac" "4"
|
||||
}
|
||||
"GetTENext"
|
||||
{
|
||||
"windows" "8"
|
||||
"linux" "8"
|
||||
"mac" "8"
|
||||
}
|
||||
"TE_GetServerClass"
|
||||
{
|
||||
"windows" "0"
|
||||
"linux" "0"
|
||||
"mac" "0"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
"CBaseTempEntity"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\x45\x08\x89\x41\x04\xC7\x01\x2A\x2A\x2A\x2A\xA1"
|
||||
"linux" "\x55\x89\xE5\x8B\x45\x08\x8B\x55\x0C\xC7\x2A\x2A\x2A\x2A\x2A\x89\x50\x04\x8B\x15\x2A\x2A\x2A\x2A\xA3"
|
||||
}
|
||||
"s_pTempEntities"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@_ZN15CBaseTempEntity15s_pTempEntitiesE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CGlobalEntityList */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
/* Functions in CGlobalEntityList */
|
||||
"FindEntityByClassname"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x53\x56\x57\x8B\xF9\x8B\x4D\x08\x85\xC9\x74\x15"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x83\x2A\x2A\x8B\x2A\x2A\x8B\x2A\x2A\x85\xC0\x74\x2A\x8B\x10\x89\x04\x24\xFF\x52\x0C\x8B\x55\x08\x8B\x00\x25\xFF\x0F\x00\x00\xC1\xE0\x04\x8B\x2A\x2A\x2A\xEB\x15\x66"
|
||||
"mac" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* General GameRules */
|
||||
"#default"
|
||||
{
|
||||
"Offsets"
|
||||
{
|
||||
/* Offset into CreateGameRulesObject */
|
||||
"g_pGameRules"
|
||||
{
|
||||
"windows" "5"
|
||||
"linux" "1"
|
||||
}
|
||||
}
|
||||
|
||||
"Signatures"
|
||||
{
|
||||
/* This signature sometimes has multiple matches, but this
|
||||
* does not matter as g_pGameRules is involved in all of them.
|
||||
* The same g_pGameRules offset applies to each match.
|
||||
*
|
||||
* Sometimes this block of bytes is at the beginning of the static
|
||||
* CreateGameRulesObject function and sometimes it is in the middle
|
||||
* of an entirely different function. This depends on the game.
|
||||
*/
|
||||
"CreateGameRulesObject"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x07"
|
||||
"linux" "\xA1\x2A\x2A\x2A\x2A\x8B\x5D\x08\x85\xC0\x74\x08\x8B\x10\x89"
|
||||
}
|
||||
"g_pGameRules"
|
||||
{
|
||||
"library" "server"
|
||||
"mac" "@g_pGameRules"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* CBaseEntityOutput::FireOutput */
|
||||
"#default"
|
||||
{
|
||||
"Signatures"
|
||||
{
|
||||
"FireOutput"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x53\x8B\x5D\x20\x8B\xC1\x8B\x4D\x1C\x56\x57\x8B"
|
||||
"linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x2A\x2A\x2A\x2A\xC7\x85\xDC\xFE\xFF\xFF\x00\x00\x00\x00\x8B"
|
||||
"mac" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"synergy"
|
||||
{
|
||||
"Offsets"
|
||||
|
||||
@@ -89,14 +89,14 @@
|
||||
"CSWeaponDrop"//Wildcard first 6 bytes for CS:S DM
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x81\xEC\x2A\x2A\x2A\x2A\x56\x8B\x75\x2A\x57\x6A\x00\x68"
|
||||
"linux" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
|
||||
"mac" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
|
||||
"windows" "\x2A\x2A\x2A\x2A\x2A\x2A\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\x5D\x08\x56\x57\x6A\x00\x68"
|
||||
"linux" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeapon6Vectorb"
|
||||
"mac" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeapon6Vectorb"
|
||||
}
|
||||
"TerminateRound"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x8B\xF1\xF3\x0F\x2A\x2A\x2A\x2A\x57\x33\xFF\x89\x2A\x2A\x2A\xC7\x2A\x2A\x2A\x00\x00\x00\x00"
|
||||
"windows" "\x55\x8B\xEC\x83\x2A\x2A\x83\x2A\x2A\x53\x56\x57\x8B\xF9\xF3\x0F\x2A\x2A\x2A\x2A\x33\xDB\xC7\x2A\x2A\x2A\x00\x00\x00\x00\x89"
|
||||
"linux" "@_ZN12CCSGameRules14TerminateRoundEfi"
|
||||
"mac" "@_ZN12CCSGameRules14TerminateRoundEfi"
|
||||
}
|
||||
|
||||
@@ -78,13 +78,6 @@
|
||||
"linux" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer"
|
||||
"mac" "@_ZN15CTFPlayerShared10StunPlayerEffiP9CTFPlayer"
|
||||
}
|
||||
"IsHolidayActive"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x83\x78\x30\x00\x74\x04\x32\xC0"
|
||||
"linux" "@_Z18TF_IsHolidayActivei"
|
||||
"mac" "@_Z18TF_IsHolidayActivei"
|
||||
}
|
||||
"MakeBleed"
|
||||
{
|
||||
"library" "server"
|
||||
@@ -106,6 +99,15 @@
|
||||
"linux" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer"
|
||||
"mac" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer"
|
||||
}
|
||||
|
||||
// Obsolete
|
||||
"IsHolidayActive"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\xA1\x2A\x2A\x2A\x2A\x83\x78\x30\x00\x74\x04\x32\xC0"
|
||||
"linux" "@_Z18TF_IsHolidayActivei"
|
||||
"mac" "@_Z18TF_IsHolidayActivei"
|
||||
}
|
||||
}
|
||||
"Offsets"
|
||||
{
|
||||
@@ -127,6 +129,21 @@
|
||||
"linux" "391"
|
||||
"mac" "391"
|
||||
}
|
||||
|
||||
// CTFGameRules::IsHolidayActive
|
||||
"IsHolidayActive"
|
||||
{
|
||||
"windows" "138"
|
||||
"linux" "139"
|
||||
"mac" "139"
|
||||
}
|
||||
|
||||
"RemoveWearable"
|
||||
{
|
||||
"windows" "426"
|
||||
"linux" "427"
|
||||
"mac" "427"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-34
@@ -58,22 +58,12 @@ new String:g_BanReasonsPath[PLATFORM_MAX_PATH];
|
||||
|
||||
#include "basebans/ban.sp"
|
||||
|
||||
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
|
||||
{
|
||||
BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt");
|
||||
if(LoadBanReasons())
|
||||
{
|
||||
return APLRes_Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
Format(error, err_max, "Couldn't load file %s: See log for details.", g_BanReasonsPath);
|
||||
return APLRes_Failure;
|
||||
}
|
||||
}
|
||||
|
||||
public OnPluginStart()
|
||||
{
|
||||
BuildPath(Path_SM, g_BanReasonsPath, sizeof(g_BanReasonsPath), "configs/banreasons.txt");
|
||||
|
||||
LoadBanReasons();
|
||||
|
||||
LoadTranslations("common.phrases");
|
||||
LoadTranslations("basebans.phrases");
|
||||
LoadTranslations("core.phrases");
|
||||
@@ -106,14 +96,7 @@ public OnPluginEnd()
|
||||
public OnMapStart()
|
||||
{
|
||||
//(Re-)Load BanReasons
|
||||
if(g_hKvBanReasons != INVALID_HANDLE)
|
||||
{
|
||||
CloseHandle(g_hKvBanReasons);
|
||||
}
|
||||
if(!LoadBanReasons())
|
||||
{
|
||||
SetFailState("Error trying to load or parse %s: See logfile for details", g_BanReasonsPath);
|
||||
}
|
||||
LoadBanReasons();
|
||||
}
|
||||
|
||||
public OnClientDisconnect(client)
|
||||
@@ -121,32 +104,32 @@ public OnClientDisconnect(client)
|
||||
g_IsWaitingForChatReason[client] = false;
|
||||
}
|
||||
|
||||
public bool:LoadBanReasons()
|
||||
LoadBanReasons()
|
||||
{
|
||||
if (g_hKvBanReasons != INVALID_HANDLE)
|
||||
{
|
||||
CloseHandle(g_hKvBanReasons);
|
||||
}
|
||||
|
||||
g_hKvBanReasons = CreateKeyValues("banreasons");
|
||||
|
||||
if(FileToKeyValues(g_hKvBanReasons, g_BanReasonsPath))
|
||||
{
|
||||
decl String:sectionName[255];
|
||||
if(!KvGetSectionName(g_hKvBanReasons, sectionName, sizeof(sectionName)))
|
||||
{
|
||||
LogMessage("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
|
||||
return false;
|
||||
return SetFailState("Error in %s: File corrupt or in the wrong format", g_BanReasonsPath);
|
||||
}
|
||||
|
||||
if(strcmp(sectionName, "banreasons") != 0)
|
||||
{
|
||||
LogMessage("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
|
||||
return false;
|
||||
return SetFailState("Error in %s: Couldn't find 'banreasons'", g_BanReasonsPath);
|
||||
}
|
||||
|
||||
//Reset kvHandle
|
||||
KvRewind(g_hKvBanReasons);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogMessage("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
|
||||
return false;
|
||||
} else {
|
||||
return SetFailState("Error in %s: File not found, corrupt or in the wrong format", g_BanReasonsPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ new g_GravityTarget[MAXPLAYERS+1];
|
||||
PerformGravity(client, target, Float:amount)
|
||||
{
|
||||
SetEntityGravity(target, amount);
|
||||
LogAction(client, target, "\"%L\" set gravity on \"%L\" to %d.", client, target, amount);
|
||||
LogAction(client, target, "\"%L\" set gravity on \"%L\" to %f.", client, target, amount);
|
||||
}
|
||||
|
||||
public AdminMenu_Gravity(Handle:topmenu,
|
||||
|
||||
@@ -154,47 +154,3 @@ native ClearTrie(Handle:map);
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native GetTrieSize(Handle:map);
|
||||
|
||||
/**
|
||||
* Creates a snapshot of all keys in the map. If the map is changed after this
|
||||
* call, the changes are not reflected in the snapshot. Keys are not sorted.
|
||||
*
|
||||
* @param map Map Handle.
|
||||
* @return New Map Snapshot Handle, which must be closed via CloseHandle().
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native Handle:CreateTrieSnapshot(Handle:map);
|
||||
|
||||
/**
|
||||
* Returns the number of keys in a map snapshot. Note that this may be
|
||||
* different from the size of the map, since the map can change after the
|
||||
* snapshot of its keys was taken.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @return Number of keys.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native TrieSnapshotLength(Handle:snapshot);
|
||||
|
||||
/**
|
||||
* Returns the buffer size required to store a given key. That is, it returns
|
||||
* the length of the key plus one.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @return Buffer size required to store the key string.
|
||||
* @error Invalid Handle or index out of range.
|
||||
*/
|
||||
native TrieSnapshotKeyBufferSize(Handle:snapshot, index);
|
||||
|
||||
/**
|
||||
* Retrieves the key string of a given key in a map snapshot.
|
||||
*
|
||||
* @param snapshot Map snapshot.
|
||||
* @param index Key index (starting from 0).
|
||||
* @param buffer String buffer.
|
||||
* @param maxlength Maximum buffer length.
|
||||
* @return Number of bytes written to the buffer.
|
||||
* @error Invalid Handle or index out of range.
|
||||
*/
|
||||
native GetTrieSnapshotKey(Handle:snapshot, index, String:buffer[], maxlength);
|
||||
|
||||
@@ -360,6 +360,18 @@ native bool:KeyValuesToFile(Handle:kv, const String:file[]);
|
||||
*/
|
||||
native bool:FileToKeyValues(Handle:kv, const String:file[]);
|
||||
|
||||
/**
|
||||
* Converts a given string to a KeyValues tree. The string is read into
|
||||
* the current postion of the tree.
|
||||
*
|
||||
* @param kv KeyValues Handle.
|
||||
* @param buffer String buffer to load into the KeyValues.
|
||||
* @param resourceName The resource name of the KeyValues, used for error tracking purposes.
|
||||
* @return True on success, false otherwise.
|
||||
* @error Invalid Handle.
|
||||
*/
|
||||
native bool:StringToKeyValues(Handle:kv, const String:buffer[], const String:resourceName[]="StringToKeyValues");
|
||||
|
||||
/**
|
||||
* Sets whether or not the KeyValues parser will read escape sequences.
|
||||
* For example, \n would be read as a literal newline. This defaults
|
||||
|
||||
@@ -448,3 +448,229 @@ stock ATTN_TO_SNDLEVEL(Float:attn)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the parameters for a game sound.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param channel Channel to emit with.
|
||||
* @param level Sound level.
|
||||
* @param volume Sound volume.
|
||||
* @param pitch Sound pitch.
|
||||
* @param sample Sound file name relative to the "sounds" folder.
|
||||
* @param maxlength Maximum length of sample string buffer.
|
||||
* @param entity Entity the sound is being emitted from.
|
||||
* @return True if the sound was successfully retrieved, false if it
|
||||
* was not found
|
||||
*/
|
||||
native bool:GetGameSoundParams(const String:gameSound[],
|
||||
&channel,
|
||||
&soundLevel,
|
||||
&Float:volume,
|
||||
&pitch,
|
||||
String:sample[],
|
||||
maxlength,
|
||||
entity=SOUND_FROM_PLAYER);
|
||||
|
||||
/**
|
||||
* Emits a game sound to a list of clients.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param clients Array of client indexes.
|
||||
* @param numClients Number of clients in the array.
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @return True if the sound was played successfully, false if it failed
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSound(const clients[],
|
||||
numClients,
|
||||
const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new channel;
|
||||
new level;
|
||||
new Float:volume;
|
||||
new pitch;
|
||||
new String:sample[PLATFORM_MAX_PATH];
|
||||
|
||||
if (GetGameSoundParams(gameSound, channel, level, volume, pitch, sample, sizeof(sample), entity))
|
||||
{
|
||||
EmitSound(clients, numClients, sample, entity, channel, level, flags, volume, pitch, speakerentity, origin, dir, updatePos, soundtime);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emits an ambient game sound.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param pos Origin of sound.
|
||||
* @param entity Entity index to associate sound with.
|
||||
* @param flags Sound flags.
|
||||
* @param delay Play delay.
|
||||
* @noreturn
|
||||
*/
|
||||
stock bool:EmitAmbientGameSound(const String:gameSound[],
|
||||
const Float:pos[3],
|
||||
entity = SOUND_FROM_WORLD,
|
||||
flags = SND_NOFLAGS,
|
||||
Float:delay = 0.0)
|
||||
{
|
||||
new channel; // This is never actually used for Ambients, but it's a mandatory field to GetGameSoundParams
|
||||
new level;
|
||||
new Float:volume;
|
||||
new pitch;
|
||||
new String:sample[PLATFORM_MAX_PATH];
|
||||
|
||||
if (GetGameSoundParams(gameSound, channel, level, volume, pitch, sample, sizeof(sample), entity))
|
||||
{
|
||||
EmitAmbientSound(sample, pos, entity, level, flags, volume, pitch, delay);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to emit a game sound to one client.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @noreturn
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSoundToClient(client,
|
||||
const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new clients[1];
|
||||
clients[0] = client;
|
||||
/* Save some work for SDKTools and remove SOUND_FROM_PLAYER references */
|
||||
entity = (entity == SOUND_FROM_PLAYER) ? client : entity;
|
||||
return EmitGameSound(clients, 1, gameSound, entity, flags,
|
||||
speakerentity, origin, dir, updatePos, soundtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper to emit game sound to all clients.
|
||||
*
|
||||
* Game sounds are found in a game's scripts/game_sound.txt or other files
|
||||
* referenced from it
|
||||
*
|
||||
* Note that if a game sound has a rndwave section, one of them will be returned
|
||||
* at random.
|
||||
*
|
||||
* @param gameSound Name of game sound.
|
||||
* @param entity Entity to emit from.
|
||||
* @param flags Sound flags.
|
||||
* @param speakerentity Unknown.
|
||||
* @param origin Sound origin.
|
||||
* @param dir Sound direction.
|
||||
* @param updatePos Unknown (updates positions?)
|
||||
* @param soundtime Alternate time to play sound for.
|
||||
* @noreturn
|
||||
* @error Invalid client index.
|
||||
*/
|
||||
stock bool:EmitGameSoundToAll(const String:gameSound[],
|
||||
entity = SOUND_FROM_PLAYER,
|
||||
flags = SND_NOFLAGS,
|
||||
speakerentity = -1,
|
||||
const Float:origin[3] = NULL_VECTOR,
|
||||
const Float:dir[3] = NULL_VECTOR,
|
||||
bool:updatePos = true,
|
||||
Float:soundtime = 0.0)
|
||||
{
|
||||
new clients[MaxClients];
|
||||
new total = 0;
|
||||
|
||||
for (new i=1; i<=MaxClients; i++)
|
||||
{
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
clients[total++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (!total)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return EmitGameSound(clients, total, gameSound, entity, flags,
|
||||
speakerentity, origin, dir, updatePos, soundtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Precache a game sound.
|
||||
*
|
||||
* Most games will precache all game sounds on map start, but this is not guaranteed...
|
||||
* Team Fortress 2 is known to not pre-cache MvM game mode sounds on non-MvM maps.
|
||||
*
|
||||
* Due to the above, this native should be called before any calls to GetGameSoundParams,
|
||||
* EmitGameSound*, or EmitAmbientGameSound.
|
||||
*
|
||||
* It should be safe to pass already precached game sounds to this function.
|
||||
*
|
||||
* Note: It precaches all files for a game sound.
|
||||
*
|
||||
* @param soundname Game sound to precache
|
||||
*
|
||||
* @return True if the game sound was found, false if sound did not exist
|
||||
* or had no files
|
||||
*/
|
||||
native bool:PrecacheScriptSound(const String:soundname[]);
|
||||
|
||||
@@ -359,6 +359,17 @@ native bool:TF2_IsHolidayActive(TFHoliday:holiday);
|
||||
*/
|
||||
native bool:TF2_IsPlayerInDuel(client);
|
||||
|
||||
/**
|
||||
* Removes an econ wearable (hat, misc, etc) from a player.
|
||||
* This also deletes the wearable entity.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @param wearable Index of the wearable entity.
|
||||
* @noreturn
|
||||
* @error Invalid client index, client not in game, invalid wearable entity, or no mod support.
|
||||
*/
|
||||
native TF2_RemoveWearable(client, wearable);
|
||||
|
||||
/**
|
||||
* Called after a condition is added to a player
|
||||
*
|
||||
@@ -436,5 +447,6 @@ public __ext_tf2_SetNTVOptional()
|
||||
MarkNativeAsOptional("TF2_GetClass");
|
||||
MarkNativeAsOptional("TF2_IsPlayerInDuel");
|
||||
MarkNativeAsOptional("TF2_IsHolidayActive");
|
||||
MarkNativeAsOptional("TF2_RemoveWearable");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -435,6 +435,20 @@ stock TF2_RemoveWeaponSlot(client, slot)
|
||||
new weaponIndex;
|
||||
while ((weaponIndex = GetPlayerWeaponSlot(client, slot)) != -1)
|
||||
{
|
||||
// bug #6206
|
||||
// papering over a valve bug where a weapon's extra wearables aren't properly removed from the weapon's owner
|
||||
new extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearable");
|
||||
if (extraWearable != -1)
|
||||
{
|
||||
TF2_RemoveWearable(client, extraWearable);
|
||||
}
|
||||
|
||||
extraWearable = GetEntPropEnt(weaponIndex, Prop_Send, "m_hExtraWearableViewModel");
|
||||
if (extraWearable != -1)
|
||||
{
|
||||
TF2_RemoveWearable(client, extraWearable);
|
||||
}
|
||||
|
||||
RemovePlayerItem(client, weaponIndex);
|
||||
AcceptEntityInput(weaponIndex, "Kill");
|
||||
}
|
||||
|
||||
@@ -125,36 +125,6 @@ public Action:RunTests(argc)
|
||||
if (GetTrieSize(trie))
|
||||
ThrowError("size should be 0");
|
||||
|
||||
SetTrieString(trie, "adventure", "time!");
|
||||
SetTrieString(trie, "butterflies", "bees");
|
||||
SetTrieString(trie, "egg", "egg");
|
||||
|
||||
new Handle:keys = CreateTrieSnapshot(trie);
|
||||
{
|
||||
if (TrieSnapshotLength(keys) != 3)
|
||||
ThrowError("trie snapshot length should be 3");
|
||||
|
||||
new bool:found[3];
|
||||
for (new i = 0; i < TrieSnapshotLength(keys); i++) {
|
||||
new size = TrieSnapshotKeyBufferSize(keys, i);
|
||||
new String:buffer[size];
|
||||
GetTrieSnapshotKey(keys, i, buffer, size);
|
||||
|
||||
if (strcmp(buffer, "adventure") == 0)
|
||||
found[0] = true;
|
||||
else if (strcmp(buffer, "butterflies") == 0)
|
||||
found[1] = true;
|
||||
else if (strcmp(buffer, "egg") == 0)
|
||||
found[2] = true;
|
||||
else
|
||||
ThrowError("unexpected key: %s", buffer);
|
||||
}
|
||||
|
||||
if (!found[0] || !found[1] || !found[2])
|
||||
ThrowError("did not find all keys");
|
||||
}
|
||||
CloseHandle(keys);
|
||||
|
||||
PrintToServer("All tests passed!");
|
||||
CloseHandle(trie);
|
||||
return Plugin_Handled;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.6.0-dev
|
||||
1.6.1
|
||||
|
||||
@@ -116,7 +116,7 @@ void *pc_opensrc(char *filename)
|
||||
}
|
||||
#endif
|
||||
|
||||
return fopen(filename,"rt");
|
||||
return fopen(filename,"rb");
|
||||
}
|
||||
|
||||
/* pc_createsrc()
|
||||
|
||||
@@ -1 +1 @@
|
||||
dev
|
||||
rel
|
||||
|
||||
Reference in New Issue
Block a user