2021-07-17 02:37:09 +02:00
|
|
|
|
|
2021-02-27 04:12:09 +01:00
|
|
|
|
using System;
|
2020-04-10 01:37:14 -05:00
|
|
|
|
using System.Collections.Generic;
|
2021-11-26 03:02:46 -06:00
|
|
|
|
using Content.Shared.Station;
|
2021-06-20 10:09:24 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.Network;
|
2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Shared.Serialization;
|
2018-11-25 19:04:49 +01:00
|
|
|
|
|
2020-10-14 22:45:53 +02:00
|
|
|
|
namespace Content.Shared.GameTicking
|
2018-11-25 19:04:49 +01:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public abstract class SharedGameTicker : EntitySystem
|
2018-11-25 19:04:49 +01:00
|
|
|
|
{
|
2020-01-19 18:32:24 +01:00
|
|
|
|
// See ideally these would be pulled from the job definition or something.
|
|
|
|
|
|
// But this is easier, and at least it isn't hardcoded.
|
2021-11-26 03:02:46 -06:00
|
|
|
|
public const string FallbackOverflowJob = "Assistant";
|
|
|
|
|
|
public const string FallbackOverflowJobName = "assistant";
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2020-01-19 18:32:24 +01:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerJoinLobbyEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
}
|
2018-11-25 19:04:49 +01:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerJoinGameEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
}
|
2018-11-25 19:04:49 +01:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerLateJoinStatusEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
// TODO: Make this a replicated CVar, honestly.
|
|
|
|
|
|
public bool Disallowed { get; }
|
2018-11-25 19:04:49 +01:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public TickerLateJoinStatusEvent(bool disallowed)
|
2018-11-25 19:04:49 +01:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
Disallowed = disallowed;
|
2018-11-25 19:04:49 +01:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2018-11-25 19:04:49 +01:00
|
|
|
|
|
2020-08-20 16:20:48 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerLobbyStatusEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
public bool IsRoundStarted { get; }
|
|
|
|
|
|
public string? LobbySong { get; }
|
2022-03-13 19:33:19 -07:00
|
|
|
|
public string? LobbyBackground { get; }
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public bool YouAreReady { get; }
|
|
|
|
|
|
// UTC.
|
|
|
|
|
|
public TimeSpan StartTime { get; }
|
|
|
|
|
|
public bool Paused { get; }
|
|
|
|
|
|
|
2022-03-13 19:33:19 -07:00
|
|
|
|
public TickerLobbyStatusEvent(bool isRoundStarted, string? lobbySong, string? lobbyBackground, bool youAreReady, TimeSpan startTime, bool paused)
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
IsRoundStarted = isRoundStarted;
|
|
|
|
|
|
LobbySong = lobbySong;
|
2022-03-13 19:33:19 -07:00
|
|
|
|
LobbyBackground = lobbyBackground;
|
2021-06-20 10:09:24 +02:00
|
|
|
|
YouAreReady = youAreReady;
|
|
|
|
|
|
StartTime = startTime;
|
|
|
|
|
|
Paused = paused;
|
2020-08-20 16:20:48 +02:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2020-08-20 16:20:48 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerLobbyInfoEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
public string TextBlob { get; }
|
2020-08-20 16:20:48 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public TickerLobbyInfoEvent(string textBlob)
|
2018-11-25 19:04:49 +01:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
TextBlob = textBlob;
|
2018-11-25 19:04:49 +01:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2019-10-18 14:28:39 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerLobbyCountdownEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The game time that the game will start at.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public TimeSpan StartTime { get; }
|
2019-10-18 14:28:39 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether or not the countdown is paused
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool Paused { get; }
|
2020-06-21 22:05:47 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public TickerLobbyCountdownEvent(TimeSpan startTime, bool paused)
|
2020-06-21 22:05:47 +02:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
StartTime = startTime;
|
|
|
|
|
|
Paused = paused;
|
2020-06-21 22:05:47 +02:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2020-06-21 22:05:47 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerLobbyReadyEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Status of the Player in the lobby (ready, observer, ...)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Dictionary<NetUserId, LobbyPlayerStatus> Status { get; }
|
2020-08-18 14:52:59 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public TickerLobbyReadyEvent(Dictionary<NetUserId, LobbyPlayerStatus> status)
|
2020-10-16 11:22:58 +02:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
Status = status;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-10-16 11:22:58 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class TickerJobsAvailableEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Status of the Player in the lobby (ready, observer, ...)
|
|
|
|
|
|
/// </summary>
|
2021-11-26 03:02:46 -06:00
|
|
|
|
public Dictionary<StationId, Dictionary<string, int>> JobsAvailableByStation { get; }
|
|
|
|
|
|
public Dictionary<StationId, string> StationNames { get; }
|
2020-10-16 11:22:58 +02:00
|
|
|
|
|
2021-11-26 03:02:46 -06:00
|
|
|
|
public TickerJobsAvailableEvent(Dictionary<StationId, string> stationNames, Dictionary<StationId, Dictionary<string, int>> jobsAvailableByStation)
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
2021-11-26 03:02:46 -06:00
|
|
|
|
StationNames = stationNames;
|
|
|
|
|
|
JobsAvailableByStation = jobsAvailableByStation;
|
2020-10-16 11:22:58 +02:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
}
|
2020-08-16 23:36:50 +02:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class RoundEndMessageEvent : EntityEventArgs
|
2021-06-20 10:09:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2020-04-10 01:37:14 -05:00
|
|
|
|
public struct RoundEndPlayerInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
public string PlayerOOCName;
|
2021-03-16 15:50:20 +01:00
|
|
|
|
public string? PlayerICName;
|
2020-04-10 01:37:14 -05:00
|
|
|
|
public string Role;
|
|
|
|
|
|
public bool Antag;
|
2020-08-22 12:45:49 +02:00
|
|
|
|
public bool Observer;
|
2021-11-15 18:14:34 +00:00
|
|
|
|
public bool Connected;
|
2020-04-10 01:37:14 -05:00
|
|
|
|
}
|
2020-04-08 06:07:54 -05:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public string GamemodeTitle { get; }
|
|
|
|
|
|
public string RoundEndText { get; }
|
|
|
|
|
|
public TimeSpan RoundDuration { get; }
|
|
|
|
|
|
public int PlayerCount { get; }
|
|
|
|
|
|
public RoundEndPlayerInfo[] AllPlayersEndInfo { get; }
|
2020-04-10 01:37:14 -05:00
|
|
|
|
|
2021-06-20 10:09:24 +02:00
|
|
|
|
public RoundEndMessageEvent(string gamemodeTitle, string roundEndText, TimeSpan roundDuration, int playerCount,
|
|
|
|
|
|
RoundEndPlayerInfo[] allPlayersEndInfo)
|
2020-08-21 11:24:06 +02:00
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
GamemodeTitle = gamemodeTitle;
|
|
|
|
|
|
RoundEndText = roundEndText;
|
|
|
|
|
|
RoundDuration = roundDuration;
|
|
|
|
|
|
PlayerCount = playerCount;
|
|
|
|
|
|
AllPlayersEndInfo = allPlayersEndInfo;
|
2020-08-21 11:24:06 +02:00
|
|
|
|
}
|
2018-11-25 19:04:49 +01:00
|
|
|
|
}
|
2021-06-20 10:09:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public enum LobbyPlayerStatus : sbyte
|
|
|
|
|
|
{
|
|
|
|
|
|
NotReady = 0,
|
|
|
|
|
|
Ready,
|
|
|
|
|
|
Observer,
|
|
|
|
|
|
}
|
2018-11-25 19:04:49 +01:00
|
|
|
|
}
|
2020-04-08 06:07:54 -05:00
|
|
|
|
|