2021-07-17 02:37:09 +02: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
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Shared.Construction
|
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]
|
2021-03-09 11:22:48 -08:00
|
|
|
|
public class TryStartStructureConstructionMessage : EntityEventArgs
|
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]
|
2021-03-09 11:22:48 -08:00
|
|
|
|
public class TryStartItemConstructionMessage : EntityEventArgs
|
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>
|
2021-11-02 11:24:32 +01:00
|
|
|
|
/// Sent server -> client to tell the client that a ghost has started to be constructed.
|
2020-06-15 12:30:11 -07:00
|
|
|
|
/// </summary>
|
2018-08-02 08:29:55 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2021-03-09 11:22:48 -08:00
|
|
|
|
public class AckStructureConstructionMessage : EntityEventArgs
|
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
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-11-02 11:24:32 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sent client -> server to request a specific construction guide.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class RequestConstructionGuide : EntityEventArgs
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly string ConstructionId;
|
|
|
|
|
|
|
|
|
|
|
|
public RequestConstructionGuide(string constructionId)
|
|
|
|
|
|
{
|
|
|
|
|
|
ConstructionId = constructionId;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sent server -> client as a response to a <see cref="RequestConstructionGuide"/> net message.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public class ResponseConstructionGuide : EntityEventArgs
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly string ConstructionId;
|
|
|
|
|
|
public readonly ConstructionGuide Guide;
|
|
|
|
|
|
|
|
|
|
|
|
public ResponseConstructionGuide(string constructionId, ConstructionGuide guide)
|
|
|
|
|
|
{
|
|
|
|
|
|
ConstructionId = constructionId;
|
|
|
|
|
|
Guide = guide;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-08-02 08:29:55 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|