Upload from upload_mods.ps1
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// Distributes the call to all clients to extinguish a block
|
||||
/// </summary>
|
||||
|
||||
[UsedImplicitly]
|
||||
public class NetPackageAddExtinguishPosition : NetPackage
|
||||
{
|
||||
private Vector3i _position;
|
||||
private int _entityThatCausedIt;
|
||||
|
||||
public NetPackageAddExtinguishPosition Setup(Vector3i position, int entityThatCausedIt)
|
||||
{
|
||||
_position = position;
|
||||
_entityThatCausedIt = entityThatCausedIt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader br)
|
||||
{
|
||||
_position = new Vector3i(br.ReadInt32(), br.ReadInt32(), br.ReadInt32());
|
||||
_entityThatCausedIt = br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter bw)
|
||||
{
|
||||
base.write(bw);
|
||||
bw.Write(_position.x);
|
||||
bw.Write(_position.y);
|
||||
bw.Write(_position.z);
|
||||
bw.Write(_entityThatCausedIt);
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World world, GameManager callbacks)
|
||||
{
|
||||
if (world == null || FireManager.Instance == null) return;
|
||||
|
||||
FireManager.Instance.ExtinguishBlock(_position);
|
||||
}
|
||||
}
|
||||
|
||||
47
Score/Fire/Scripts/NetPackage/NetPackageAddFirePosition.cs
Normal file
47
Score/Fire/Scripts/NetPackage/NetPackageAddFirePosition.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// Distributes the call to all clients to add a block that is considered burning.
|
||||
/// </summary>
|
||||
|
||||
[UsedImplicitly]
|
||||
public class NetPackageAddFirePosition : NetPackage
|
||||
{
|
||||
private Vector3i _position;
|
||||
private int _entityThatCausedIt;
|
||||
|
||||
public NetPackageAddFirePosition Setup(Vector3i position, int entityThatCausedIt)
|
||||
{
|
||||
_position = position;
|
||||
_entityThatCausedIt = entityThatCausedIt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader br)
|
||||
{
|
||||
_position = new Vector3i(br.ReadInt32(), br.ReadInt32(), br.ReadInt32());
|
||||
_entityThatCausedIt = br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter bw)
|
||||
{
|
||||
base.write(bw);
|
||||
bw.Write(_position.x);
|
||||
bw.Write(_position.y);
|
||||
bw.Write(_position.z);
|
||||
bw.Write(_entityThatCausedIt);
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World world, GameManager callbacks)
|
||||
{
|
||||
if (world == null || FireManager.Instance == null) return;
|
||||
|
||||
FireManager.Instance.AddBlock(_position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// Distributes the call to all clients to remove a block that is considered burning.
|
||||
/// </summary>
|
||||
|
||||
[UsedImplicitly]
|
||||
public class NetPackageRemoveFirePosition : NetPackage
|
||||
{
|
||||
private Vector3i _position;
|
||||
private int _entityThatCausedIt;
|
||||
|
||||
public NetPackageRemoveFirePosition Setup(Vector3i position, int entityThatCausedIt)
|
||||
{
|
||||
_position = position;
|
||||
_entityThatCausedIt = entityThatCausedIt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader br)
|
||||
{
|
||||
_position = new Vector3i(br.ReadInt32(), br.ReadInt32(), br.ReadInt32());
|
||||
_entityThatCausedIt = br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter bw)
|
||||
{
|
||||
base.write(bw);
|
||||
bw.Write(_position.x);
|
||||
bw.Write(_position.y);
|
||||
bw.Write(_position.z);
|
||||
bw.Write(_entityThatCausedIt);
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World world, GameManager callbacks)
|
||||
{
|
||||
if (world == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (FireManager.Instance != null)
|
||||
{
|
||||
FireManager.Instance.RemoveFire(_position);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using JetBrains.Annotations;
|
||||
|
||||
/// <summary>
|
||||
/// Distributes the call to remove a particle effect to all clients. This is used by the Fire management system.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This allows us to distribute which block is showing a fire particle.
|
||||
/// </remarks>
|
||||
///
|
||||
[UsedImplicitly]
|
||||
public class NetPackageRemoveParticleEffect : NetPackage
|
||||
{
|
||||
private Vector3i _position;
|
||||
private int _entityThatCausedIt;
|
||||
|
||||
public NetPackageRemoveParticleEffect Setup(Vector3i position, int entityThatCausedIt)
|
||||
{
|
||||
_position = position;
|
||||
_entityThatCausedIt = entityThatCausedIt;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public override void read(PooledBinaryReader br)
|
||||
{
|
||||
_position = new Vector3i(br.ReadInt32(), br.ReadInt32(), br.ReadInt32());
|
||||
_entityThatCausedIt = br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter bw)
|
||||
{
|
||||
base.write(bw);
|
||||
bw.Write(_position.x);
|
||||
bw.Write(_position.y);
|
||||
bw.Write(_position.z);
|
||||
bw.Write(_entityThatCausedIt);
|
||||
}
|
||||
|
||||
public override int GetLength()
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
public override void ProcessPackage(World world, GameManager callbacks)
|
||||
{
|
||||
if (world == null || FireManager.Instance == null) return;
|
||||
|
||||
FireManager.Instance.ClearPosOnly(_position);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user