This commit is contained in:
2022-08-30 05:42:39 +03:00
parent 1f8df8d1eb
commit af27cfe6c7
8 changed files with 57 additions and 21 deletions

View File

@ -2,9 +2,10 @@ class CfgSrvRank extends Object
config(MSKGS)
abstract;
var public config bool bAuto;
var public config bool bCustom;
var public config bool bUsesStats;
var public config bool bAuto;
var public config bool bCustom;
var public config bool bUsesStats;
var public config String PasswdText;
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
{

View File

@ -16,6 +16,7 @@ var public config String HexColorPlayer;
var public config String HexColorLeave;
var public config int CheckGroupTimer;
var public config int MaxRetries;
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
{
@ -72,7 +73,13 @@ public static function Load(E_LogLevel LogLevel)
if (default.CheckGroupTimer < 0)
{
`Log_Error("CheckGroupTimer" @ "(" $ default.CheckGroupTimer $ ")" @ "must be equal or greater than 0");
default.CheckGroupTimer = 0;
default.CheckGroupTimer = 1;
}
if (default.MaxRetries < 0)
{
`Log_Error("MaxRetries" @ "(" $ default.MaxRetries $ ")" @ "must be equal or greater than 0");
default.MaxRetries = 60;
}
if (!IsValidHexColor(default.HexColorOwner, LogLevel))
@ -112,13 +119,14 @@ private static function ApplyDefault(E_LogLevel LogLevel)
default.BoostGroup = 10;
default.BoostPlayer = 0;
default.HexColorOwner = "00FF00";
default.HexColorAdmin = "00FF00";
default.HexColorOwner = "0099FF";
default.HexColorAdmin = "FF0000";
default.HexColorGroup = "00FF00";
default.HexColorPlayer = "FFFFFF";
default.HexColorLeave = "FF0000";
default.HexColorLeave = "FFFF00";
default.CheckGroupTimer = 0;
default.CheckGroupTimer = 2;
default.MaxRetries = 60;
}
private static function bool IsValidHexColor(String HexColor, E_LogLevel LogLevel)

View File

@ -413,6 +413,7 @@ public function MSKGS_RepInfo CreateRepInfo(Controller C)
Self,
GroupID,
CfgXPBoost.default.CheckGroupTimer,
CfgXPBoost.default.MaxRetries,
C.PlayerReplicationInfo.UniqueId == OwnerID);
RepInfos.AddItem(RepInfo);

View File

@ -5,11 +5,11 @@ const CfgXPBoost = class'CfgXPBoost';
const CfgSrvRank = class'CfgSrvRank';
public static function UpdateGameSettings(
KFGameInfo_Survival KFGI,
String GameModeClass,
IMSKGS MSKGS,
bool bCustomGame,
bool bUsesStats)
KFGameInfo_Survival KFGI,
String GameModeClass,
IMSKGS MSKGS,
bool bCustomGame,
bool bUsesStats)
{
local name SessionName;
local KFOnlineGameSettings KFGameSettings;
@ -74,17 +74,21 @@ bool bUsesStats)
KFGameSettings.NumWaves = KFGI.WaveMax - 1;
}
if (MSKGS == None || !MSKGS.GetXPNotifications() || MSKGS.GetXPBoost() <= 0)
if (KFGI.RequiresPassword() && CfgSrvRank.default.PasswdText != "")
{
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName @ "|" @ CfgSrvRank.default.PasswdText;
}
else if (MSKGS == None || !MSKGS.GetXPNotifications() || MSKGS.GetXPBoost() <= 0)
{
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName;
}
else if (MSKGS.GetXPBoost() >= CfgXPBoost.default.MaxBoost)
{
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName $ " | +" $ CfgXPBoost.default.MaxBoost $ "% XP";
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName @ "| +" $ CfgXPBoost.default.MaxBoost $ "% XP";
}
else
{
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName $ " | +" $ MSKGS.GetXPBoost() $ "% XP";
KFGameSettings.OwningPlayerName = class'GameReplicationInfo'.default.ServerName @ "| +" $ MSKGS.GetXPBoost() $ "% XP";
}
KFGameSettings.NumPublicConnections = KFGI.MaxPlayersAllowed;