Upload from upload_mods.ps1
This commit is contained in:
49
Scripts/Network/NPCs/NetPackageRespawnHireRebirth.cs
Normal file
49
Scripts/Network/NPCs/NetPackageRespawnHireRebirth.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using static RebirthManager;
|
||||
using static SleeperVolume;
|
||||
|
||||
public class NetPackageRespawnHireRebirth : NetPackage
|
||||
{
|
||||
private int hireID;
|
||||
private Vector3 spawnPosition;
|
||||
|
||||
public NetPackageRespawnHireRebirth Setup(int hireID,
|
||||
Vector3 spawnPosition
|
||||
)
|
||||
{
|
||||
this.hireID = hireID;
|
||||
this.spawnPosition = spawnPosition;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br)
|
||||
{
|
||||
this.hireID = _br.ReadInt32();
|
||||
this.spawnPosition = StringParsers.ParseVector3(_br.ReadString());
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _bw)
|
||||
{
|
||||
base.write(_bw);
|
||||
_bw.Write(this.hireID);
|
||||
_bw.Write(this.spawnPosition.ToString());
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World _world, GameManager _callbacks)
|
||||
{
|
||||
//Log.Out("NetPackageRespawnHireRebirth-ProcessPackage START");
|
||||
if (_world == null)
|
||||
{
|
||||
//Log.Out("NetPackageRespawnHireRebirth-ProcessPackage 1");
|
||||
return;
|
||||
}
|
||||
|
||||
RebirthUtilities.SpawnHire(this.hireID, this.spawnPosition);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user