Raised This Month: $105 Target: $400
 26% 

SourceMod 1.12 Now Stable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 10-20-2024 , 14:36   SourceMod 1.12 Now Stable
Reply With Quote #1

SourceMod 1.12 is now the new stable, recommended version to use.

This has been another one of our longest times between stable releases, so the full changelog is quite large. There are numerous updates in this version, compared to 1.11. Here are some of the highlights:
  • Added or greatly improved support for five games and mods
  • Greatly improved 64-bit support
  • Many new natives added
  • Numerous bugs fixed

Shoutouts
We also want to take a moment to thank everyone that contributed to the release in any way, but a few specific callouts are warranted.

Kenzzer was a driving force with heavily improving 64-bit support, and doing a bulk of that work. This may soon be a requirement for Team Fortress 2 servers, and already is for some newer games, such as Military Conflict: Vietnam and Blade Symphony. You'll also see Digby and Mikusch showing up many times in the changelog. They both contributed many of the features and fixes. And finally, I also want to give a special mention to Sarrus for his awesome SourcePawn Studio extension for Visual Studio Code. It's a great tool for anyone developing SourceMod plugins.

Here is the full changelog. Italicized items were also backported to 1.11 after it went stable. As you can see, there are many contributors beyond the core team. Apologies if anything or anyone was missed.

Game support
  • Added support for Military Conflict: Vietnam - #1887
  • Added gamedata for GMod 9 (caatge) - #2093
  • Added gamedata for Pre-Fortress 2 (dangreene0) - #2091
  • Added gamedata for Open Fortress (sappho) - #2057
  • Added gamedata for TF2 Classic (sappho) - #2089
  • Numerous gamedata updates, SDK updates, and internal updates to maintain supported games

Features
  • Added support for bcompat references (edict indexes) as inputs to ReferenceToIndex (c0rp3n) - #1323
  • Added ParseTime native (Digby) - #1697
  • Added File.Size native, supporting both direct and valvefs files (Peak) - #2131
  • Added GetFilePermissions native (Kenzzer) - #2177
  • Added support for referencing any engine binary in gamedata, rather than only engine, server, and matchmaking_ds - #1626
  • Added block parameter to various ArrayList functions (Mikusch) - #1656
  • Added float suport for the modulo operator (%) (Mikusch) - #1953
  • Added Handle methodmap with Close and Clone methods
  • Added ArrayStack.Top, ArrayStack.TopString, and ArrayStack.TopArray natives and ArrayStack.Length property (Mikusch) - #2019
  • Added GetClientOriginalLanguage native (Digby) - #1810
  • Added SMCParser.ParseString native to load an SMC file from a char[] (Digby) - #1817
  • Added GetPublicChatTriggers and GetSilentChatTriggers natives (Digby) - #1816
  • Added OnServerEnterHibernation and OnServerExitHibernation forwards (ojlanders) - #2151
  • Added LoadEntityFromHandleAddress and StoreEntityToHandleAddress natives (nosoop) - #1830
  • Added support for accessing ConVar flags in CommandIterator - #1869
  • Updated KeyValues.Rewind native to make traversal stack clearing optional (Digby) - #1993
  • Updated topmenus to allow sorting with subcategories in config file (Peak) - #1757
  • Added TE_ReadEnt and TE_WriteEnt tempents natives for ehandle fields - #1905
  • Added ability to specify trace type on many TR_Trace* natives (vanz666) - Add custom sdktools trace types
  • Added explode parameter to ForcePlayerSuicide native (Mikusch) - #1782
  • Added SDKCall_Engine as new SDKCallType for IVEngineServer calls (accelerator74) - #1648
  • Added logging of vote cancellation and vote results (Rushaway) - #1794
  • Added sm_dsay command for sending HUD messages - #1889
  • Updated sm_nominate to be able to be used via console (dysphie) - #1803
  • Added support for SDKCall returning non-networked entities (FortyTwoFortyTwo) - #1797
  • Added natives for working with entity lumps (nosoop) #1673

