GLOBALELITE.PL GLOBALELITE.pl 83 Napisano 25 Sierpnia 2017 Share Napisano 25 Sierpnia 2017 This plugin fixes a rather silly bug in L4D2 where for some Steam Groups, setting sv_steamgroup correctly will link to a different Steam Group on the MOTD.This is required for anyone with a Steam Group ID higher than 16777216 (and only for those people) for the Join Group button to work correctly.Technical description: Spoiler ConVars in the L4D2 engine are represented by 3 internal values, a string value, a float value, and an int value. When you set and query a convar using the console or a config file it is the string value that is written and read. Setting one of these values sets the other two to appropriate values if applicable - so if the string value is set to "foo", the string value is "foo" and the int and float values are 0, if the value is "4.5" the string value is "4.5", the float value 4.5, and the int value 4. However, when setting the string value, the integer value is set from the float value, not directly.The bug here is that floating point numbers have a range where they have integer precision that is much smaller than integer numbers. Single-precision floats (as used here) can represent accurate integers between -16,777,216 and 16,777,216 whereas a signed integer can represent between -2,147,483,648 and 2,147,483,647 - a significant difference! (a Steam Group ID is actually an unsigned integer, which is 0 to 4,294,967,295, but these are not currently supported in SourcePawn or in cvars in L4D2.)This means that if your Steam Group ID is higher than 16777216, the integer value for sv_steamgroup is incorrect (it'll be either 2 or 4 numbers off in either direction depending on how much higher your group's ID is than the limit), and this is what the game uses to build the group URL on the MOTD.This plugin parses the string value whenever sv_steamgroup is changed and sets the integer value to the correct number directly. Enjoy! Attached Files Get Plugin or Get Source (sv_steamgroup_fixer.sp - 1.4 KB) Pełny artykuł: https://forums.alliedmods.net/showthread.php?t=300683&goto=newpost Odnośnik do odpowiedzi Udostępnij na innych stronach
Rekomendowane odpowiedzi