Upload from upload_mods.ps1
This commit is contained in:
40
Scripts/Network/NPCs/NetPackageAddChunkObserver.cs
Normal file
40
Scripts/Network/NPCs/NetPackageAddChunkObserver.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
public class NetPackageAddChunkObserver : NetPackage
|
||||
{
|
||||
private int playerID;
|
||||
public Vector3 position;
|
||||
|
||||
public NetPackageAddChunkObserver Setup(Vector3 _position)
|
||||
{
|
||||
this.position = _position;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br)
|
||||
{
|
||||
this.position = StreamUtils.ReadVector3(_br);
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _bw)
|
||||
{
|
||||
base.write(_bw);
|
||||
StreamUtils.Write(_bw, this.position);
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World _world, GameManager _callbacks)
|
||||
{
|
||||
//Log.Out("NetPackageTeleporTo-ProcessPackage START");
|
||||
if (_world == null)
|
||||
{
|
||||
//Log.Out("NetPackageTeleporTo-ProcessPackage 1");
|
||||
return;
|
||||
}
|
||||
|
||||
ChunkManager.ChunkObserver observerRef = GameManager.Instance.AddChunkObserver(position, false, 3, -1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user