Bug fixes
  • Fixed rare crash with logging (Kenzzer) - #2161
  • Standardized behavior of RenameFile across platforms when destination file exists (rtldg) - #2060
  • Fixed issues with CRC-based gamedata targeting not functioning properly
  • Fixed a case where nextmap functionality could get stuck in a loop - #1545
  • Fixed crash when parsing certain large SMC files (bottiger) - #2173
  • Fixed IsClientSourceTV native not functioning in L4D2 if tv_name was set to non-default value (adriansmares) #2143
  • Fixed CommandListeners only being blocked with Plugin_Stop rather than also Plugin_Handled (Digby) - #1819
  • Fixed server crash that would occur when RemoveEdict or RemoveEntity were called on worldspawn. An error is now thrown instead. (CookieCat45) - #2104
  • Fixed SetEntityHealth native to support entities with m_iHealth is not networked but exists in the datadesc (Kenzzer) - #1846
  • Fixed a recursion issue in ServerCommandEx on some games (ojlanders) - #2133
  • Fixed crash when calling SQL_LockDatabase twice on a db handle (Digby) - #1937
  • Fixed ForcePlayerSuicide native not working on some games if called too soon after previous call on a player (Mikusch) - #1782
  • Fixed a crash that could occur on TF2 if SDKTools was loaded and replay was enabled (hydrogen-mvm) - #2033
  • Fixed a crash that could occur in TF2_DisguisePlayer (KitRifty) - #2117
  • Fixed bypassHooks parameter in SDKHooks_DropWeapon being ignored in some cases (Rainyan) - https://github.com/alliedmodders/sourcemod/issues/1876
  • Fixed a crash that would occur upon DHooks load if SDKHooks could not be loaded - #1930
  • Fixed SDKCall VDECODE_FLAG_ALLOWNOTINGAME flag not working (1mpulse) - #2000
  • Fixed full map name not being logged in sm_map command when using inexact matching (Rushaway) - #1907
  • Fixed nextmap conflict on Dystopia (bauxiteDYS) - #2075
  • Fixed a case where gamedata values could be unintentionally overridden (nosoop) - #1859
  • Fixed a crash that could occur when trying to send a usermessage inside of a usermessage hook callback (zer0k-z) - #1883
  • Fixed maplist always being reparsed, even if file hadn't changed (clague) - #1891
  • Fixed a command injection issue in sm_play command (b0ink) - #1832
  • Fixed chat triggers being used as a ban reason when using sm_ban interactively (rainyan) - #2067

Miscellaneous
  • Multiple improvements with 64-bit support, by multiple people (Kenzzer, bottiger, KitRifty)
  • Reworked handling of edicts and entities to be safer and more consistenct, leading to stability improvements (Kenzzer) - #1903
  • Improved performance for HasEntProp (Digby) - #1908
  • Updated compiler targeting to C++17
  • Updated to SourcePawn 1.12
  • Brought language files in-tree, replacing the old, gated translator tool with a GitHub-based workflow that anyone can contribute with
  • Moved menu sounds moved to gamedata - #1896
  • Added support for building against hl2sdk-mock, for tests
  • Increased max supported players from 64 to 100 (65 to 101 with SourceTV) (sappho) - #2026
  • Improved sm plugins and sm exts client commands to not require pagination (zer0k) - #1862
  • Updated ShowHudText and ShowSyncHudText natives to thrown an error if params haven't been set - #1890
  • Updated SDKHooks to greatly improve performance on Linux when there are many hooks (KaelaSavia) - #2094
  • Updated multiple callbacks in SDKHooks to use highest result instead of last result, ex. Plugin_Stop always supersedes Plugin_Continue - #1872
  • Updated sm_help to no longer print hidden commands (Batfoxkid) - #1831
  • Restructured admin-flatfile script files for consistency - #2043
  • Improved ff command support on L4D and L4D2 (ambaca) - #1530
  • Improve messaging when nominated map is not in map pool (FlaminSarge) - #597

The Stable Builds download page now points to 1.12 builds, although 1.11 ones are still available and linked there. The Dev Builds page now points to the new 1.13 branch.

