2022-05-13 07:02:34 +00:00
|
|
|
class ZedSpawnerRepLink extends ReplicationInfo;
|
|
|
|
|
2022-06-13 14:02:03 +00:00
|
|
|
var public ZedSpawner ZS;
|
|
|
|
var public E_LogLevel LogLevel;
|
|
|
|
var public Array<class<KFPawn_Monster> > CustomZeds;
|
|
|
|
var private int Recieved;
|
2022-05-13 07:02:34 +00:00
|
|
|
|
|
|
|
replication
|
|
|
|
{
|
|
|
|
if (bNetInitial && Role == ROLE_Authority)
|
|
|
|
LogLevel;
|
|
|
|
}
|
|
|
|
|
2022-06-13 14:02:03 +00:00
|
|
|
public simulated function bool SafeDestroy()
|
|
|
|
{
|
|
|
|
`ZS_Debug(`Location @ "bPendingDelete:" @ bPendingDelete @ "bDeleteMe" @ bDeleteMe);
|
|
|
|
return (bPendingDelete || bDeleteMe || Destroy());
|
|
|
|
}
|
2022-05-20 20:45:26 +00:00
|
|
|
|
2022-05-13 07:02:34 +00:00
|
|
|
public reliable client function ClientSync(class<KFPawn_Monster> CustomZed)
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Trace(`Location);
|
2022-05-13 07:02:34 +00:00
|
|
|
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Debug("Received:" @ CustomZed);
|
2022-05-13 07:02:34 +00:00
|
|
|
CustomZeds.AddItem(CustomZed);
|
|
|
|
ServerSync();
|
|
|
|
}
|
|
|
|
|
|
|
|
public reliable client function SyncFinished()
|
|
|
|
{
|
|
|
|
local class<KFPawn_Monster> CustomZed;
|
|
|
|
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Trace(`Location);
|
2022-05-13 07:02:34 +00:00
|
|
|
|
|
|
|
foreach CustomZeds(CustomZed)
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Debug("Preload Content for" @ CustomZed);
|
2022-05-13 07:02:34 +00:00
|
|
|
CustomZed.static.PreloadContent();
|
|
|
|
}
|
|
|
|
|
2022-05-20 20:45:26 +00:00
|
|
|
SafeDestroy();
|
2022-05-13 07:02:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public reliable server function ServerSync()
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Trace(`Location);
|
2022-05-13 07:02:34 +00:00
|
|
|
|
2022-06-13 14:02:03 +00:00
|
|
|
if (bPendingDelete || bDeleteMe) return;
|
|
|
|
|
2022-05-20 20:45:26 +00:00
|
|
|
if (CustomZeds.Length == Recieved || WorldInfo.NetMode == NM_StandAlone)
|
2022-05-13 07:02:34 +00:00
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Debug("Sync finished");
|
2022-05-13 07:02:34 +00:00
|
|
|
SyncFinished();
|
2022-06-13 14:02:03 +00:00
|
|
|
if (!ZS.DestroyRepLink(Controller(Owner)))
|
|
|
|
{
|
|
|
|
SafeDestroy();
|
|
|
|
}
|
2022-05-13 07:02:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-05-17 09:56:31 +00:00
|
|
|
`ZS_Debug("Sync:" @ CustomZeds[Recieved]);
|
2022-05-13 07:02:34 +00:00
|
|
|
ClientSync(CustomZeds[Recieved++]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
bAlwaysRelevant = false;
|
|
|
|
bOnlyRelevantToOwner = true;
|
|
|
|
bSkipActorPropertyReplication = false;
|
|
|
|
|
|
|
|
Recieved = 0
|
|
|
|
}
|