feat: add cod4 ProMod support

feat: add cod4 punkbuster + other config keys support
This commit is contained in:
cclecle
2023-09-30 22:52:34 +01:00
parent 7d8d87b178
commit 439333ed59
4 changed files with 79 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ encoding//src/pygamecfg/common_ut.py=utf-8
encoding//src/pygamecfg/core_gamecfg.py=utf-8
encoding//src/pygamecfg/game_cod4.py=utf-8
encoding//src/pygamecfg/game_cod4_gungame.py=utf-8
encoding//src/pygamecfg/game_cod4_promod.py=utf-8
encoding//src/pygamecfg/game_ut2k4.py=utf-8
encoding//src/pygamecfg/game_ut99.py=utf-8
encoding//src/pygamecfg/tool_ini.py=utf-8

View File

@@ -57,7 +57,7 @@ class pygamecfg_args(Tap):
verbosity: int = 0
basegamedir: str = "./"
configfile: str = ""
game: Literal["ut99", "cod4", "cod4_gungame", "ut2k4"]
game: Literal["ut99", "cod4", "cod4_gungame", "cod4_promod", "ut2k4"]
def configure(self) -> None:
self.add_argument("-v", "--verbosity", action="count", help="increase output verbosity")
@@ -89,7 +89,7 @@ def fct_main(i_args: list[str]) -> None:
args.configfile = "./System/UnrealTournament.ini"
if args.game == "ut2k4":
args.configfile = "./System/UT2004.ini"
elif args.game in ("cod4", "cod4_gungame"):
elif args.game in ("cod4", "cod4_gungame", "cod4_promod"):
args.configfile = "./main/server.cfg"
GameOptions = GameOptions_Factory(args.game, args.basegamedir, args.configfile)

View File

@@ -668,3 +668,36 @@ class GameOption_COD4_nosteamnames(GameOption_COD4):
szPrefix = "set"
szDefaultValue = "1"
szHelp = "1 = Use names from steam if steam is available"
@GameOptions_Factory_Register
class GameOption_COD4_punkbuster(GameOption_COD4):
TValueType = OptionType.OT_BOOLEAN
szOptionName: str = "punkbuster"
szKeyName: str = "sv_punkbuster"
bDblQuoted: bool = True
szPrefix = "set"
szDefaultValue = "1"
szHelp = "Enable Punkbuste (PB is not supported on CoD4x)"
@GameOptions_Factory_Register
class GameOption_COD4_pure(GameOption_COD4):
TValueType = OptionType.OT_BOOLEAN
szOptionName: str = "pure"
szKeyName: str = "sv_pure"
bDblQuoted: bool = True
szPrefix = "set"
szDefaultValue = "1"
szHelp = "check IWD-data 0 = off, 1 = on"
@GameOptions_Factory_Register
class GameOption_COD4_antilag(GameOption_COD4):
TValueType = OptionType.OT_BOOLEAN
szOptionName: str = "antilag"
szKeyName: str = "g_antilag"
bDblQuoted: bool = True
szPrefix = "set"
szDefaultValue = "1"
szHelp = "0 = off, 1 = on // Anti lag checks for weapon hits"

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pyGameCFG(c) by chacha
#
# pyGameCFG is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Unported License.
#
# You should have received a copy of the license along with this
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
# pylint: disable=missing-class-docstring,missing-module-docstring,missing-function-docstring,duplicate-code,line-too-long
from __future__ import annotations
from .core_gamecfg import GameOptions_Factory_Register, OptionType
from .game_cod4 import GameOption_COD4
class GameOption_COD4_ProMod(GameOption_COD4):
szGameType = "cod4_promod"
@GameOptions_Factory_Register
class GameOption_COD4_ProMod_promod_mode(GameOption_COD4_ProMod):
TValueType = OptionType.OT_STRING
szOptionName: str = "promod_mode"
szKeyName: str = "promod_mode"
bDblQuoted: bool = True
szPrefix = "set"
szDefaultValue = "comp_public"
szHelp = """comp_public,custom_public,2v2_mr,1v1_mr,knockout_mr,match_mr"""
@GameOptions_Factory_Register
class GameOption_COD4_ProMod_promod_enable_scorebot(GameOption_COD4_ProMod):
TValueType = OptionType.OT_BOOLEAN
szOptionName: str = "promod_enable_scorebot"
szKeyName: str = "promod_enable_scorebot"
bDblQuoted: bool = True
szPrefix = "set"
szDefaultValue = "0"
szHelp = """match-modes only"""