2021-05-31 01:46:53 +00:00
|
|
|
class ScoreboardExtRepInfo extends ReplicationInfo;
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
var public array<UIDRankRelation> PlayerInfos;
|
|
|
|
var public array<RankInfo> PlayerRanks;
|
2021-05-31 01:46:53 +00:00
|
|
|
|
2021-05-31 04:04:26 +00:00
|
|
|
var public string SystemAdminRank;
|
2021-06-07 01:42:49 +00:00
|
|
|
var public ColorRGB SystemAdminColor;
|
2021-05-31 04:04:26 +00:00
|
|
|
var public Fields SystemAdminApplyColorToFields;
|
2021-05-31 01:46:53 +00:00
|
|
|
|
2021-05-31 04:04:26 +00:00
|
|
|
var public string SystemPlayerRank;
|
2021-06-07 01:42:49 +00:00
|
|
|
var public ColorRGB SystemPlayerColor;
|
2021-05-31 04:04:26 +00:00
|
|
|
var public Fields SystemPlayerApplyColorToFields;
|
2021-05-31 01:46:53 +00:00
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
var private bool InitFinished, RanksFinished, InfosFinished;
|
|
|
|
var private int InfosReplicateProgress, RanksReplicateProgress;
|
2021-05-31 04:04:26 +00:00
|
|
|
|
|
|
|
var private KFScoreBoard SC;
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
public function ClientStartReplication()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
GetScoreboard();
|
|
|
|
|
|
|
|
ClientInitSystem(
|
|
|
|
SystemAdminRank,
|
|
|
|
SystemAdminColor,
|
|
|
|
SystemAdminApplyColorToFields,
|
|
|
|
SystemPlayerRank,
|
|
|
|
SystemPlayerColor,
|
|
|
|
SystemPlayerApplyColorToFields);
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
SetTimer(0.01f, true, nameof(ClientReplicateRanks));
|
2021-05-31 04:04:26 +00:00
|
|
|
SetTimer(0.01f, true, nameof(ClientReplicateInfos));
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
public function ClientReplicateRanks()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
if (RanksReplicateProgress < PlayerRanks.Length)
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
ClientAddPlayerRank(PlayerRanks[RanksReplicateProgress]);
|
|
|
|
++RanksReplicateProgress;
|
2021-05-31 04:04:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
ClearTimer(nameof(ClientReplicateRanks));
|
|
|
|
RankReplicationFinished();
|
2021-05-31 04:04:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
public function ClientReplicateInfos()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
if (InfosReplicateProgress < PlayerInfos.Length)
|
|
|
|
{
|
|
|
|
ClientAddPlayerInfo(PlayerInfos[InfosReplicateProgress]);
|
|
|
|
++InfosReplicateProgress;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ClearTimer(nameof(ClientReplicateInfos));
|
|
|
|
InfosReplicationFinished();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function GetScoreboard()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
if (SC != None)
|
|
|
|
{
|
|
|
|
ClearTimer(nameof(GetScoreboard));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
SC = ScoreboardExtHUD(GetALocalPlayerController().myHUD).Scoreboard;
|
|
|
|
SetTimer(0.1f, false, nameof(GetScoreboard));
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientAddPlayerRank(RankInfo Rank)
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
PlayerRanks.AddItem(Rank);
|
2021-05-31 04:04:26 +00:00
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientAddPlayerInfo(UIDRankRelation PlayerInfo)
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
PlayerInfos.AddItem(PlayerInfo);
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function RankReplicationFinished()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
RanksFinished = true;
|
|
|
|
ClientRanksApply();
|
2021-05-31 04:04:26 +00:00
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function InfosReplicationFinished()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
InfosFinished = true;
|
|
|
|
ClientInfosApply();
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientInitSystem(
|
2021-05-31 01:46:53 +00:00
|
|
|
string _SystemAdminRank,
|
2021-06-07 01:42:49 +00:00
|
|
|
ColorRGB _SystemAdminColor,
|
2021-05-31 01:46:53 +00:00
|
|
|
Fields _SystemAdminApplyColorToFields,
|
|
|
|
string _SystemPlayerRank,
|
2021-06-07 01:42:49 +00:00
|
|
|
ColorRGB _SystemPlayerColor,
|
2021-05-31 01:46:53 +00:00
|
|
|
Fields _SystemPlayerApplyColorToFields)
|
|
|
|
{
|
|
|
|
SystemAdminRank = _SystemAdminRank;
|
|
|
|
SystemAdminColor = _SystemAdminColor;
|
|
|
|
SystemAdminApplyColorToFields = _SystemAdminApplyColorToFields;
|
|
|
|
SystemPlayerRank = _SystemPlayerRank;
|
|
|
|
SystemPlayerColor = _SystemPlayerColor;
|
|
|
|
SystemPlayerApplyColorToFields = _SystemPlayerApplyColorToFields;
|
|
|
|
|
2021-05-31 04:04:26 +00:00
|
|
|
ClientSystemApply();
|
2021-05-31 01:46:53 +00:00
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientSystemApply()
|
2021-05-31 01:46:53 +00:00
|
|
|
{
|
|
|
|
if (SC == None)
|
|
|
|
{
|
2021-05-31 04:04:26 +00:00
|
|
|
SetTimer(0.1f, false, nameof(ClientSystemApply));
|
2021-05-31 01:46:53 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
SC.SystemAdminRank = SystemAdminRank;
|
|
|
|
SC.SystemAdminColor = SystemAdminColor;
|
|
|
|
SC.SystemAdminApplyColorToFields = SystemAdminApplyColorToFields;
|
|
|
|
SC.SystemPlayerRank = SystemPlayerRank;
|
|
|
|
SC.SystemPlayerColor = SystemPlayerColor;
|
|
|
|
SC.SystemPlayerApplyColorToFields = SystemPlayerApplyColorToFields;
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
InitFinished = true;
|
2021-05-31 04:04:26 +00:00
|
|
|
Finished();
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientRanksApply()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
if (SC == None)
|
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
SetTimer(0.1f, false, nameof(ClientRanksApply));
|
2021-05-31 04:04:26 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
SC.PlayerRanks = PlayerRanks;
|
|
|
|
RanksFinished = true;
|
2021-05-31 04:04:26 +00:00
|
|
|
Finished();
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function ClientInfosApply()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
|
|
|
if (SC == None)
|
|
|
|
{
|
|
|
|
SetTimer(0.1f, false, nameof(ClientInfosApply));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
SC.PlayerInfos = PlayerInfos;
|
2021-06-08 21:21:28 +00:00
|
|
|
RanksFinished = true;
|
2021-05-31 04:04:26 +00:00
|
|
|
Finished();
|
|
|
|
}
|
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
private reliable client function Finished()
|
2021-05-31 04:04:26 +00:00
|
|
|
{
|
2021-06-08 21:21:28 +00:00
|
|
|
if (InitFinished && RanksFinished && InfosFinished)
|
2021-05-31 04:04:26 +00:00
|
|
|
Destroy();
|
2021-05-31 01:46:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
2021-05-31 04:04:26 +00:00
|
|
|
InfosReplicateProgress=0
|
2021-06-08 21:21:28 +00:00
|
|
|
RanksReplicateProgress=0
|
2021-05-31 01:46:53 +00:00
|
|
|
|
2021-06-08 21:21:28 +00:00
|
|
|
InitFinished=false
|
|
|
|
RanksFinished=false
|
2021-05-31 04:04:26 +00:00
|
|
|
InfosFinished=false
|
2021-05-31 01:46:53 +00:00
|
|
|
}
|