Last edited by psychonic; 10-20-2024 at 20:55.
psychonic is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 10-30-2024 , 00:20   Feature showcase
Reply With Quote #2

  • 1. Timers are no longer required to return anything (#1916)
PHP Code:
CreateTimer(1.0TimerCallback);

public 
void TimerCallback(Handle timer)
{
    
PrintToServer("No return value!");

  • 2. Cookies acquired new setters and getters for ints / floats (#1727)
PHP Code:
Cookie myCookie = new Cookie("my_cookie""description"CookieAccess_Protected);
ConVar defaultValueConvar CreateConVar("my_cookie_default""0""description"_true0.0true1.0);

// Check if a boolean preference is enabled
if (myCookie.GetInt(clientdefaultValueConvar.IntValue))
{
    
// User has turned this on or the server has this enabled by default
}

// Disable preference
myCookie.SetInt(client0);

// Enable preference
myCookie.SetInt(client1); 
  • 3. The way definitions (macros) are processed has been reworked. You can now pass strings to spcomp preprocessor. (SourcePawn 1.12)
PHP Code:
#include <sourcemod>

#if !defined FOO
    #define FOO "BAR"
#endif

public void OnPluginStart()
{
    
PrintToServer("FOO" ... FOO);

Powershell:
PHP Code:
# Prints FOOBAR
./spcomp.exe deftest.sp

# Prints FOO123
./spcomp.exe deftest.sp FOO=\`"123\`" 
This is more managable if you use Sarus's VSCode extension:
PHP Code:
"SourcePawnLanguageServer.compiler.arguments": [
    
"FOO=\"123\"",
    
"-O2",
    
"-v2"

  • 4. No more loose indentation warnings, no matter how loose you get. Hooray! (SourcePawn 1.12)
Now we can simplify this stock, which loads a detour from GameData and binds optional pre/post callbacks:
PHP Code:
stock void LoadDHookDetour(GameData pGameConfigDynamicDetourpHandle, const char[] szFuncNameDHookCallback pCallbackPre INVALID_FUNCTIONDHookCallback pCallbackPost INVALID_FUNCTION)
{
    
pHandle DynamicDetour.FromConf(pGameConfigszFuncName);
    if (!
pHandle)
        
SetFailState("Couldn't create hook %s"szFuncName);
    if (
pCallbackPre != INVALID_FUNCTION && !pHandle.Enable(Hook_PrepCallbackPre))
        
SetFailState("Couldn't enable pre detour hook %s"szFuncName);
    if (
pCallbackPost != INVALID_FUNCTION && !pHandle.Enable(Hook_PostpCallbackPost))
        
SetFailState("Couldn't enable post detour hook %s"szFuncName);

Into this:
PHP Code:
stock void LoadDHookDetour(GameData pGameConfigDynamicDetourpHandle, const char[] szFuncNameDHookCallback pCallbackPre nullDHookCallback pCallbackPost null)
{
    
pHandle DynamicDetour.FromConf(pGameConfigszFuncName);
    if (!
pHandle)
        
SetFailState("Couldn't create hook %s"szFuncName);
    if (
pCallbackPre && !pHandle.Enable(Hook_PrepCallbackPre))
        
SetFailState("Couldn't enable pre detour hook %s"szFuncName);
    if (
pCallbackPost && !pHandle.Enable(Hook_PostpCallbackPost))
        
SetFailState("Couldn't enable post detour hook %s"szFuncName);

  • 6. Any library loaded by the server can be called or hooked (#1626)
PHP Code:
"Signatures"
{
    
"CreateMatSysIface"
    
{
        
"library"       "materialsystem"
        "windows"       "@CreateInterface"
        "linux"         "@CreateInterface"
    
}

PHP Code:
// Call CreateInterface inside the materialsystem library

StartPrepSDKCall(SDKCall_Static);
if (!
PrepSDKCall_SetFromConf(gamedataSDKConf_Signature"CreateMatSysIface"))
    
SetFailState("Could not obtain signature");

PrepSDKCall_AddParameter(SDKType_StringSDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_PointerVDECODE_FLAG_ALLOWNULL);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldDataSDKPass_Plain);

Handle Call_CreateMatSysIface EndPrepSDKCall();
if (!
Call_CreateMatSysIface)
    
SetFailState("Could not prep SDKCall");

// Get your interface address

Address someInterface view_as<Address>(SDKCall(Call_CreateMatSysIface"NAME_OF_LIBRARY_INTERFACE_HERE"0));
if (!
someInterface)
    
SetFailState("Could not create interface");

// Call/hook your interface's functions. Use SDKCall_Raw and pass the interface address as first parameter. 
  • 7. Combining enum structs with ArrayList has gotten more powerful (#1656)
PHP Code:
enum struct MyStruct
{
    
int intValue;
    
int arrValue[3];
    
char strValue[64];
}

ArrayList list = new ArrayList(sizeof(MyStruct));
MyStruct struct1;
list.
PushArray(struct1);

// Find an index in the list by matching the strValue.
int index = list.FindString("bar"MyStruct::strValue);

// Get or set only the arrValue at specific index.
int arrBuffer[3];
list.
GetArray(0arrBuffersizeof(arrBuffer), MyStruct::arrValue);
list.
SetArray(0arrBuffersizeof(arrBuffer), MyStruct::arrValue);

// Get or set only the strValue at specific index.
char strBuffer[64];
list.
GetString(0strBuffersizeof(strBuffer), MyStruct::strValue);
list.
SetString(0"the grass was greener"MyStruct::strValue); 
  • 8. Alongside SDKCall_Server, SDKCall_Engine has also been added as a predefined call type (#1648)

Instead of painstakingly passing a pointer to CVEngineServer as the first parameter of each SDKCall, you can now implicitly mark the call as an engine call:
PHP Code:
StartPrepSDKCall(SDKCall_Engine); 
  • 9. ArrayStack has gotten less useless with new natives (#2019)
PHP Code:
ArrayStack.Top
ArrayStack
.TopString
ArrayStack
.TopArray
ArrayStack
.Length 
  • 10. Finally, typing "sm plugins 11" "sm plugins 22" in the client console is a relic of the past. (#1862)

Last edited by Alienmario; 10-30-2024 at 11:12.
Alienmario is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode