2020-06-15 12:30:11 -07:00
|
|
|
|
using System;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2020-06-15 12:30:11 -07:00
|
|
|
|
namespace Content.Shared.GameObjects.EntitySystems
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
2020-08-01 17:37:12 +02:00
|
|
|
|
public class SharedConstructionSystem : EntitySystem
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sent client -> server to to tell the server that we started building
|
|
|
|
|
|
/// a structure-construction.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-06-15 12:30:11 -07:00
|
|
|
|
public class TryStartStructureConstructionMessage : EntitySystemMessage
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Position to start building.
|
|
|
|
|
|
/// </summary>
|
2020-09-06 16:11:53 +02:00
|
|
|
|
public readonly EntityCoordinates Location;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The construction prototype to start building.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public readonly string PrototypeName;
|
|
|
|
|
|
|
|
|
|
|
|
public readonly Angle Angle;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Identifier to be sent back in the acknowledgement so that the client can clean up its ghost.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public readonly int Ack;
|
|
|
|
|
|
|
2020-09-06 16:11:53 +02:00
|
|
|
|
public TryStartStructureConstructionMessage(EntityCoordinates loc, string prototypeName, Angle angle, int ack)
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
|
|
|
|
|
Location = loc;
|
|
|
|
|
|
PrototypeName = prototypeName;
|
|
|
|
|
|
Angle = angle;
|
|
|
|
|
|
Ack = ack;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-06 10:40:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sent client -> server to to tell the server that we started building
|
|
|
|
|
|
/// an item-construction.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-06-15 12:30:11 -07:00
|
|
|
|
public class TryStartItemConstructionMessage : EntitySystemMessage
|
2020-06-06 10:40:53 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The construction prototype to start building.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public readonly string PrototypeName;
|
|
|
|
|
|
|
|
|
|
|
|
public TryStartItemConstructionMessage(string prototypeName)
|
|
|
|
|
|
{
|
|
|
|
|
|
PrototypeName = prototypeName;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-15 12:30:11 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Send server -> client to tell the client that a ghost has started to be constructed.
|
|
|
|
|
|
/// </summary>
|
2018-08-02 08:29:55 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2020-06-15 12:30:11 -07:00
|
|
|
|
public class AckStructureConstructionMessage : EntitySystemMessage
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
2020-06-15 12:30:11 -07:00
|
|
|
|
public readonly int GhostId;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
|
2020-06-15 12:30:11 -07:00
|
|
|
|
public AckStructureConstructionMessage(int ghostId)
|
2018-08-02 08:29:55 +02:00
|
|
|
|
{
|
2020-06-15 12:30:11 -07:00
|
|
|
|
GhostId = ghostId;
|
2018-08-02 08:29:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|