From 6bfbc85758507c8224c813df276a112b3850d482 Mon Sep 17 00:00:00 2001 From: cclecle Date: Wed, 27 Sep 2023 22:36:34 +0100 Subject: [PATCH 1/2] chore: fix code quality issues --- src/pygamecfg/game_cod4.py | 2 +- src/pygamecfg/game_cod4_gungame.py | 12 ++++-------- src/pygamecfg/game_ut2k4.py | 2 +- src/pygamecfg/game_ut99.py | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/pygamecfg/game_cod4.py b/src/pygamecfg/game_cod4.py index 5891bad..80ae276 100644 --- a/src/pygamecfg/game_cod4.py +++ b/src/pygamecfg/game_cod4.py @@ -9,7 +9,7 @@ # You should have received a copy of the license along with this # work. If not, see . -# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,duplicate-code +# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,duplicate-code,line-too-long from __future__ import annotations from typing import Union diff --git a/src/pygamecfg/game_cod4_gungame.py b/src/pygamecfg/game_cod4_gungame.py index 499b1cf..24c8368 100644 --- a/src/pygamecfg/game_cod4_gungame.py +++ b/src/pygamecfg/game_cod4_gungame.py @@ -9,13 +9,9 @@ # You should have received a copy of the license along with this # work. If not, see . -# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,duplicate-code -from __future__ import annotations -from typing import Union +# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,duplicate-code,line-too-long -import re -from os.path import join -from os import linesep +from __future__ import annotations from .core_gamecfg import GameOptions_Factory_Register, OptionType from .game_cod4 import GameOption_COD4 @@ -373,8 +369,8 @@ class GameOption_COD4_GunGame_WelcomeMessage_Messsage(GameOption_COD4_GunGame): szKeyName: str = "wc_message" bDblQuoted: bool = True szPrefix = "set" - szDefaultValue = "Welcome to the server !\Please enjoy your stay!" - szHelp = """The message [ is replaced by players name and \ indicates a new line ]""" + szDefaultValue = r"Welcome to the server !\Please enjoy your stay!" + szHelp = r"""The message [ is replaced by players name and \ indicates a new line ]""" @GameOptions_Factory_Register diff --git a/src/pygamecfg/game_ut2k4.py b/src/pygamecfg/game_ut2k4.py index 07c2d96..4929110 100644 --- a/src/pygamecfg/game_ut2k4.py +++ b/src/pygamecfg/game_ut2k4.py @@ -9,7 +9,7 @@ # You should have received a copy of the license along with this # work. If not, see . -# pylint: disable=missing-class-docstring,missing-function-docstring,duplicate-code +# pylint: disable=missing-class-docstring,missing-function-docstring,duplicate-code,line-too-long """UT2k4 command set""" from __future__ import annotations from typing import Union diff --git a/src/pygamecfg/game_ut99.py b/src/pygamecfg/game_ut99.py index 781ed72..db9af96 100644 --- a/src/pygamecfg/game_ut99.py +++ b/src/pygamecfg/game_ut99.py @@ -9,7 +9,7 @@ # You should have received a copy of the license along with this # work. If not, see . -# pylint: disable=missing-class-docstring,missing-function-docstring,duplicate-code +# pylint: disable=missing-class-docstring,missing-function-docstring,duplicate-code,line-too-long """UT99 command set""" from __future__ import annotations from typing import Union -- 2.47.3 From 8797bd3ee1d11fc7fbdd3c40f63ea9b576d14c8d Mon Sep 17 00:00:00 2001 From: cclecle Date: Thu, 28 Sep 2023 08:45:18 +0100 Subject: [PATCH 2/2] chore: add missing cod4 configuration keys (numlives, playerrespawndelay, waverespawndelay) --- src/pygamecfg/game_cod4.py | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/pygamecfg/game_cod4.py b/src/pygamecfg/game_cod4.py index 80ae276..08aa516 100644 --- a/src/pygamecfg/game_cod4.py +++ b/src/pygamecfg/game_cod4.py @@ -491,6 +491,39 @@ class GameOption_COD4_DM_roundlimit(GameOption_COD4): szHelp = "" +@GameOptions_Factory_Register +class GameOption_COD4_DM_numlives(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "dm_numlives" + szKeyName: str = "scr_dm_numlives" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + +@GameOptions_Factory_Register +class GameOption_COD4_DM_playerrespawndelay(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "dm_playerrespawndelay" + szKeyName: str = "scr_dm_playerrespawndelay" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + +@GameOptions_Factory_Register +class GameOption_COD4_DM_waverespawndelay(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "dm_waverespawndelay" + szKeyName: str = "scr_dm_waverespawndelay" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + @GameOptions_Factory_Register class GameOption_COD4_TDM_scorelimit(GameOption_COD4): TValueType = OptionType.OT_INTEGER @@ -524,6 +557,39 @@ class GameOption_COD4_TDM_roundlimit(GameOption_COD4): szHelp = "" +@GameOptions_Factory_Register +class GameOption_COD4_TDM_numlives(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "tdm_numlives" + szKeyName: str = "scr_war_numlives" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + +@GameOptions_Factory_Register +class GameOption_COD4_TDM_playerrespawndelay(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "tdm_playerrespawndelay" + szKeyName: str = "scr_war_playerrespawndelay" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + +@GameOptions_Factory_Register +class GameOption_COD4_TDM_waverespawndelay(GameOption_COD4): + TValueType = OptionType.OT_INTEGER + szOptionName: str = "tdm_waverespawndelay" + szKeyName: str = "scr_war_waverespawndelay" + bDblQuoted: bool = True + szPrefix = "set" + szDefaultValue = "0" + szHelp = "" + + @GameOptions_Factory_Register class GameOption_COD4_gametype(GameOption_COD4): TValueType = OptionType.OT_STRING -- 2.47.3