Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/Network/NetPackageSetHordeNightActive.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

54 lines
1.5 KiB
C#

public class NetPackageSetHordeNightActive : NetPackage
{
private bool isHordeNight;
public NetPackageSetHordeNightActive Setup(bool _isHordeNight)
{
//Log.Out("NetPackageSetHordeNightActive-Setup START");
this.isHordeNight = _isHordeNight;
return this;
}
public override void read(PooledBinaryReader _br)
{
//Log.Out("NetPackageSetHordeNightActive-read START");
this.isHordeNight = _br.ReadBoolean();
}
public override void write(PooledBinaryWriter _bw)
{
//Log.Out("NetPackageSetHordeNightActive-write START");
base.write(_bw);
_bw.Write(this.isHordeNight);
}
public override int GetLength()
{
return 2;
}
public override void ProcessPackage(World _world, GameManager _callbacks)
{
//Log.Out("NetPackageSetHordeNightActive-ProcessPackage START");
if (_world == null)
{
//Log.Out("NetPackageSetHordeNightActive-ProcessPackage 1");
return;
}
if (!_world.IsRemote())
{
//Log.Out("NetPackageSetHordeNightActive-ProcessPackage 2");
return;
}
RebirthVariables.isHordeNight = this.isHordeNight;
if (this.isHordeNight)
{
RebirthVariables.wasHordeNight = true;
}
//Log.Out("NetPackageSetHordeNightActive-ProcessPackage RebirthVariables.isHordeNight: " + RebirthVariables.isHordeNight);
}
}