Skocz do zawartości
  • Drogi gościu!

    Tutaj możesz się zarejestrować lub zalogować:

[RSS Pluginy] [L4D2] sv_steamgroup fixer


GLOBALELITE.pl

Rekomendowane odpowiedzi

  • GLOBALELITE.PL
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 sp.gifGet 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

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający

    Brak zarejestrowanych użytkowników przeglądających tę stronę.


O GLOBALELITE.PL


Chcemy pokazać absolutnie wszystkim, że człowiek jest zdolny do rzeczy wielkich! Potrzebujemy tylko waszej pomocy. Dzięki ciężkiej pracy chcemy udowodnić, że razem możemy wszystko! Szukamy ludzi ambitnych i skorych do poświeceń, ludzi którzy są godni, aby dołączyć do globalnej elity społeczności, którą traktuje się jak drugą rodzinę!

Istniejemy od 2014 r.

Motyw zrobiony przez doc

Strona zarządzana przez: Adam Plicha

Linki społecznościowe

Gdzie można nas znaleźć?


Facebook Teamspeak Discord

Linki forumowe

Linki z różnego rodzaju podaniami


Podanie o admina Prośba o unbana Propozycja Złóż skargę

Administracja

Oni odpowiedzą na Twoje pytania ;)


×
×
  • Dodaj nową pozycję...