Difference between revisions of "SourceMod 1.7.0 Release Notes"
(→Developer Changes) |
|||
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | =Overview= | |
+ | |||
+ | For users, SourceMod 1.7.0 is not much difference from an incremental release. Game compatibility is updated, some bugs are fixed, etc. Additionally, as some games switch to a newer Steam Id format, both the old and new can be used interchangeably in admin configs and commands. | ||
+ | |||
+ | |||
+ | For plugin developers, SourceMod 1.7.0 is a huge first step toward improving the SourcePawn language. A new, backwards-compatible [[SourcePawn Transitional Syntax]] has been added. With it come many new API additions and improvements. See the notes below for the full scoop. | ||
=Changelog= | =Changelog= | ||
===User Changes=== | ===User Changes=== | ||
− | * Rewrote internal Steam auth ID handling | + | * Updated game compatibility for TF2, CS:GO, and Dota 2.* |
+ | * Fixed regression in SM 1.6.3 causing load failure on games older than Orangebox. ({{pr|237}})* | ||
+ | * Rewrote internal Steam auth ID handling ({{pr|147}}, {{pr|153}}, {{pr|155}}, {{pr|162}}, {{pr|204}}, {{pr|210}}, {{pr|222}}, {{pr|246}}). | ||
** <tt>admins.cfg</tt> now supports Steam2, Steam3, and SteamID 64 formats for the Steam auth provider. | ** <tt>admins.cfg</tt> now supports Steam2, Steam3, and SteamID 64 formats for the Steam auth provider. | ||
** <tt>admins-simple.ini</tt> now supports Steam3 auth IDs in addition to Steam2 IDs. | ** <tt>admins-simple.ini</tt> now supports Steam3 auth IDs in addition to Steam2 IDs. | ||
** Command targeting now supports both Steam3 auth IDs in addition to Steam2 IDs. | ** Command targeting now supports both Steam3 auth IDs in addition to Steam2 IDs. | ||
− | * SDKTools' gamerules gamedata is now far less likely to break on updates. | + | * Added default timeout for MySQL connections to avoid hangs. ({{pr|248}}). |
− | * Fixed crash with sm_dump_admcache on Windows. | + | * Fixed <tt>sm plugins refresh</tt> not actually refreshing updated plugins like map change does ({{pr|257}}). |
− | * Fixed SDKHooks causing crash on player join/leave or plugin load/unload if gamedata missing. | + | * SDKTools' gamerules gamedata is now far less likely to break on updates ({{pr|220}}). |
+ | * Fixed crash with sm_dump_admcache on Windows ({{pr|163}}). | ||
+ | * Fixed SDKHooks causing crash on player join/leave or plugin load/unload if gamedata missing ({{pr|236}}). | ||
+ | * Changed default sm_trigger_show ConVar value to 0 / disabled. | ||
===Developer Changes=== | ===Developer Changes=== | ||
Line 17: | Line 27: | ||
** New methodmap-based APIs have been added for many existing functions and handle types. | ** New methodmap-based APIs have been added for many existing functions and handle types. | ||
** [https://sm.alliedmods.net/new-api New work-in-progress API doc page]. | ** [https://sm.alliedmods.net/new-api New work-in-progress API doc page]. | ||
− | * SDKHooks | + | * Added Blocked hook type to SDKHooks ({{pr|119}}) ({{user|49537|VoiDeD}}). |
− | * Many more File natives now support Valve FS. | + | * Added OnTakeDamage_Alive hook type to SDKHooks ({{pr|149}}). |
− | * Added SetFilePermissions native. | + | * Many more File natives now support Valve FS ({{pr|120}}, {{pr|169}}, {{pr|178}}). |
+ | * Added SetFilePermissions native ({{pr|43}}) ({{user|9967|hlstriker}}). | ||
* Added API for iterating StringMaps (formerly "tries"). | * Added API for iterating StringMaps (formerly "tries"). | ||
− | * Added natives for accessing command line parameters. | + | * Added natives for accessing command line parameters ({{pr|164}}) ({{user|49537|VoiDeD}}). |
− | * CloseHandle (or delete) on INVALID_HANDLE is now a no-op, instead of an error. | + | * Exposed engine Message_DetermineMulticastRecipients as GetClientsInRange native. ({{pr|234}}). |
+ | * CloseHandle (or delete) on INVALID_HANDLE is now a no-op, instead of an error ({{pr|74}}). | ||
* GetClientAuthString is now deprecated. Use [https://sm.alliedmods.net/new-api/clients/GetClientAuthId GetClientAuthId] instead. | * GetClientAuthString is now deprecated. Use [https://sm.alliedmods.net/new-api/clients/GetClientAuthId GetClientAuthId] instead. | ||
− | * Added OnCoreMapEnd to extension interface. | + | * Added OnCoreMapEnd to extension interface ({{pr|127}}). |
− | * TFHoliday updates no longer require a plugin recompile. | + | * Fixed IThreader threads leaking if they're not joined. ({{bz|3460}}, {{pr|241}}) |
− | * Fixed FindFlagChar returning false when passing AdminFlag_Custom6 ({{bz|6248}}). | + | * TFHoliday updates no longer require a plugin recompile ({{pr|217}}). |
− | * Added support for (entity) CLASSPTR and EDICT Prop_Data fields with GetEntPropEnt and SetEntPropEnt. | + | * Fixed FindFlagChar returning false when passing AdminFlag_Custom6 ({{bz|6248}}, {{pr|203}}). |
− | * Added support for custom default values with GetEvent* natives, rather than using ""/0 for unset fields. | + | * Added support for (entity) CLASSPTR and EDICT Prop_Data fields with GetEntPropEnt and SetEntPropEnt ({{pr|83}}). |
− | * Removed old profiler, and added new, pluggable profiler (with hooks to VProf). | + | * Doubled maximum handle count per plugin to 32,768 ({{pr|215}}), (Thordin). |
+ | * Added support for custom default values with GetEvent* natives, rather than using ""/0 for unset fields ({{pr|157}}) ({{user|49537|VoiDeD}}). | ||
+ | * Removed old profiler, and added new, pluggable profiler (with hooks to VProf) ({{pr|54}}). | ||
+ | * Added command to dump profiler output ({{pr|128}}) ({{user|49537|VoiDeD}}). | ||
+ | * Fixed ICommandLine and related features being reported as unavailable on Dark Messiah.* | ||
+ | * Fixed OnPlayerRunCommand forward in SDKTools being unavailable on Dark Messiah.* | ||
* SourceMod now uses some C++11 and has newer compiler requirements. | * SourceMod now uses some C++11 and has newer compiler requirements. | ||
* Added --disable-auto-versioning option to ambuild configure script. | * Added --disable-auto-versioning option to ambuild configure script. | ||
+ | |||
+ | <nowiki>*</nowiki> These items are still new since SourceMod 1.6.3, but also exist in the unreleased 1.6.4-dev version. | ||
+ | |||
+ | =Developer Notes= | ||
+ | |||
+ | The biggest change for developers in SourceMod 1.7 is the new [[SourcePawn Transitional Syntax]], which adds some object-oriented capabilities to our API. The documentation on the transitional syntax has a comprehensive specification for all the changes, including examples. | ||
+ | |||
+ | If you want a very brief takeaway, here are the four new features to keep in mind: | ||
+ | # Declarations can now be written like in C# or Java. This is the new preferred syntax and will allow us to improve the language faster in the future. In newer declarations, <tt>String</tt> is renamed to <tt>char</tt> and <tt>Float</tt> is renamed to <tt>float</tt>. | ||
+ | # Instead of <tt>INVALID_HANDLE</tt>, there is a new <tt>null</tt> keyword. | ||
+ | # Instead of explicit tags, there is now a <tt>view_as<Tag></tt> expression that is preferred. | ||
+ | # Instead of <tt>CloseHandle</tt>, you can now use the new <tt>delete</tt> keyword. | ||
+ | |||
+ | We also note here some specific cases where compatibility with older scripts has been broken. These are source-level compatibility changes only - SourceMod will continue to run scripts compiled with SourceMod 1.6 and earlier. | ||
+ | |||
+ | # '''Coercing function types is now a warning.''' For example, passing a <tt>Function</tt>-tagged value to <tt>any</tt>, and then returning it as an <tt>int</tt>. The ability to coerce function types to plain values is a serious impediment to future improvements to SourcePawn. It is now a warning, and will be an error in a future version of SourcePawn. | ||
+ | # '''decl is deprecated'''. For new-style declarations, the <tt>decl</tt> keyword is not (and never will be) available. New-style declarations are always zeroed. For huge arrays in a critical path (such as a player loop in <tt>OnGameFrame</tt>), users should first estimate the time spent per-frame zeroing such arrays and then decide if they need to be hoisted outside the loop or made to be static. | ||
+ | # '''Multiple tag support has been removed.''' Previously, it was possible to specify multiple tags on an argument. For example, <tt>{Float,bool}:param</tt>. This syntax is no longer available. | ||
+ | # '''<tt>sizeof</tt> can no longer be used on indeterminate arrays.''' Previously, <tt>sizeof</tt> on an indeterminate array (an array whose size is not statically known) was a warning. It is now an error. | ||
+ | # '''Reserved keywords'''. We have taken the opportunity to reserve a number of keywords for future versions of SourcePawn. They don't do anything, and they have no semantics. They are only reserved now to mitigate any potential problems if we do need them in the future. They are: <tt>acquire</tt>, <tt>as</tt>, <tt>builtin</tt>, <tt>catch</tt>, <tt>cast_to</tt>, <tt>double</tt>, <tt>explicit</tt>, <tt>finally</tt>, <tt>foreach</tt>, <tt>implicit</tt>, <tt>import</tt>, <tt>in</tt>, <tt>int8</tt>, <tt>int16</tt>, <tt>int32</tt>, <tt>int64</tt>, <tt>intn</tt>, <tt>let</tt>, <tt>namespace</tt>, <tt>object</tt>, <tt>package</tt>, <tt>private</tt>, <tt>protected</tt>, <tt>readonly</tt>, <tt>sealed</tt>, <tt>throw</tt>, <tt>try</tt>, <tt>typeof</tt>, <tt>uint8</tt>, <tt>uint16</tt>, <tt>uint32</tt>, <tt>uint64</tt>, <tt>uintn</tt>, <tt>union</tt>, <tt>var</tt>, <tt>variant</tt>, <tt>volatile</tt>, <tt>with</tt>. | ||
+ | # '''<tt>sizeof</tt> no longer has magic meaning as a default argument expression.''' Previously, <tt>sizeof</tt> as a default argument expression would bind to the variable at its callsite, rather than the argument in parameter scope. This allowed users to create functions that did not seem to require an explicit size parameter alongside an array. This feature was buggy, so it has been removed, alongside similar magic binding for <tt>tagof</tt> and <tt>cellsof</tt> in default argument expressions. | ||
+ | # '''<tt>String[]</tt> and <tt>any</tt> no longer coerce'''. Previously, it was possible to coerce a character array to an <tt>any</tt> array, or vice-versa. This cast was unsafe because the storage widths of each array value are different (one normal array is four bytes per slot, and a character is one byte per slot). This coercion is now illegal. | ||
+ | # '''Using <tt>int</tt> or <tt>void</tt> as a tag is now a warning.''' | ||
+ | # '''Enums cannot be retagged.''' Previously, enums could be retagged - for example, <tt>enum X:Y { ...</tt>. This is no longer allowed. | ||
+ | # '''The implicit-int tag cannot be used as an enum tag.''' It is now illegal to use <tt>_</tt> as an enum name or label. | ||
+ | # '''Dynamically sized arrays are now indeterminate.''' Previously, an array could be declared as a mix of fixed-size and dynamic-sized dimensions. Now, all dimensions are considered indeterminate if any one dimension is dynamic-sized. This means <tt>sizeof</tt> may not work in complex array use. |
Latest revision as of 17:52, 4 February 2015
Overview
For users, SourceMod 1.7.0 is not much difference from an incremental release. Game compatibility is updated, some bugs are fixed, etc. Additionally, as some games switch to a newer Steam Id format, both the old and new can be used interchangeably in admin configs and commands.
For plugin developers, SourceMod 1.7.0 is a huge first step toward improving the SourcePawn language. A new, backwards-compatible SourcePawn Transitional Syntax has been added. With it come many new API additions and improvements. See the notes below for the full scoop.
Changelog
User Changes
- Updated game compatibility for TF2, CS:GO, and Dota 2.*
- Fixed regression in SM 1.6.3 causing load failure on games older than Orangebox. (PR 237)*
- Rewrote internal Steam auth ID handling (PR 147, PR 153, PR 155, PR 162, PR 204, PR 210, PR 222, PR 246).
- admins.cfg now supports Steam2, Steam3, and SteamID 64 formats for the Steam auth provider.
- admins-simple.ini now supports Steam3 auth IDs in addition to Steam2 IDs.
- Command targeting now supports both Steam3 auth IDs in addition to Steam2 IDs.
- Added default timeout for MySQL connections to avoid hangs. (PR 248).
- Fixed sm plugins refresh not actually refreshing updated plugins like map change does (PR 257).
- SDKTools' gamerules gamedata is now far less likely to break on updates (PR 220).
- Fixed crash with sm_dump_admcache on Windows (PR 163).
- Fixed SDKHooks causing crash on player join/leave or plugin load/unload if gamedata missing (PR 236).
- Changed default sm_trigger_show ConVar value to 0 / disabled.
Developer Changes
- Added new SourcePawn Transitional Syntax!
- New methodmap-based APIs have been added for many existing functions and handle types.
- New work-in-progress API doc page.
- Added Blocked hook type to SDKHooks (PR 119) (VoiDeD).
- Added OnTakeDamage_Alive hook type to SDKHooks (PR 149).
- Many more File natives now support Valve FS (PR 120, PR 169, PR 178).
- Added SetFilePermissions native (PR 43) (hlstriker).
- Added API for iterating StringMaps (formerly "tries").
- Added natives for accessing command line parameters (PR 164) (VoiDeD).
- Exposed engine Message_DetermineMulticastRecipients as GetClientsInRange native. (PR 234).
- CloseHandle (or delete) on INVALID_HANDLE is now a no-op, instead of an error (PR 74).
- GetClientAuthString is now deprecated. Use GetClientAuthId instead.
- Added OnCoreMapEnd to extension interface (PR 127).
- Fixed IThreader threads leaking if they're not joined. (bug 3460, PR 241)
- TFHoliday updates no longer require a plugin recompile (PR 217).
- Fixed FindFlagChar returning false when passing AdminFlag_Custom6 (bug 6248, PR 203).
- Added support for (entity) CLASSPTR and EDICT Prop_Data fields with GetEntPropEnt and SetEntPropEnt (PR 83).
- Doubled maximum handle count per plugin to 32,768 (PR 215), (Thordin).
- Added support for custom default values with GetEvent* natives, rather than using ""/0 for unset fields (PR 157) (VoiDeD).
- Removed old profiler, and added new, pluggable profiler (with hooks to VProf) (PR 54).
- Added command to dump profiler output (PR 128) (VoiDeD).
- Fixed ICommandLine and related features being reported as unavailable on Dark Messiah.*
- Fixed OnPlayerRunCommand forward in SDKTools being unavailable on Dark Messiah.*
- SourceMod now uses some C++11 and has newer compiler requirements.
- Added --disable-auto-versioning option to ambuild configure script.
* These items are still new since SourceMod 1.6.3, but also exist in the unreleased 1.6.4-dev version.
Developer Notes
The biggest change for developers in SourceMod 1.7 is the new SourcePawn Transitional Syntax, which adds some object-oriented capabilities to our API. The documentation on the transitional syntax has a comprehensive specification for all the changes, including examples.
If you want a very brief takeaway, here are the four new features to keep in mind:
- Declarations can now be written like in C# or Java. This is the new preferred syntax and will allow us to improve the language faster in the future. In newer declarations, String is renamed to char and Float is renamed to float.
- Instead of INVALID_HANDLE, there is a new null keyword.
- Instead of explicit tags, there is now a view_as<Tag> expression that is preferred.
- Instead of CloseHandle, you can now use the new delete keyword.
We also note here some specific cases where compatibility with older scripts has been broken. These are source-level compatibility changes only - SourceMod will continue to run scripts compiled with SourceMod 1.6 and earlier.
- Coercing function types is now a warning. For example, passing a Function-tagged value to any, and then returning it as an int. The ability to coerce function types to plain values is a serious impediment to future improvements to SourcePawn. It is now a warning, and will be an error in a future version of SourcePawn.
- decl is deprecated. For new-style declarations, the decl keyword is not (and never will be) available. New-style declarations are always zeroed. For huge arrays in a critical path (such as a player loop in OnGameFrame), users should first estimate the time spent per-frame zeroing such arrays and then decide if they need to be hoisted outside the loop or made to be static.
- Multiple tag support has been removed. Previously, it was possible to specify multiple tags on an argument. For example, {Float,bool}:param. This syntax is no longer available.
- sizeof can no longer be used on indeterminate arrays. Previously, sizeof on an indeterminate array (an array whose size is not statically known) was a warning. It is now an error.
- Reserved keywords. We have taken the opportunity to reserve a number of keywords for future versions of SourcePawn. They don't do anything, and they have no semantics. They are only reserved now to mitigate any potential problems if we do need them in the future. They are: acquire, as, builtin, catch, cast_to, double, explicit, finally, foreach, implicit, import, in, int8, int16, int32, int64, intn, let, namespace, object, package, private, protected, readonly, sealed, throw, try, typeof, uint8, uint16, uint32, uint64, uintn, union, var, variant, volatile, with.
- sizeof no longer has magic meaning as a default argument expression. Previously, sizeof as a default argument expression would bind to the variable at its callsite, rather than the argument in parameter scope. This allowed users to create functions that did not seem to require an explicit size parameter alongside an array. This feature was buggy, so it has been removed, alongside similar magic binding for tagof and cellsof in default argument expressions.
- String[] and any no longer coerce. Previously, it was possible to coerce a character array to an any array, or vice-versa. This cast was unsafe because the storage widths of each array value are different (one normal array is four bytes per slot, and a character is one byte per slot). This coercion is now illegal.
- Using int or void as a tag is now a warning.
- Enums cannot be retagged. Previously, enums could be retagged - for example, enum X:Y { .... This is no longer allowed.
- The implicit-int tag cannot be used as an enum tag. It is now illegal to use _ as an enum name or label.
- Dynamically sized arrays are now indeterminate. Previously, an array could be declared as a mix of fixed-size and dynamic-sized dimensions. Now, all dimensions are considered indeterminate if any one dimension is dynamic-sized. This means sizeof may not work in complex array use.