54 lines
1.5 KiB
C#
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);
|
|
}
|
|
}
|
|
|