Is there a way to change a server's game description with SP? It's the string found in the 'Game' tab on the server browser:
SourceMod has 'OnGetGameDescription' for this, is there a way to achieve the same thing with SP?
Changing game description
Re: Changing game description
It requires a hook. For which game do you want this?
Re: Changing game description
Half Life 2: Deathmatch
Re: Changing game description
With version 319 you will be able to use this little snippet.
Syntax: Select all
from memory import get_virtual_function
from memory.hooks import PreHook
from engines.server import server_game_dll
@PreHook(get_virtual_function(server_game_dll, 'GetGameDescription'))
def pre_get_game_description(args):
return 'Your description'
Re: Changing game description
I looked at how SM (SteamWorks extension) does it, and it uses SetGameDescription from ISteamGameServer.
Isn't that better to use the function that is meant to set game description anyway?
https://github.com/KyleSanderson/SteamWorks/blob/master/Extension/gsnatives.cpp#L91
https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/public/steam/isteamgameserver.h#L38
Isn't that better to use the function that is meant to set game description anyway?
https://github.com/KyleSanderson/SteamWorks/blob/master/Extension/gsnatives.cpp#L91
https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/public/steam/isteamgameserver.h#L38
/id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.
Re: Changing game description
Yeah I didn't know that method exists.
However, getting this to work requires more work, because the ISteamGameServer header is missing (at least in CS:S). We should create a PR for that. For now the snippet should suffice. :P
However, getting this to work requires more work, because the ISteamGameServer header is missing (at least in CS:S). We should create a PR for that. For now the snippet should suffice. :P
Re: Changing game description
Works great, thank you so much Ayuto.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 122 guests