clean up infinite researchsystem shitcode (#13136)
* clean up infinite researchsystem shitcode * fml some more shit * make syncing work logically * naming naming naming
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
namespace Content.Server.Research.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchClientComponent : Component
|
||||
{
|
||||
public bool ConnectedToServer => Server != null;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public ResearchServerComponent? Server { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
namespace Content.Server.Research.Components
|
||||
namespace Content.Server.Research.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchConsoleComponent : Component
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchConsoleComponent : Component {}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
namespace Content.Server.Research.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchPointSourceComponent : Component
|
||||
{
|
||||
[DataField("pointspersecond"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int PointsPerSecond;
|
||||
namespace Content.Server.Research.Components;
|
||||
|
||||
[DataField("active"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Active;
|
||||
}
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchPointSourceComponent : Component
|
||||
{
|
||||
[DataField("pointspersecond"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int PointsPerSecond;
|
||||
|
||||
[DataField("active"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool Active;
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
using Content.Server.Research.Systems;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Research.Components
|
||||
{
|
||||
[Access(typeof(ResearchSystem))]
|
||||
[RegisterComponent]
|
||||
public sealed class ResearchServerComponent : Component
|
||||
{
|
||||
[DataField("servername"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public string ServerName = "RDSERVER";
|
||||
|
||||
[DataField("points"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int Points;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public int Id;
|
||||
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public List<EntityUid> Clients = new();
|
||||
|
||||
[DataField("nextUpdateTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextUpdateTime = TimeSpan.Zero;
|
||||
|
||||
[DataField("researchConsoleUpdateTime"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public readonly TimeSpan ResearchConsoleUpdateTime = TimeSpan.FromSeconds(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event raised on a server's clients when the point value of the server is changed.
|
||||
/// </summary>
|
||||
/// <param name="Server"></param>
|
||||
/// <param name="Total"></param>
|
||||
/// <param name="Delta"></param>
|
||||
[ByRefEvent]
|
||||
public readonly record struct ResearchServerPointsChangedEvent(EntityUid Server, int Total, int Delta);
|
||||
|
||||
/// <summary>
|
||||
/// Event raised every second to calculate the amount of points added to the server.
|
||||
/// </summary>
|
||||
/// <param name="Server"></param>
|
||||
/// <param name="Points"></param>
|
||||
[ByRefEvent]
|
||||
public record struct ResearchServerGetPointsPerSecondEvent(EntityUid Server, int Points);
|
||||
}
|
||||
Reference in New Issue
Block a user