[ANY] Game Desc Override
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
[ANY] Game Desc Override
Hello,
Could someone write a plugin for game desc override.
Example:
gamedir ---> hl2mp
and
gamename ---> Half-Life 2 Deathmatch
Thanks in Advance
Could someone write a plugin for game desc override.
Example:
gamedir ---> hl2mp
and
gamename ---> Half-Life 2 Deathmatch
Thanks in Advance
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
Thanks you
How can I apply it to different maps
Is there a command for my mapconfig plugin? (cvar)
How can I apply it to different maps
Is there a command for my mapconfig plugin? (cvar)
Re: [ANY] Game Desc Override
Well, if you want to use a ConVar to set the value, you might try this (untested):
Then, just set the game_description ConVar to whatever you want in any cfg file.
Syntax: Select all
from cvars import ConVar
from engines.server import server_game_dll
from memory import get_virtual_function
from memory.hooks import PreHook
game_description = ConVar(
name='game_description',
value='Starting description',
)
@PreHook(get_virtual_function(server_game_dll, 'GetGameDescription'))
def pre_get_game_description(args):
return game_description.get_string()
Then, just set the game_description ConVar to whatever you want in any cfg file.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
oO this crasht my server.
I set this in config
game_description PoSt@L
I set this in config
game_description PoSt@L
Re: [ANY] Game Desc Override
I guess we need to keep a reference to the return value of get_string(). The easiest way would be to assign it to a global variable and then return that instead.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
Can you do that?
Re: [ANY] Game Desc Override
Ayuto wrote:I guess we need to keep a reference to the return value of get_string().
Oh yeah, that makes sense. Try this then (untested):
Syntax: Select all
from cvars import ConVar
from cvars.flags import ConVarFlags
from engines.server import server_game_dll
from events import Event
from memory import get_virtual_function
from memory.hooks import PreHook
game_description_convar = ConVar(
name='game_description',
value='Starting description',
flags=ConVarFlags.NOTIFY,
)
game_description = game_description_convar.get_string()
@Event('server_cvar')
def server_cvar(game_event):
global game_description
if game_event['cvarname'] == game_description_convar.name:
game_description = game_event['cvarvalue']
@PreHook(get_virtual_function(server_game_dll, 'GetGameDescription'))
def pre_get_game_description(args):
return game_description
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
[SP] Loading plugin 'gamedesc'...
crash_20170207160603_1.dmp[30301]: Uploading dump (out-of-process)
/tmp/dumps/crash_20170207160603_1.dmp
crash_20170207160603_1.dmp[30301]: Finished uploading minidump (out-of-process): success = no
crash_20170207160603_1.dmp[30301]: error: libcurl.so: cannot open shared object file: No such file or directory
crash_20170207160603_1.dmp[30301]: file ''/tmp/dumps/crash_20170207160603_1.dmp'
', upload no: ''libcurl.so: cannot open shared object file: No such file or directory''
Segmentation fault (core dumped)
Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem
Di 7. Feb 16:06:07 CET 2017: Server restart in 10 seconds
crash_20170207160603_1.dmp[30301]: Uploading dump (out-of-process)
/tmp/dumps/crash_20170207160603_1.dmp
crash_20170207160603_1.dmp[30301]: Finished uploading minidump (out-of-process): success = no
crash_20170207160603_1.dmp[30301]: error: libcurl.so: cannot open shared object file: No such file or directory
crash_20170207160603_1.dmp[30301]: file ''/tmp/dumps/crash_20170207160603_1.dmp'
', upload no: ''libcurl.so: cannot open shared object file: No such file or directory''
Segmentation fault (core dumped)
Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem
Di 7. Feb 16:06:07 CET 2017: Server restart in 10 seconds
Last edited by Painkiller on Tue Feb 14, 2017 6:57 pm, edited 1 time in total.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
There is now a new solution or variant
Re: [ANY] Game Desc Override
Build 553 should fix your crash:
https://github.com/Source-Python-Dev-Te ... 60b7b6d1ca
Though, I just did a few tests and noticed that the description for the server browser is only retrieved once.
https://github.com/Source-Python-Dev-Te ... 60b7b6d1ca
Though, I just did a few tests and noticed that the description for the server browser is only retrieved once.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
The Problem is now: Starting Discription
(in server.cfg stand : game_description PoSt@L by RocKs
(in server.cfg stand : game_description PoSt@L by RocKs
Re: [ANY] Game Desc Override
Ayuto wrote:Though, I just did a few tests and noticed that the description for the server browser is only retrieved once.
With a GetGameDescription hook, you can only set it once via autoexec.cfg.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [ANY] Game Desc Override
Thanks, now it works.
Who is online
Users browsing this forum: No registered users and 8 guests