Merge branch 'master' into MegaLinter
This commit is contained in:
commit
9b47405939
@ -1,114 +1,114 @@
|
|||||||
class BaseVote extends Object
|
class BaseVote extends Object
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config String PositiveColorHex;
|
var public config String PositiveColorHex;
|
||||||
var public config String NegativeColorHex;
|
var public config String NegativeColorHex;
|
||||||
var public config bool bChatNotifications;
|
var public config bool bChatNotifications;
|
||||||
var public config bool bHudNotifications;
|
var public config bool bHudNotifications;
|
||||||
var public config float DefferedClearHUD;
|
var public config float DefferedClearHUD;
|
||||||
var public config int VoteTime;
|
var public config int VoteTime;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
if (!IsValidHexColor(default.PositiveColorHex, LogLevel))
|
if (!IsValidHexColor(default.PositiveColorHex, LogLevel))
|
||||||
{
|
{
|
||||||
`Log_Error("PositiveColorHex" @ "(" $ default.PositiveColorHex $ ")" @ "is not valid hex color");
|
`Log_Error("PositiveColorHex" @ "(" $ default.PositiveColorHex $ ")" @ "is not valid hex color");
|
||||||
default.PositiveColorHex = class'KFLocalMessage'.default.EventColor;
|
default.PositiveColorHex = class'KFLocalMessage'.default.EventColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsValidHexColor(default.NegativeColorHex, LogLevel))
|
if (!IsValidHexColor(default.NegativeColorHex, LogLevel))
|
||||||
{
|
{
|
||||||
`Log_Error("NegativeColorHex" @ "(" $ default.NegativeColorHex $ ")" @ "is not valid hex color");
|
`Log_Error("NegativeColorHex" @ "(" $ default.NegativeColorHex $ ")" @ "is not valid hex color");
|
||||||
default.NegativeColorHex = class'KFLocalMessage'.default.InteractionColor;
|
default.NegativeColorHex = class'KFLocalMessage'.default.InteractionColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (default.DefferedClearHUD < 0)
|
if (default.DefferedClearHUD < 0)
|
||||||
{
|
{
|
||||||
`Log_Error("DefferedClearHUD" @ "(" $ default.DefferedClearHUD $ ")" @ "must be greater than 0");
|
`Log_Error("DefferedClearHUD" @ "(" $ default.DefferedClearHUD $ ")" @ "must be greater than 0");
|
||||||
default.DefferedClearHUD = 0.0f;
|
default.DefferedClearHUD = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (default.VoteTime <= 0 || default.VoteTime > 255)
|
if (default.VoteTime <= 0 || default.VoteTime > 255)
|
||||||
{
|
{
|
||||||
`Log_Error("VoteTime" @ "(" $ default.VoteTime $ ")" @ "must be in range 1-255");
|
`Log_Error("VoteTime" @ "(" $ default.VoteTime $ ")" @ "must be in range 1-255");
|
||||||
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.bChatNotifications = true;
|
default.bChatNotifications = true;
|
||||||
default.bHudNotifications = true;
|
default.bHudNotifications = true;
|
||||||
default.PositiveColorHex = class'KFLocalMessage'.default.EventColor;
|
default.PositiveColorHex = class'KFLocalMessage'.default.EventColor;
|
||||||
default.NegativeColorHex = class'KFLocalMessage'.default.InteractionColor;
|
default.NegativeColorHex = class'KFLocalMessage'.default.InteractionColor;
|
||||||
default.DefferedClearHUD = 1.0f;
|
default.DefferedClearHUD = 1.0f;
|
||||||
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
default.VoteTime = class'KFVoteCollector'.default.VoteTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function bool IsValidHexColor(String HexColor, E_LogLevel LogLevel)
|
protected static function bool IsValidHexColor(String HexColor, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local byte Index;
|
local byte Index;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
if (len(HexColor) != 6) return false;
|
if (len(HexColor) != 6) return false;
|
||||||
|
|
||||||
HexColor = Locs(HexColor);
|
HexColor = Locs(HexColor);
|
||||||
|
|
||||||
for (Index = 0; Index < 6; ++Index)
|
for (Index = 0; Index < 6; ++Index)
|
||||||
{
|
{
|
||||||
switch (Mid(HexColor, Index, 1))
|
switch (Mid(HexColor, Index, 1))
|
||||||
{
|
{
|
||||||
case "0": break;
|
case "0": break;
|
||||||
case "1": break;
|
case "1": break;
|
||||||
case "2": break;
|
case "2": break;
|
||||||
case "3": break;
|
case "3": break;
|
||||||
case "4": break;
|
case "4": break;
|
||||||
case "5": break;
|
case "5": break;
|
||||||
case "6": break;
|
case "6": break;
|
||||||
case "7": break;
|
case "7": break;
|
||||||
case "8": break;
|
case "8": break;
|
||||||
case "9": break;
|
case "9": break;
|
||||||
case "a": break;
|
case "a": break;
|
||||||
case "b": break;
|
case "b": break;
|
||||||
case "c": break;
|
case "c": break;
|
||||||
case "d": break;
|
case "d": break;
|
||||||
case "e": break;
|
case "e": break;
|
||||||
case "f": break;
|
case "f": break;
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,390 +1,390 @@
|
|||||||
class CVC extends Info
|
class CVC extends Info
|
||||||
dependson(CVC_LocalMessage)
|
dependson(CVC_LocalMessage)
|
||||||
config(CVC);
|
config(CVC);
|
||||||
|
|
||||||
const LatestVersion = 2;
|
const LatestVersion = 2;
|
||||||
|
|
||||||
const CfgKickProtected = class'KickProtected';
|
const CfgKickProtected = class'KickProtected';
|
||||||
const CfgKickVote = class'KickVote';
|
const CfgKickVote = class'KickVote';
|
||||||
const CfgStartWaveKickProtection = class'StartWaveKickProtection';
|
const CfgStartWaveKickProtection = class'StartWaveKickProtection';
|
||||||
const CfgSkipTraderVote = class'SkipTraderVote';
|
const CfgSkipTraderVote = class'SkipTraderVote';
|
||||||
const CfgPauseVote = class'PauseVote';
|
const CfgPauseVote = class'PauseVote';
|
||||||
const CfgMapStat = class'MapStat';
|
const CfgMapStat = class'MapStat';
|
||||||
const CfgMapVote = class'MapVote';
|
const CfgMapVote = class'MapVote';
|
||||||
|
|
||||||
var private config int Version;
|
var private config int Version;
|
||||||
var private config E_LogLevel LogLevel;
|
var private config E_LogLevel LogLevel;
|
||||||
|
|
||||||
var private KFGameInfo KFGI;
|
var private KFGameInfo KFGI;
|
||||||
var private KFGameInfo_Survival KFGIS;
|
var private KFGameInfo_Survival KFGIS;
|
||||||
var private KFGameReplicationInfo KFGRI;
|
var private KFGameReplicationInfo KFGRI;
|
||||||
|
|
||||||
var private Array<UniqueNetId> KickProtectedPlayers;
|
var private Array<UniqueNetId> KickProtectedPlayers;
|
||||||
var private Array<CVC_RepInfo> RepInfos;
|
var private Array<CVC_RepInfo> RepInfos;
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
public simulated function bool SafeDestroy()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PreBeginPlay()
|
public event PreBeginPlay()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client)
|
if (WorldInfo.NetMode == NM_Client)
|
||||||
{
|
{
|
||||||
`Log_Fatal("NetMode == NM_Client, Destroy...");
|
`Log_Fatal("NetMode == NM_Client, Destroy...");
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Super.PreBeginPlay();
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
PreInit();
|
PreInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PostBeginPlay()
|
public event PostBeginPlay()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (bPendingDelete || bDeleteMe) return;
|
if (bPendingDelete || bDeleteMe) return;
|
||||||
|
|
||||||
Super.PostBeginPlay();
|
Super.PostBeginPlay();
|
||||||
|
|
||||||
PostInit();
|
PostInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function PreInit()
|
private function PreInit()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (Version == `NO_CONFIG)
|
if (Version == `NO_CONFIG)
|
||||||
{
|
{
|
||||||
LogLevel = LL_Info;
|
LogLevel = LL_Info;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
CfgMapStat.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgMapStat.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgMapVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgMapVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgSkipTraderVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgSkipTraderVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgPauseVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgPauseVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgKickVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgKickVote.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgKickProtected.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgKickProtected.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
CfgStartWaveKickProtection.static.InitConfig(Version, LatestVersion, LogLevel);
|
CfgStartWaveKickProtection.static.InitConfig(Version, LatestVersion, LogLevel);
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
`Log_Info("Config created");
|
`Log_Info("Config created");
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
|
||||||
case MaxInt:
|
case MaxInt:
|
||||||
`Log_Info("Config updated to version"@LatestVersion);
|
`Log_Info("Config updated to version"@LatestVersion);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LatestVersion:
|
case LatestVersion:
|
||||||
`Log_Info("Config is up-to-date");
|
`Log_Info("Config is up-to-date");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
`Log_Warn("The config version is higher than the current version (are you using an old mutator?)");
|
||||||
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
`Log_Warn("Config version is" @ Version @ "but current version is" @ LatestVersion);
|
||||||
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
`Log_Warn("The config version will be changed to" @ LatestVersion);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
Version = LatestVersion;
|
Version = LatestVersion;
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LogLevel == LL_WrongLevel)
|
if (LogLevel == LL_WrongLevel)
|
||||||
{
|
{
|
||||||
LogLevel = LL_Info;
|
LogLevel = LL_Info;
|
||||||
`Log_Warn("Wrong 'LogLevel', return to default value");
|
`Log_Warn("Wrong 'LogLevel', return to default value");
|
||||||
SaveConfig();
|
SaveConfig();
|
||||||
}
|
}
|
||||||
`Log_Base("LogLevel:" @ LogLevel);
|
`Log_Base("LogLevel:" @ LogLevel);
|
||||||
|
|
||||||
CfgKickVote.static.Load(LogLevel);
|
CfgKickVote.static.Load(LogLevel);
|
||||||
CfgSkipTraderVote.static.Load(LogLevel);
|
CfgSkipTraderVote.static.Load(LogLevel);
|
||||||
CfgPauseVote.static.Load(LogLevel);
|
CfgPauseVote.static.Load(LogLevel);
|
||||||
CfgMapStat.static.Load(LogLevel);
|
CfgMapStat.static.Load(LogLevel);
|
||||||
CfgMapVote.static.Load(LogLevel);
|
CfgMapVote.static.Load(LogLevel);
|
||||||
CfgStartWaveKickProtection.static.Load(LogLevel);
|
CfgStartWaveKickProtection.static.Load(LogLevel);
|
||||||
|
|
||||||
KickProtectedPlayers = CfgKickProtected.static.Load(LogLevel);
|
KickProtectedPlayers = CfgKickProtected.static.Load(LogLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function PostInit()
|
private function PostInit()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (WorldInfo == None || WorldInfo.Game == None)
|
if (WorldInfo == None || WorldInfo.Game == None)
|
||||||
{
|
{
|
||||||
SetTimer(1.0f, false, nameof(PostInit));
|
SetTimer(1.0f, false, nameof(PostInit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KFGI = KFGameInfo(WorldInfo.Game);
|
KFGI = KFGameInfo(WorldInfo.Game);
|
||||||
if (KFGI == None)
|
if (KFGI == None)
|
||||||
{
|
{
|
||||||
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game);
|
`Log_Fatal("Incompatible gamemode:" @ WorldInfo.Game);
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KFGIS = KFGameInfo_Survival(KFGI);
|
KFGIS = KFGameInfo_Survival(KFGI);
|
||||||
if (KFGIS == None)
|
if (KFGIS == None)
|
||||||
{
|
{
|
||||||
`Log_Warn("Unknown gamemode (" $ KFGI $ "), KickProtectionStartWaves disabled");
|
`Log_Warn("Unknown gamemode (" $ KFGI $ "), KickProtectionStartWaves disabled");
|
||||||
CfgStartWaveKickProtection.default.Waves = 0;
|
CfgStartWaveKickProtection.default.Waves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KFGI.GameReplicationInfo == None)
|
if (KFGI.GameReplicationInfo == None)
|
||||||
{
|
{
|
||||||
SetTimer(1.0f, false, nameof(PostInit));
|
SetTimer(1.0f, false, nameof(PostInit));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo);
|
KFGRI = KFGameReplicationInfo(KFGI.GameReplicationInfo);
|
||||||
if (KFGRI == None)
|
if (KFGRI == None)
|
||||||
{
|
{
|
||||||
`Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo);
|
`Log_Fatal("Incompatible Replication info:" @ KFGI.GameReplicationInfo);
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KFGRI.VoteCollectorClass = class'CVC_VoteCollector';
|
KFGRI.VoteCollectorClass = class'CVC_VoteCollector';
|
||||||
KFGRI.VoteCollector = new(KFGRI) KFGRI.VoteCollectorClass;
|
KFGRI.VoteCollector = new(KFGRI) KFGRI.VoteCollectorClass;
|
||||||
|
|
||||||
if (KFGRI.VoteCollector == None)
|
if (KFGRI.VoteCollector == None)
|
||||||
{
|
{
|
||||||
`Log_Fatal("Can't replace VoteCollector!");
|
`Log_Fatal("Can't replace VoteCollector!");
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CVC_VoteCollector(KFGRI.VoteCollector).CVC = Self;
|
CVC_VoteCollector(KFGRI.VoteCollector).CVC = Self;
|
||||||
CVC_VoteCollector(KFGRI.VoteCollector).LogLevel = LogLevel;
|
CVC_VoteCollector(KFGRI.VoteCollector).LogLevel = LogLevel;
|
||||||
`Log_Info("VoteCollector replaced");
|
`Log_Info("VoteCollector replaced");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bool PlayerIsKickProtected(PlayerReplicationInfo PRI)
|
public function bool PlayerIsKickProtected(PlayerReplicationInfo PRI)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return (KickProtectedPlayers.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE);
|
return (KickProtectedPlayers.Find('Uid', PRI.UniqueId.Uid) != INDEX_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bool PlayerIsStartWaveKickProtected(KFPlayerController KFPC)
|
public function bool PlayerIsStartWaveKickProtected(KFPlayerController KFPC)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return (PlayerOnStartWave(KFPC) && PlayerHasRequiredLevel(KFPC));
|
return (PlayerOnStartWave(KFPC) && PlayerHasRequiredLevel(KFPC));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function bool PlayerOnStartWave(KFPlayerController KFPC)
|
private function bool PlayerOnStartWave(KFPlayerController KFPC)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (KFGIS != None && CfgStartWaveKickProtection.default.Waves != 0)
|
if (KFGIS != None && CfgStartWaveKickProtection.default.Waves != 0)
|
||||||
{
|
{
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() == KFPC)
|
if (RepInfo.GetKFPC() == KFPC)
|
||||||
{
|
{
|
||||||
return (RepInfo.StartWave + CfgStartWaveKickProtection.default.Waves >= KFGIS.WaveNum);
|
return (RepInfo.StartWave + CfgStartWaveKickProtection.default.Waves >= KFGIS.WaveNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function bool PlayerHasRequiredLevel(KFPlayerController KFPC)
|
private function bool PlayerHasRequiredLevel(KFPlayerController KFPC)
|
||||||
{
|
{
|
||||||
local KFPlayerReplicationInfo KFPRI;
|
local KFPlayerReplicationInfo KFPRI;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
KFPRI = KFPlayerReplicationInfo(KFPC.PlayerReplicationInfo);
|
KFPRI = KFPlayerReplicationInfo(KFPC.PlayerReplicationInfo);
|
||||||
|
|
||||||
if (KFPRI == None)
|
if (KFPRI == None)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (KFPRI.GetActivePerkLevel() >= CfgStartWaveKickProtection.default.MinLevel);
|
return (KFPRI.GetActivePerkLevel() >= CfgStartWaveKickProtection.default.MinLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bool PlayerCanStartKickVote(KFPlayerController KFPC, KFPlayerController KFPC_Kickee)
|
public function bool PlayerCanStartKickVote(KFPlayerController KFPC, KFPlayerController KFPC_Kickee)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (KFPC_Kickee != None)
|
if (KFPC_Kickee != None)
|
||||||
{
|
{
|
||||||
if (KFPC == KFPC_Kickee)
|
if (KFPC == KFPC_Kickee)
|
||||||
{
|
{
|
||||||
return false; // kickee cant vote
|
return false; // kickee cant vote
|
||||||
}
|
}
|
||||||
if (!PlayerHasRequiredLevel(KFPC_Kickee))
|
if (!PlayerHasRequiredLevel(KFPC_Kickee))
|
||||||
{
|
{
|
||||||
return true; // always can vote for players without req level
|
return true; // always can vote for players without req level
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return !PlayerOnStartWave(KFPC);
|
return !PlayerOnStartWave(KFPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BroadcastChatLocalized(E_CVC_LocalMessageType LMT, optional String HexColor, optional KFPlayerController ExceptKFPC = None, optional String String1, optional String String2)
|
public function BroadcastChatLocalized(E_CVC_LocalMessageType LMT, optional String HexColor, optional KFPlayerController ExceptKFPC = None, optional String String1, optional String String2)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() != ExceptKFPC)
|
if (RepInfo.GetKFPC() != ExceptKFPC)
|
||||||
{
|
{
|
||||||
RepInfo.WriteToChatLocalized(LMT, HexColor, String1, String2);
|
RepInfo.WriteToChatLocalized(LMT, HexColor, String1, String2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BroadcastHUDLocalized(E_CVC_LocalMessageType LMT, optional float DisplayTime = 0.0f, optional String String1, optional String String2, optional String String3)
|
public function BroadcastHUDLocalized(E_CVC_LocalMessageType LMT, optional float DisplayTime = 0.0f, optional String String1, optional String String2, optional String String3)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() != None)
|
if (RepInfo.GetKFPC() != None)
|
||||||
{
|
{
|
||||||
RepInfo.WriteToHUDLocalized(LMT, String1, String2, String3, DisplayTime);
|
RepInfo.WriteToHUDLocalized(LMT, String1, String2, String3, DisplayTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BroadcastClearMessageHUD(optional float DefferedTime = 0.0f)
|
public function BroadcastClearMessageHUD(optional float DefferedTime = 0.0f)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() != None)
|
if (RepInfo.GetKFPC() != None)
|
||||||
{
|
{
|
||||||
RepInfo.DefferedClearMessageHUD(DefferedTime);
|
RepInfo.DefferedClearMessageHUD(DefferedTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function WriteToChatLocalized(KFPlayerController KFPC, E_CVC_LocalMessageType LMT, optional String HexColor, optional String String1, optional String String2)
|
public function WriteToChatLocalized(KFPlayerController KFPC, E_CVC_LocalMessageType LMT, optional String HexColor, optional String String1, optional String String2)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() == KFPC)
|
if (RepInfo.GetKFPC() == KFPC)
|
||||||
{
|
{
|
||||||
RepInfo.WriteToChatLocalized(LMT, HexColor, String1, String2);
|
RepInfo.WriteToChatLocalized(LMT, HexColor, String1, String2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function WriteToHUDLocalized(KFPlayerController KFPC, E_CVC_LocalMessageType LMT, optional float DisplayTime = 0.0f, optional String String1, optional String String2, optional String String3)
|
public function WriteToHUDLocalized(KFPlayerController KFPC, E_CVC_LocalMessageType LMT, optional float DisplayTime = 0.0f, optional String String1, optional String String2, optional String String3)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.GetKFPC() == KFPC)
|
if (RepInfo.GetKFPC() == KFPC)
|
||||||
{
|
{
|
||||||
RepInfo.WriteToHUDLocalized(LMT, String1, String2, String3, DisplayTime);
|
RepInfo.WriteToHUDLocalized(LMT, String1, String2, String3, DisplayTime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function NotifyLogin(Controller C)
|
public function NotifyLogin(Controller C)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (!CreateRepInfo(C))
|
if (!CreateRepInfo(C))
|
||||||
{
|
{
|
||||||
`Log_Error("Can't create RepInfo for:" @ C);
|
`Log_Error("Can't create RepInfo for:" @ C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function NotifyLogout(Controller C)
|
public function NotifyLogout(Controller C)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (!DestroyRepInfo(C))
|
if (!DestroyRepInfo(C))
|
||||||
{
|
{
|
||||||
`Log_Error("Can't destroy RepInfo of:" @ C);
|
`Log_Error("Can't destroy RepInfo of:" @ C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bool CreateRepInfo(Controller C)
|
public function bool CreateRepInfo(Controller C)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (C == None) return false;
|
if (C == None) return false;
|
||||||
|
|
||||||
RepInfo = Spawn(class'CVC_RepInfo', C);
|
RepInfo = Spawn(class'CVC_RepInfo', C);
|
||||||
|
|
||||||
if (RepInfo == None) return false;
|
if (RepInfo == None) return false;
|
||||||
|
|
||||||
RepInfo.CVC = Self;
|
RepInfo.CVC = Self;
|
||||||
RepInfo.LogLevel = LogLevel;
|
RepInfo.LogLevel = LogLevel;
|
||||||
RepInfo.StartWave = ((KFGIS != None) ? KFGIS.WaveNum : 0);
|
RepInfo.StartWave = ((KFGIS != None) ? KFGIS.WaveNum : 0);
|
||||||
|
|
||||||
RepInfos.AddItem(RepInfo);
|
RepInfos.AddItem(RepInfo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bool DestroyRepInfo(Controller C)
|
public function bool DestroyRepInfo(Controller C)
|
||||||
{
|
{
|
||||||
local CVC_RepInfo RepInfo;
|
local CVC_RepInfo RepInfo;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (C == None) return false;
|
if (C == None) return false;
|
||||||
|
|
||||||
foreach RepInfos(RepInfo)
|
foreach RepInfos(RepInfo)
|
||||||
{
|
{
|
||||||
if (RepInfo.Owner == C)
|
if (RepInfo.Owner == C)
|
||||||
{
|
{
|
||||||
RepInfos.RemoveItem(RepInfo);
|
RepInfos.RemoveItem(RepInfo);
|
||||||
RepInfo.SafeDestroy();
|
RepInfo.SafeDestroy();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
[Flags]
|
[Flags]
|
||||||
AllowDownload=True
|
AllowDownload=True
|
||||||
ClientOptional=False
|
ClientOptional=False
|
||||||
ServerSideOnly=False
|
ServerSideOnly=False
|
||||||
|
@ -1,60 +1,60 @@
|
|||||||
class CVCMut extends KFMutator;
|
class CVCMut extends KFMutator;
|
||||||
|
|
||||||
var private CVC CVC;
|
var private CVC CVC;
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
public simulated function bool SafeDestroy()
|
||||||
{
|
{
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PreBeginPlay()
|
public event PreBeginPlay()
|
||||||
{
|
{
|
||||||
Super.PreBeginPlay();
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client) return;
|
if (WorldInfo.NetMode == NM_Client) return;
|
||||||
|
|
||||||
foreach WorldInfo.DynamicActors(class'CVC', CVC)
|
foreach WorldInfo.DynamicActors(class'CVC', CVC)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVC == None)
|
if (CVC == None)
|
||||||
{
|
{
|
||||||
CVC = WorldInfo.Spawn(class'CVC');
|
CVC = WorldInfo.Spawn(class'CVC');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVC == None)
|
if (CVC == None)
|
||||||
{
|
{
|
||||||
`Log_Base("FATAL: Can't Spawn 'CVC'");
|
`Log_Base("FATAL: Can't Spawn 'CVC'");
|
||||||
SafeDestroy();
|
SafeDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function AddMutator(Mutator Mut)
|
public function AddMutator(Mutator Mut)
|
||||||
{
|
{
|
||||||
if (Mut == Self) return;
|
if (Mut == Self) return;
|
||||||
|
|
||||||
if (Mut.Class == Class)
|
if (Mut.Class == Class)
|
||||||
Mut.Destroy();
|
Mut.Destroy();
|
||||||
else
|
else
|
||||||
Super.AddMutator(Mut);
|
Super.AddMutator(Mut);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function NotifyLogin(Controller C)
|
public function NotifyLogin(Controller C)
|
||||||
{
|
{
|
||||||
Super.NotifyLogin(C);
|
Super.NotifyLogin(C);
|
||||||
|
|
||||||
CVC.NotifyLogin(C);
|
CVC.NotifyLogin(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function NotifyLogout(Controller C)
|
public function NotifyLogout(Controller C)
|
||||||
{
|
{
|
||||||
Super.NotifyLogout(C);
|
Super.NotifyLogout(C);
|
||||||
|
|
||||||
CVC.NotifyLogout(C);
|
CVC.NotifyLogout(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -1,145 +1,145 @@
|
|||||||
class CVC_LocalMessage extends Object
|
class CVC_LocalMessage extends Object
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var const String PlayerIsKickProtectedDefault;
|
var const String PlayerIsKickProtectedDefault;
|
||||||
var private localized String PlayerIsKickProtected;
|
var private localized String PlayerIsKickProtected;
|
||||||
|
|
||||||
var const String PlayerIsStartWaveKickProtectedDefault;
|
var const String PlayerIsStartWaveKickProtectedDefault;
|
||||||
var private localized String PlayerIsStartWaveKickProtected;
|
var private localized String PlayerIsStartWaveKickProtected;
|
||||||
|
|
||||||
var const String PlayerCantStartKickVoteDefault;
|
var const String PlayerCantStartKickVoteDefault;
|
||||||
var private localized String PlayerCantStartKickVote;
|
var private localized String PlayerCantStartKickVote;
|
||||||
|
|
||||||
var const String KickVoteNotEnoughPlayersDefault;
|
var const String KickVoteNotEnoughPlayersDefault;
|
||||||
var private localized String KickVoteNotEnoughPlayers;
|
var private localized String KickVoteNotEnoughPlayers;
|
||||||
|
|
||||||
var const String KickVoteStartedDefault;
|
var const String KickVoteStartedDefault;
|
||||||
var private localized String KickVoteStarted;
|
var private localized String KickVoteStarted;
|
||||||
|
|
||||||
var const String KickVoteStartedForPlayerDefault;
|
var const String KickVoteStartedForPlayerDefault;
|
||||||
var private localized String KickVoteStartedForPlayer;
|
var private localized String KickVoteStartedForPlayer;
|
||||||
|
|
||||||
var const String KickVoteNotStartedForPlayerDefault;
|
var const String KickVoteNotStartedForPlayerDefault;
|
||||||
var private localized String KickVoteNotStartedForPlayer;
|
var private localized String KickVoteNotStartedForPlayer;
|
||||||
|
|
||||||
var const String VotedPlayersDefault;
|
var const String VotedPlayersDefault;
|
||||||
var private localized String VotedPlayers;
|
var private localized String VotedPlayers;
|
||||||
|
|
||||||
var const String DidntVotePlayersDefault;
|
var const String DidntVotePlayersDefault;
|
||||||
var private localized String DidntVotePlayers;
|
var private localized String DidntVotePlayers;
|
||||||
|
|
||||||
enum E_CVC_LocalMessageType
|
enum E_CVC_LocalMessageType
|
||||||
{
|
{
|
||||||
CVC_PlayerIsKickProtected,
|
CVC_PlayerIsKickProtected,
|
||||||
CVC_PlayerIsStartWaveKickProtected,
|
CVC_PlayerIsStartWaveKickProtected,
|
||||||
CVC_PlayerCantStartKickVote,
|
CVC_PlayerCantStartKickVote,
|
||||||
|
|
||||||
CVC_KickVoteNotEnoughPlayers,
|
CVC_KickVoteNotEnoughPlayers,
|
||||||
CVC_KickVoteStarted,
|
CVC_KickVoteStarted,
|
||||||
CVC_KickVoteStartedForPlayer,
|
CVC_KickVoteStartedForPlayer,
|
||||||
CVC_KickVoteNotStartedForPlayer,
|
CVC_KickVoteNotStartedForPlayer,
|
||||||
|
|
||||||
CVC_KickVoteYesReceived,
|
CVC_KickVoteYesReceived,
|
||||||
CVC_KickVoteNoReceived,
|
CVC_KickVoteNoReceived,
|
||||||
CVC_KickVoteStartedHUD,
|
CVC_KickVoteStartedHUD,
|
||||||
CVC_KickVoteReceivedHUD,
|
CVC_KickVoteReceivedHUD,
|
||||||
|
|
||||||
CVC_SkipVoteYesReceived,
|
CVC_SkipVoteYesReceived,
|
||||||
CVC_SkipVoteNoReceived,
|
CVC_SkipVoteNoReceived,
|
||||||
|
|
||||||
CVC_PauseVoteYesReceived,
|
CVC_PauseVoteYesReceived,
|
||||||
CVC_PauseVoteNoReceived,
|
CVC_PauseVoteNoReceived,
|
||||||
|
|
||||||
CVC_VoteProgressHUD,
|
CVC_VoteProgressHUD,
|
||||||
};
|
};
|
||||||
|
|
||||||
private static function String ReplKicker(String Str, String Kicker)
|
private static function String ReplKicker(String Str, String Kicker)
|
||||||
{
|
{
|
||||||
return Repl(Str, "<kicker>", Kicker, false);
|
return Repl(Str, "<kicker>", Kicker, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function String ReplKickee(String Str, String Kickee)
|
private static function String ReplKickee(String Str, String Kickee)
|
||||||
{
|
{
|
||||||
return Repl(Str, "<kickee>", Kickee, false);
|
return Repl(Str, "<kickee>", Kickee, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function String ReplWaves(String Str, String Waves)
|
private static function String ReplWaves(String Str, String Waves)
|
||||||
{
|
{
|
||||||
return Repl(Str, "<waves>", Waves, false);
|
return Repl(Str, "<waves>", Waves, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function String GetLocalizedString(
|
public static function String GetLocalizedString(
|
||||||
E_LogLevel LogLevel,
|
E_LogLevel LogLevel,
|
||||||
E_CVC_LocalMessageType LMT,
|
E_CVC_LocalMessageType LMT,
|
||||||
optional String String1,
|
optional String String1,
|
||||||
optional String String2,
|
optional String String2,
|
||||||
optional String String3)
|
optional String String3)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (LMT)
|
switch (LMT)
|
||||||
{
|
{
|
||||||
case CVC_PlayerIsKickProtected:
|
case CVC_PlayerIsKickProtected:
|
||||||
return ReplKickee(default.PlayerIsKickProtected != "" ? default.PlayerIsKickProtected : default.PlayerIsKickProtectedDefault, String1);
|
return ReplKickee(default.PlayerIsKickProtected != "" ? default.PlayerIsKickProtected : default.PlayerIsKickProtectedDefault, String1);
|
||||||
|
|
||||||
case CVC_PlayerIsStartWaveKickProtected:
|
case CVC_PlayerIsStartWaveKickProtected:
|
||||||
return ReplWaves(ReplKickee(default.PlayerIsStartWaveKickProtected != "" ? default.PlayerIsStartWaveKickProtected : default.PlayerIsStartWaveKickProtectedDefault, String1), String2);
|
return ReplWaves(ReplKickee(default.PlayerIsStartWaveKickProtected != "" ? default.PlayerIsStartWaveKickProtected : default.PlayerIsStartWaveKickProtectedDefault, String1), String2);
|
||||||
|
|
||||||
case CVC_PlayerCantStartKickVote:
|
case CVC_PlayerCantStartKickVote:
|
||||||
return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1);
|
return ReplWaves(default.PlayerCantStartKickVote != "" ? default.PlayerCantStartKickVote : default.PlayerCantStartKickVoteDefault, String1);
|
||||||
|
|
||||||
case CVC_KickVoteNotEnoughPlayers:
|
case CVC_KickVoteNotEnoughPlayers:
|
||||||
return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1);
|
return ReplWaves(default.KickVoteNotEnoughPlayers != "" ? default.KickVoteNotEnoughPlayers : default.KickVoteNotEnoughPlayersDefault, String1);
|
||||||
|
|
||||||
case CVC_KickVoteYesReceived:
|
case CVC_KickVoteYesReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
||||||
|
|
||||||
case CVC_KickVoteNoReceived:
|
case CVC_KickVoteNoReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
||||||
|
|
||||||
case CVC_KickVoteStartedHUD:
|
case CVC_KickVoteStartedHUD:
|
||||||
return ReplKickee(ReplKicker((default.KickVoteStarted != "" ? default.KickVoteStarted : default.KickVoteStartedDefault), String1), String2) $ "\n" $ class'KFCommon_LocalizedStrings'.default.YesString $ ":" @ String3;
|
return ReplKickee(ReplKicker((default.KickVoteStarted != "" ? default.KickVoteStarted : default.KickVoteStartedDefault), String1), String2) $ "\n" $ class'KFCommon_LocalizedStrings'.default.YesString $ ":" @ String3;
|
||||||
|
|
||||||
case CVC_KickVoteReceivedHUD:
|
case CVC_KickVoteReceivedHUD:
|
||||||
return class'KFCommon_LocalizedStrings'.default.YesString $ ":" @ String1 $ "\n" $ class'KFCommon_LocalizedStrings'.default.NoString $ ":" @ String2;
|
return class'KFCommon_LocalizedStrings'.default.YesString $ ":" @ String1 $ "\n" $ class'KFCommon_LocalizedStrings'.default.NoString $ ":" @ String2;
|
||||||
|
|
||||||
case CVC_KickVoteStarted:
|
case CVC_KickVoteStarted:
|
||||||
return ReplKickee(ReplKicker((default.KickVoteStarted != "" ? default.KickVoteStarted : default.KickVoteStartedDefault), String1), String2);
|
return ReplKickee(ReplKicker((default.KickVoteStarted != "" ? default.KickVoteStarted : default.KickVoteStartedDefault), String1), String2);
|
||||||
|
|
||||||
case CVC_KickVoteStartedForPlayer:
|
case CVC_KickVoteStartedForPlayer:
|
||||||
return ReplKicker((default.KickVoteStartedForPlayer != "" ? default.KickVoteStartedForPlayer : default.KickVoteStartedForPlayerDefault), String1);
|
return ReplKicker((default.KickVoteStartedForPlayer != "" ? default.KickVoteStartedForPlayer : default.KickVoteStartedForPlayerDefault), String1);
|
||||||
|
|
||||||
case CVC_KickVoteNotStartedForPlayer:
|
case CVC_KickVoteNotStartedForPlayer:
|
||||||
return ReplKicker((default.KickVoteNotStartedForPlayer != "" ? default.KickVoteNotStartedForPlayer : default.KickVoteNotStartedForPlayerDefault), String1);
|
return ReplKicker((default.KickVoteNotStartedForPlayer != "" ? default.KickVoteNotStartedForPlayer : default.KickVoteNotStartedForPlayerDefault), String1);
|
||||||
|
|
||||||
case CVC_SkipVoteYesReceived:
|
case CVC_SkipVoteYesReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
||||||
|
|
||||||
case CVC_SkipVoteNoReceived:
|
case CVC_SkipVoteNoReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
||||||
|
|
||||||
case CVC_PauseVoteYesReceived:
|
case CVC_PauseVoteYesReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.YesString);
|
||||||
|
|
||||||
case CVC_PauseVoteNoReceived:
|
case CVC_PauseVoteNoReceived:
|
||||||
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
return (String1 $ ":" @ class'KFCommon_LocalizedStrings'.default.NoString);
|
||||||
|
|
||||||
case CVC_VoteProgressHUD:
|
case CVC_VoteProgressHUD:
|
||||||
return (default.DidntVotePlayers != "" ? default.DidntVotePlayers : default.DidntVotePlayersDefault) @ String2 $ (String1 != "" ? ("\n" $ (default.VotedPlayers != "" ? default.VotedPlayers : default.VotedPlayersDefault) @ String1) : "");
|
return (default.DidntVotePlayers != "" ? default.DidntVotePlayers : default.DidntVotePlayersDefault) @ String2 $ (String1 != "" ? ("\n" $ (default.VotedPlayers != "" ? default.VotedPlayers : default.VotedPlayersDefault) @ String1) : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
PlayerIsKickProtectedDefault = "<kickee> is protected from kick"
|
PlayerIsKickProtectedDefault = "<kickee> is protected from kick"
|
||||||
PlayerIsStartWaveKickProtectedDefault = "You can't kick <kickee> right now. He can be kicked when he plays at least <waves> wave(s)"
|
PlayerIsStartWaveKickProtectedDefault = "You can't kick <kickee> right now. He can be kicked when he plays at least <waves> wave(s)"
|
||||||
PlayerCantStartKickVoteDefault = "You can't start kick vote now. You can start kick vote when you play at least <waves> wave(s)"
|
PlayerCantStartKickVoteDefault = "You can't start kick vote now. You can start kick vote when you play at least <waves> wave(s)"
|
||||||
KickVoteNotEnoughPlayersDefault = "Not enough players to start vote (only players who have played at least <waves> wave(s) can vote)"
|
KickVoteNotEnoughPlayersDefault = "Not enough players to start vote (only players who have played at least <waves> wave(s) can vote)"
|
||||||
KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>"
|
KickVoteStartedDefault = "<kicker> has started a vote to kick <kickee>"
|
||||||
KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you"
|
KickVoteStartedForPlayerDefault = "<kicker> started voting to kick you"
|
||||||
KickVoteNotStartedForPlayerDefault = "<kicker> tried to kick you"
|
KickVoteNotStartedForPlayerDefault = "<kicker> tried to kick you"
|
||||||
VotedPlayersDefault = "Voted:"
|
VotedPlayersDefault = "Voted:"
|
||||||
DidntVotePlayersDefault = "Didn't vote:"
|
DidntVotePlayersDefault = "Didn't vote:"
|
||||||
}
|
}
|
@ -1,123 +1,123 @@
|
|||||||
class CVC_RepInfo extends ReplicationInfo;
|
class CVC_RepInfo extends ReplicationInfo;
|
||||||
|
|
||||||
const CVCLMT = class'CVC_LocalMessage';
|
const CVCLMT = class'CVC_LocalMessage';
|
||||||
|
|
||||||
var public E_LogLevel LogLevel;
|
var public E_LogLevel LogLevel;
|
||||||
var public CVC CVC;
|
var public CVC CVC;
|
||||||
var public int StartWave;
|
var public int StartWave;
|
||||||
|
|
||||||
var private KFPlayerController KFPC;
|
var private KFPlayerController KFPC;
|
||||||
|
|
||||||
replication
|
replication
|
||||||
{
|
{
|
||||||
if (bNetInitial && Role == ROLE_Authority)
|
if (bNetInitial && Role == ROLE_Authority)
|
||||||
LogLevel;
|
LogLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
public simulated function bool SafeDestroy()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function WriteToChatLocalized(E_CVC_LocalMessageType LMT, optional String HexColor, optional String String1, optional String String2, optional String String3)
|
public reliable client function WriteToChatLocalized(E_CVC_LocalMessageType LMT, optional String HexColor, optional String String1, optional String String2, optional String String3)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
WriteToChat(CVCLMT.static.GetLocalizedString(LogLevel, LMT, String1, String2, String3), HexColor);
|
WriteToChat(CVCLMT.static.GetLocalizedString(LogLevel, LMT, String1, String2, String3), HexColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function WriteToChat(String Message, optional String HexColor)
|
public reliable client function WriteToChat(String Message, optional String HexColor)
|
||||||
{
|
{
|
||||||
local KFGFxHudWrapper HUD;
|
local KFGFxHudWrapper HUD;
|
||||||
|
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (GetKFPC() == None) return;
|
if (GetKFPC() == None) return;
|
||||||
|
|
||||||
if (KFPC.MyGFxManager.PartyWidget != None && KFPC.MyGFxManager.PartyWidget.PartyChatWidget != None)
|
if (KFPC.MyGFxManager.PartyWidget != None && KFPC.MyGFxManager.PartyWidget.PartyChatWidget != None)
|
||||||
{
|
{
|
||||||
KFPC.MyGFxManager.PartyWidget.PartyChatWidget.AddChatMessage(Message, HexColor);
|
KFPC.MyGFxManager.PartyWidget.PartyChatWidget.AddChatMessage(Message, HexColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD = KFGFxHudWrapper(KFPC.myHUD);
|
HUD = KFGFxHudWrapper(KFPC.myHUD);
|
||||||
if (HUD != None && HUD.HUDMovie != None && HUD.HUDMovie.HudChatBox != None)
|
if (HUD != None && HUD.HUDMovie != None && HUD.HUDMovie.HudChatBox != None)
|
||||||
{
|
{
|
||||||
HUD.HUDMovie.HudChatBox.AddChatMessage(Message, HexColor);
|
HUD.HUDMovie.HudChatBox.AddChatMessage(Message, HexColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function WriteToHUDLocalized(E_CVC_LocalMessageType LMT, optional String String1, optional String String2, optional String String3, optional float DisplayTime = 0.0f)
|
public reliable client function WriteToHUDLocalized(E_CVC_LocalMessageType LMT, optional String String1, optional String String2, optional String String3, optional float DisplayTime = 0.0f)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
WriteToHUD(CVCLMT.static.GetLocalizedString(LogLevel, LMT, String1, String2, String3), DisplayTime);
|
WriteToHUD(CVCLMT.static.GetLocalizedString(LogLevel, LMT, String1, String2, String3), DisplayTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function WriteToHUD(String Message, optional float DisplayTime = 0.0f)
|
public reliable client function WriteToHUD(String Message, optional float DisplayTime = 0.0f)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (GetKFPC() == None) return;
|
if (GetKFPC() == None) return;
|
||||||
|
|
||||||
if (DisplayTime == 0.0f)
|
if (DisplayTime == 0.0f)
|
||||||
{
|
{
|
||||||
DisplayTime = CalcDisplayTime(Message);
|
DisplayTime = CalcDisplayTime(Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KFPC.MyGFxHUD != None)
|
if (KFPC.MyGFxHUD != None)
|
||||||
{
|
{
|
||||||
KFPC.MyGFxHUD.DisplayMapText(Message, DisplayTime, false);
|
KFPC.MyGFxHUD.DisplayMapText(Message, DisplayTime, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function DefferedClearMessageHUD(optional float Time = 0.0f)
|
public reliable client function DefferedClearMessageHUD(optional float Time = 0.0f)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
SetTimer(Time, false, nameof(ClearMessageHUD));
|
SetTimer(Time, false, nameof(ClearMessageHUD));
|
||||||
}
|
}
|
||||||
|
|
||||||
public reliable client function ClearMessageHUD()
|
public reliable client function ClearMessageHUD()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (GetKFPC() == None) return;
|
if (GetKFPC() == None) return;
|
||||||
|
|
||||||
if (KFPC.MyGFxHUD != None && KFPC.MyGFxHUD.MapTextWidget != None)
|
if (KFPC.MyGFxHUD != None && KFPC.MyGFxHUD.MapTextWidget != None)
|
||||||
{
|
{
|
||||||
KFPC.MyGFxHUD.MapTextWidget.StoredMessageList.Length = 0;
|
KFPC.MyGFxHUD.MapTextWidget.StoredMessageList.Length = 0;
|
||||||
KFPC.MyGFxHUD.MapTextWidget.HideMessage();
|
KFPC.MyGFxHUD.MapTextWidget.HideMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function float CalcDisplayTime(String Message)
|
private function float CalcDisplayTime(String Message)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
return FClamp(Len(Message) / 20.0f, 3, 30);
|
return FClamp(Len(Message) / 20.0f, 3, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public simulated function KFPlayerController GetKFPC()
|
public simulated function KFPlayerController GetKFPC()
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
if (KFPC != None) return KFPC;
|
if (KFPC != None) return KFPC;
|
||||||
|
|
||||||
KFPC = KFPlayerController(Owner);
|
KFPC = KFPlayerController(Owner);
|
||||||
|
|
||||||
if (KFPC == None && ROLE < ROLE_Authority)
|
if (KFPC == None && ROLE < ROLE_Authority)
|
||||||
{
|
{
|
||||||
KFPC = KFPlayerController(GetALocalPlayerController());
|
KFPC = KFPlayerController(GetALocalPlayerController());
|
||||||
}
|
}
|
||||||
|
|
||||||
return KFPC;
|
return KFPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
bAlwaysRelevant = false
|
bAlwaysRelevant = false
|
||||||
bOnlyRelevantToOwner = true
|
bOnlyRelevantToOwner = true
|
||||||
bSkipActorPropertyReplication = false
|
bSkipActorPropertyReplication = false
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,82 +1,82 @@
|
|||||||
class KickProtected extends Object
|
class KickProtected extends Object
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config bool NotifyPlayerAboutKickAttempt;
|
var public config bool NotifyPlayerAboutKickAttempt;
|
||||||
var private config Array<String> PlayerID;
|
var private config Array<String> PlayerID;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Array<UniqueNetId> Load(E_LogLevel LogLevel)
|
public static function Array<UniqueNetId> Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local Array<UniqueNetId> UIDs;
|
local Array<UniqueNetId> UIDs;
|
||||||
local UniqueNetId UID;
|
local UniqueNetId UID;
|
||||||
local String ID;
|
local String ID;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
foreach default.PlayerID(ID)
|
foreach default.PlayerID(ID)
|
||||||
{
|
{
|
||||||
if (AnyToUID(ID, UID, LogLevel))
|
if (AnyToUID(ID, UID, LogLevel))
|
||||||
{
|
{
|
||||||
UIDs.AddItem(UID);
|
UIDs.AddItem(UID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
`Log_Warn("Can't load PlayerID:" @ ID);
|
`Log_Warn("Can't load PlayerID:" @ ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return UIDs;
|
return UIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function ApplyDefault(E_LogLevel LogLevel)
|
private static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.NotifyPlayerAboutKickAttempt = true;
|
default.NotifyPlayerAboutKickAttempt = true;
|
||||||
default.PlayerID.Length = 0;
|
default.PlayerID.Length = 0;
|
||||||
default.PlayerID.AddItem("76561190000000000");
|
default.PlayerID.AddItem("76561190000000000");
|
||||||
default.PlayerID.AddItem("0x0000000000000000");
|
default.PlayerID.AddItem("0x0000000000000000");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function bool IsUID(String ID, E_LogLevel LogLevel)
|
private static function bool IsUID(String ID, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
return (Left(ID, 2) ~= "0x");
|
return (Left(ID, 2) ~= "0x");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function bool AnyToUID(String ID, out UniqueNetId UID, E_LogLevel LogLevel)
|
private static function bool AnyToUID(String ID, out UniqueNetId UID, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local OnlineSubsystem OS;
|
local OnlineSubsystem OS;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
OS = class'GameEngine'.static.GetOnlineSubsystem();
|
OS = class'GameEngine'.static.GetOnlineSubsystem();
|
||||||
|
|
||||||
if (OS == None) return false;
|
if (OS == None) return false;
|
||||||
|
|
||||||
return IsUID(ID, LogLevel) ? OS.StringToUniqueNetId(ID, UID) : OS.Int64ToUniqueNetId(ID, UID);
|
return IsUID(ID, LogLevel) ? OS.StringToUniqueNetId(ID, UID) : OS.Int64ToUniqueNetId(ID, UID);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,52 +1,52 @@
|
|||||||
class KickVote extends BaseVote
|
class KickVote extends BaseVote
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config bool bHudNotificationsOnlyOnTraderTime;
|
var public config bool bHudNotificationsOnlyOnTraderTime;
|
||||||
var public config int MinVotingPlayersToStartKickVote;
|
var public config int MinVotingPlayersToStartKickVote;
|
||||||
var public config int MaxKicks;
|
var public config int MaxKicks;
|
||||||
var public config bool bLogKickVote;
|
var public config bool bLogKickVote;
|
||||||
var public config String WarningColorHex;
|
var public config String WarningColorHex;
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
if (default.MinVotingPlayersToStartKickVote < 2)
|
if (default.MinVotingPlayersToStartKickVote < 2)
|
||||||
{
|
{
|
||||||
`Log_Error("MinVotingPlayersToStartKickVote" @ "(" $ default.MinVotingPlayersToStartKickVote $ ")" @ "must be greater than 1");
|
`Log_Error("MinVotingPlayersToStartKickVote" @ "(" $ default.MinVotingPlayersToStartKickVote $ ")" @ "must be greater than 1");
|
||||||
default.MinVotingPlayersToStartKickVote = 2;
|
default.MinVotingPlayersToStartKickVote = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (default.MaxKicks < 1)
|
if (default.MaxKicks < 1)
|
||||||
{
|
{
|
||||||
`Log_Error("MaxKicks" @ "(" $ default.MaxKicks $ ")" @ "must be greater than 0");
|
`Log_Error("MaxKicks" @ "(" $ default.MaxKicks $ ")" @ "must be greater than 0");
|
||||||
default.MaxKicks = 2;
|
default.MaxKicks = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsValidHexColor(default.WarningColorHex, LogLevel))
|
if (!IsValidHexColor(default.WarningColorHex, LogLevel))
|
||||||
{
|
{
|
||||||
`Log_Error("WarningColorHex" @ "(" $ default.WarningColorHex $ ")" @ "is not valid hex color");
|
`Log_Error("WarningColorHex" @ "(" $ default.WarningColorHex $ ")" @ "is not valid hex color");
|
||||||
default.WarningColorHex = class'KFLocalMessage'.default.PriorityColor;
|
default.WarningColorHex = class'KFLocalMessage'.default.PriorityColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Super.Load(LogLevel);
|
Super.Load(LogLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
Super.ApplyDefault(LogLevel);
|
Super.ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default.bHudNotificationsOnlyOnTraderTime = true;
|
default.bHudNotificationsOnlyOnTraderTime = true;
|
||||||
default.MinVotingPlayersToStartKickVote = 2;
|
default.MinVotingPlayersToStartKickVote = 2;
|
||||||
default.MaxKicks = 2;
|
default.MaxKicks = 2;
|
||||||
default.DefferedClearHUD = 2.0f;
|
default.DefferedClearHUD = 2.0f;
|
||||||
default.WarningColorHex = class'KFLocalMessage'.default.PriorityColor;
|
default.WarningColorHex = class'KFLocalMessage'.default.PriorityColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
class MapStat extends Object
|
class MapStat extends Object
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config bool bEnable;
|
var public config bool bEnable;
|
||||||
var public config String SortPolicy;
|
var public config String SortPolicy;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Locs(default.SortPolicy))
|
switch (Locs(default.SortPolicy))
|
||||||
{
|
{
|
||||||
case "counterasc": return;
|
case "counterasc": return;
|
||||||
case "counterdesc": return;
|
case "counterdesc": return;
|
||||||
case "nameasc": return;
|
case "nameasc": return;
|
||||||
case "namedesc": return;
|
case "namedesc": return;
|
||||||
case "playtimetotalasc": return;
|
case "playtimetotalasc": return;
|
||||||
case "playtimetotaldesc": return;
|
case "playtimetotaldesc": return;
|
||||||
case "playtimeavgasc": return;
|
case "playtimeavgasc": return;
|
||||||
case "playtimeavgdesc": return;
|
case "playtimeavgdesc": return;
|
||||||
}
|
}
|
||||||
|
|
||||||
`Log_Error("Can't load SortPolicy (" $ default.SortPolicy $ "), must be one of: CounterAsc CounterDesc NameAsc NameDesc PlaytimeTotalAsc PlaytimeTotalDesc PlaytimeAvgAsc PlaytimeAvgDesc");
|
`Log_Error("Can't load SortPolicy (" $ default.SortPolicy $ "), must be one of: CounterAsc CounterDesc NameAsc NameDesc PlaytimeTotalAsc PlaytimeTotalDesc PlaytimeAvgAsc PlaytimeAvgDesc");
|
||||||
default.SortPolicy = "CounterDesc";
|
default.SortPolicy = "CounterDesc";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.bEnable = false;
|
default.bEnable = false;
|
||||||
default.SortPolicy = "CounterDesc";
|
default.SortPolicy = "CounterDesc";
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,70 +1,70 @@
|
|||||||
class MapStats extends Object
|
class MapStats extends Object
|
||||||
config(MapStats);
|
config(MapStats);
|
||||||
|
|
||||||
struct MapStatEntry
|
struct MapStatEntry
|
||||||
{
|
{
|
||||||
var String Name; // map
|
var String Name; // map
|
||||||
var int Counter; // play count
|
var int Counter; // play count
|
||||||
var int PlayTimeTotal; // minutes total
|
var int PlayTimeTotal; // minutes total
|
||||||
var int PlayTimeAvg; // minutes per map
|
var int PlayTimeAvg; // minutes per map
|
||||||
};
|
};
|
||||||
var config array<MapStatEntry> MapStat;
|
var config array<MapStatEntry> MapStat;
|
||||||
|
|
||||||
static delegate int CounterAsc (MapStatEntry A, MapStatEntry B) { return B.Counter < A.Counter ? -1 : 0; }
|
static delegate int CounterAsc (MapStatEntry A, MapStatEntry B) { return B.Counter < A.Counter ? -1 : 0; }
|
||||||
static delegate int CounterDesc (MapStatEntry A, MapStatEntry B) { return A.Counter < B.Counter ? -1 : 0; }
|
static delegate int CounterDesc (MapStatEntry A, MapStatEntry B) { return A.Counter < B.Counter ? -1 : 0; }
|
||||||
static delegate int NameAsc (MapStatEntry A, MapStatEntry B) { return B.Name < A.Name ? -1 : 0; }
|
static delegate int NameAsc (MapStatEntry A, MapStatEntry B) { return B.Name < A.Name ? -1 : 0; }
|
||||||
static delegate int NameDesc (MapStatEntry A, MapStatEntry B) { return A.Name < B.Name ? -1 : 0; }
|
static delegate int NameDesc (MapStatEntry A, MapStatEntry B) { return A.Name < B.Name ? -1 : 0; }
|
||||||
static delegate int PlayTimeTotalAsc (MapStatEntry A, MapStatEntry B) { return B.PlayTimeTotal < A.PlayTimeTotal ? -1 : 0; }
|
static delegate int PlayTimeTotalAsc (MapStatEntry A, MapStatEntry B) { return B.PlayTimeTotal < A.PlayTimeTotal ? -1 : 0; }
|
||||||
static delegate int PlayTimeTotalDesc (MapStatEntry A, MapStatEntry B) { return A.PlayTimeTotal < B.PlayTimeTotal ? -1 : 0; }
|
static delegate int PlayTimeTotalDesc (MapStatEntry A, MapStatEntry B) { return A.PlayTimeTotal < B.PlayTimeTotal ? -1 : 0; }
|
||||||
static delegate int PlayTimeAvgAsc (MapStatEntry A, MapStatEntry B) { return B.PlayTimeAvg < A.PlayTimeAvg ? -1 : 0; }
|
static delegate int PlayTimeAvgAsc (MapStatEntry A, MapStatEntry B) { return B.PlayTimeAvg < A.PlayTimeAvg ? -1 : 0; }
|
||||||
static delegate int PlayTimeAvgDesc (MapStatEntry A, MapStatEntry B) { return A.PlayTimeAvg < B.PlayTimeAvg ? -1 : 0; }
|
static delegate int PlayTimeAvgDesc (MapStatEntry A, MapStatEntry B) { return A.PlayTimeAvg < B.PlayTimeAvg ? -1 : 0; }
|
||||||
|
|
||||||
static function SortMapStat(String SortPolicy, E_LogLevel LogLevel)
|
static function SortMapStat(String SortPolicy, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Locs(SortPolicy))
|
switch (Locs(SortPolicy))
|
||||||
{
|
{
|
||||||
case "counterasc": default.MapStat.Sort(CounterAsc); break;
|
case "counterasc": default.MapStat.Sort(CounterAsc); break;
|
||||||
case "counterdesc": default.MapStat.Sort(CounterDesc); break;
|
case "counterdesc": default.MapStat.Sort(CounterDesc); break;
|
||||||
case "nameasc": default.MapStat.Sort(NameAsc); break;
|
case "nameasc": default.MapStat.Sort(NameAsc); break;
|
||||||
case "namedesc": default.MapStat.Sort(NameDesc); break;
|
case "namedesc": default.MapStat.Sort(NameDesc); break;
|
||||||
case "playtimetotalasc": default.MapStat.Sort(PlayTimeTotalAsc); break;
|
case "playtimetotalasc": default.MapStat.Sort(PlayTimeTotalAsc); break;
|
||||||
case "playtimetotaldesc": default.MapStat.Sort(PlayTimeTotalDesc); break;
|
case "playtimetotaldesc": default.MapStat.Sort(PlayTimeTotalDesc); break;
|
||||||
case "playtimeavgasc": default.MapStat.Sort(PlayTimeAvgAsc); break;
|
case "playtimeavgasc": default.MapStat.Sort(PlayTimeAvgAsc); break;
|
||||||
case "playtimeavgdesc": default.MapStat.Sort(PlayTimeAvgDesc); break;
|
case "playtimeavgdesc": default.MapStat.Sort(PlayTimeAvgDesc); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static function IncMapStat(String Map, int PlayTime, String SortPolicy, E_LogLevel LogLevel)
|
static function IncMapStat(String Map, int PlayTime, String SortPolicy, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local int MapStatEntryIndex;
|
local int MapStatEntryIndex;
|
||||||
local MapStatEntry NewEntry;
|
local MapStatEntry NewEntry;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
MapStatEntryIndex = default.MapStat.Find('Name', Map);
|
MapStatEntryIndex = default.MapStat.Find('Name', Map);
|
||||||
if (MapStatEntryIndex == INDEX_NONE)
|
if (MapStatEntryIndex == INDEX_NONE)
|
||||||
{
|
{
|
||||||
NewEntry.Name = Map;
|
NewEntry.Name = Map;
|
||||||
NewEntry.Counter = 1;
|
NewEntry.Counter = 1;
|
||||||
NewEntry.PlayTimeTotal = PlayTime;
|
NewEntry.PlayTimeTotal = PlayTime;
|
||||||
NewEntry.PlayTimeAvg = PlayTime;
|
NewEntry.PlayTimeAvg = PlayTime;
|
||||||
default.MapStat.AddItem(NewEntry);
|
default.MapStat.AddItem(NewEntry);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
default.MapStat[MapStatEntryIndex].Counter++;
|
default.MapStat[MapStatEntryIndex].Counter++;
|
||||||
default.MapStat[MapStatEntryIndex].PlayTimeTotal += PlayTime;
|
default.MapStat[MapStatEntryIndex].PlayTimeTotal += PlayTime;
|
||||||
default.MapStat[MapStatEntryIndex].PlayTimeAvg = default.MapStat[MapStatEntryIndex].PlayTimeTotal / default.MapStat[MapStatEntryIndex].Counter;
|
default.MapStat[MapStatEntryIndex].PlayTimeAvg = default.MapStat[MapStatEntryIndex].PlayTimeTotal / default.MapStat[MapStatEntryIndex].Counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
SortMapStat(SortPolicy, LogLevel);
|
SortMapStat(SortPolicy, LogLevel);
|
||||||
|
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
class MapVote extends Object
|
class MapVote extends Object
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config String DefaultNextMap; // Any, Official, Custom, KF-<MapName>
|
var public config String DefaultNextMap; // Any, Official, Custom, KF-<MapName>
|
||||||
var public config bool bRandomizeNextMap;
|
var public config bool bRandomizeNextMap;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local String LowerDefaultNextMap;
|
local String LowerDefaultNextMap;
|
||||||
|
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
LowerDefaultNextMap = Locs(default.DefaultNextMap);
|
LowerDefaultNextMap = Locs(default.DefaultNextMap);
|
||||||
|
|
||||||
switch (LowerDefaultNextMap)
|
switch (LowerDefaultNextMap)
|
||||||
{
|
{
|
||||||
case "any": return;
|
case "any": return;
|
||||||
case "official": return;
|
case "official": return;
|
||||||
case "custom": return;
|
case "custom": return;
|
||||||
default: if (Left(LowerDefaultNextMap, 3) == "kf-") return;
|
default: if (Left(LowerDefaultNextMap, 3) == "kf-") return;
|
||||||
}
|
}
|
||||||
|
|
||||||
`Log_Error("Can't load DefaultNextMap (" $ default.DefaultNextMap $ "), must be one of: Any Official Custom KF-<MapName>");
|
`Log_Error("Can't load DefaultNextMap (" $ default.DefaultNextMap $ "), must be one of: Any Official Custom KF-<MapName>");
|
||||||
default.DefaultNextMap = "Any";
|
default.DefaultNextMap = "Any";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.bRandomizeNextMap = true;
|
default.bRandomizeNextMap = true;
|
||||||
default.DefaultNextMap = "Any";
|
default.DefaultNextMap = "Any";
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
class PauseVote extends BaseVote
|
class PauseVote extends BaseVote
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
Super.ApplyDefault(LogLevel);
|
Super.ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default.PositiveColorHex = class'KFLocalMessage'.default.GameColor;
|
default.PositiveColorHex = class'KFLocalMessage'.default.GameColor;
|
||||||
default.bChatNotifications = false;
|
default.bChatNotifications = false;
|
||||||
default.bHudNotifications = false;
|
default.bHudNotifications = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
class SkipTraderVote extends BaseVote
|
class SkipTraderVote extends BaseVote
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
Super.ApplyDefault(LogLevel);
|
Super.ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default.PositiveColorHex = class'KFLocalMessage'.default.GameColor;
|
default.PositiveColorHex = class'KFLocalMessage'.default.GameColor;
|
||||||
default.bChatNotifications = false;
|
default.bChatNotifications = false;
|
||||||
default.bHudNotifications = false;
|
default.bHudNotifications = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
class StartWaveKickProtection extends Object
|
class StartWaveKickProtection extends Object
|
||||||
config(CVC)
|
config(CVC)
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
var public config int Waves;
|
var public config int Waves;
|
||||||
var public config int MinLevel;
|
var public config int MinLevel;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
public static function InitConfig(int Version, int LatestVersion, E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
switch (Version)
|
switch (Version)
|
||||||
{
|
{
|
||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault(LogLevel);
|
ApplyDefault(LogLevel);
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LatestVersion != Version)
|
if (LatestVersion != Version)
|
||||||
{
|
{
|
||||||
StaticSaveConfig();
|
StaticSaveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Load(E_LogLevel LogLevel)
|
public static function Load(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
if (default.Waves < 0)
|
if (default.Waves < 0)
|
||||||
{
|
{
|
||||||
`Log_Error("Waves" @ "(" $ default.Waves $ ")" @ "must be greater than or equal 0");
|
`Log_Error("Waves" @ "(" $ default.Waves $ ")" @ "must be greater than or equal 0");
|
||||||
default.Waves = 0;
|
default.Waves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (default.MinLevel < 0 || default.MinLevel > 25)
|
if (default.MinLevel < 0 || default.MinLevel > 25)
|
||||||
{
|
{
|
||||||
`Log_Error("MinLevel" @ "(" $ default.MinLevel $ ")" @ "must be in range 0-25");
|
`Log_Error("MinLevel" @ "(" $ default.MinLevel $ ")" @ "must be in range 0-25");
|
||||||
default.MinLevel = 0;
|
default.MinLevel = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function ApplyDefault(E_LogLevel LogLevel)
|
protected static function ApplyDefault(E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
`Log_TraceStatic();
|
`Log_TraceStatic();
|
||||||
|
|
||||||
default.Waves = 0;
|
default.Waves = 0;
|
||||||
default.MinLevel = 0;
|
default.MinLevel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
class _Logger extends Object
|
class _Logger extends Object
|
||||||
abstract;
|
abstract;
|
||||||
|
|
||||||
enum E_LogLevel
|
enum E_LogLevel
|
||||||
{
|
{
|
||||||
LL_WrongLevel,
|
LL_WrongLevel,
|
||||||
LL_None,
|
LL_None,
|
||||||
LL_Fatal,
|
LL_Fatal,
|
||||||
LL_Error,
|
LL_Error,
|
||||||
LL_Warning,
|
LL_Warning,
|
||||||
LL_Kick,
|
LL_Kick,
|
||||||
LL_Info,
|
LL_Info,
|
||||||
LL_Debug,
|
LL_Debug,
|
||||||
LL_Trace,
|
LL_Trace,
|
||||||
LL_All
|
LL_All
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
// Constants
|
// Constants
|
||||||
`define NO_CONFIG 0
|
`define NO_CONFIG 0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// Imports
|
// Imports
|
||||||
`include(Logger.uci)
|
`include(Logger.uci)
|
||||||
`include(Constants.uci)
|
`include(Constants.uci)
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
// Logger
|
// Logger
|
||||||
`define Log_Tag 'CVC'
|
`define Log_Tag 'CVC'
|
||||||
|
|
||||||
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
`define LocationStatic "`{ClassName}::" $ GetFuncName()
|
||||||
|
|
||||||
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
`define Log_Base(msg, cond) `log(`msg `if(`cond), `cond`{endif}, `Log_Tag)
|
||||||
|
|
||||||
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
`define Log_Fatal(msg) `log("FATAL:" @ `msg, (LogLevel >= LL_Fatal), `Log_Tag)
|
||||||
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
`define Log_Error(msg) `log("ERROR:" @ `msg, (LogLevel >= LL_Error), `Log_Tag)
|
||||||
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
`define Log_Warn(msg) `log("WARN:" @ `msg, (LogLevel >= LL_Warning), `Log_Tag)
|
||||||
`define Log_Kick(msg) `log("KICK:" @ `msg, (LogLevel >= LL_Kick), `Log_Tag)
|
`define Log_Kick(msg) `log("KICK:" @ `msg, (LogLevel >= LL_Kick), `Log_Tag)
|
||||||
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
`define Log_Info(msg) `log("INFO:" @ `msg, (LogLevel >= LL_Info), `Log_Tag)
|
||||||
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
`define Log_Debug(msg) `log("DEBUG:" @ `msg, (LogLevel >= LL_Debug), `Log_Tag)
|
||||||
|
|
||||||
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
`define Log_Trace(msg) `log("TRACE:" @ `Location `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||||
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
`define Log_TraceStatic(msg) `log("TRACE:" @ `LocationStatic `if(`msg) @ `msg`{endif}, (LogLevel >= LL_Trace), `Log_Tag)
|
||||||
|
Binary file not shown.
Binary file not shown.
12
README.md
12
README.md
@ -6,10 +6,10 @@
|
|||||||
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-ControlledVoteCollector)](https://github.com/GenZmeY/KF2-ControlledVoteCollector/tags)
|
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/GenZmeY/KF2-ControlledVoteCollector)](https://github.com/GenZmeY/KF2-ControlledVoteCollector/tags)
|
||||||
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-ControlledVoteCollector)](LICENSE)
|
[![GitHub](https://img.shields.io/github/license/GenZmeY/KF2-ControlledVoteCollector)](LICENSE)
|
||||||
|
|
||||||
# Description
|
## Description
|
||||||
New vote collector with improvements and features.
|
New vote collector with improvements and features.
|
||||||
|
|
||||||
# Features
|
## Features
|
||||||
- map statistics;
|
- map statistics;
|
||||||
- default/next map setting;
|
- default/next map setting;
|
||||||
- anonymous or public voting;
|
- anonymous or public voting;
|
||||||
@ -17,10 +17,10 @@ New vote collector with improvements and features.
|
|||||||
- kick voting setup;
|
- kick voting setup;
|
||||||
- early kick protection.
|
- early kick protection.
|
||||||
|
|
||||||
# Usage & Setup
|
## Usage & Setup
|
||||||
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
[See steam workshop page](https://steamcommunity.com/sharedfiles/filedetails/?id=2847465899)
|
||||||
|
|
||||||
# Build
|
## Build
|
||||||
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
|
**Note:** If you want to build/test/brew/publish a mutator without git-bash and/or scripts, follow [these instructions](https://tripwireinteractive.atlassian.net/wiki/spaces/KF2SW/pages/26247172/KF2+Code+Modding+How-to) instead of what is described here.
|
||||||
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
1. Install [Killing Floor 2](https://store.steampowered.com/app/232090/Killing_Floor_2/), Killing Floor 2 - SDK and [git for windows](https://git-scm.com/download/win);
|
||||||
2. open git-bash and go to any folder where you want to store sources:
|
2. open git-bash and go to any folder where you want to store sources:
|
||||||
@ -34,9 +34,9 @@ New vote collector with improvements and features.
|
|||||||
5. The compiled files will be here:
|
5. The compiled files will be here:
|
||||||
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
`C:\Users\<USERNAME>\Documents\My Games\KillingFloor2\KFGame\Unpublished\BrewedPC\Script\`
|
||||||
|
|
||||||
# Bug reports
|
## Bug reports
|
||||||
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-ControlledVoteCollector/issues) and check if there is a description of your bug. If not, create a new issue.
|
If you find a bug, go to the [issue page](https://github.com/GenZmeY/KF2-ControlledVoteCollector/issues) and check if there is a description of your bug. If not, create a new issue.
|
||||||
Describe what the bug looks like and how reproduce it.
|
Describe what the bug looks like and how reproduce it.
|
||||||
|
|
||||||
# License
|
## License
|
||||||
[GNU GPLv3](LICENSE)
|
[GNU GPLv3](LICENSE)
|
||||||
|
@ -7,7 +7,7 @@ StripSource="True"
|
|||||||
|
|
||||||
# Mutators to be compiled
|
# Mutators to be compiled
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# Mutators will be compiled in the specified order
|
# Mutators will be compiled in the specified order
|
||||||
PackageBuildOrder="CVC"
|
PackageBuildOrder="CVC"
|
||||||
|
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ PackageBuildOrder="CVC"
|
|||||||
# Packages you want to brew using @peelz's patched KFEditor.
|
# Packages you want to brew using @peelz's patched KFEditor.
|
||||||
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
# Useful for cases where regular brew doesn't put *.upk inside the package.
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# The order doesn't matter
|
# The order doesn't matter
|
||||||
PackagePeelzBrew=""
|
PackagePeelzBrew=""
|
||||||
|
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ PackagePeelzBrew=""
|
|||||||
|
|
||||||
# Mutators that will be uploaded to the workshop
|
# Mutators that will be uploaded to the workshop
|
||||||
# Specify them with a space as a separator,
|
# Specify them with a space as a separator,
|
||||||
# The order doesn't matter
|
# The order doesn't matter
|
||||||
PackageUpload="CVC"
|
PackageUpload="CVC"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user