* Non-accessed local variable * Merge cast and type checks. * StringComparison.Ordinal added for better culture support * Supposed code improvement in launcher. Remove unused code. * Update ExplosionHelper.cs Unintentional change. * Optimized Import * Add Robust.Shared.Utility import where it was deleted * Other random suggestion * Improve my comment
114 lines
3.2 KiB
C#
114 lines
3.2 KiB
C#
using System;
|
|
using Lidgren.Network;
|
|
using Robust.Shared.Interfaces.Network;
|
|
using Robust.Shared.Network;
|
|
|
|
namespace Content.Shared
|
|
{
|
|
public abstract class SharedGameTicker
|
|
{
|
|
protected class MsgTickerJoinLobby : NetMessage
|
|
{
|
|
#region REQUIRED
|
|
|
|
public const MsgGroups GROUP = MsgGroups.Command;
|
|
public const string NAME = nameof(MsgTickerJoinLobby);
|
|
public MsgTickerJoinLobby(INetChannel channel) : base(NAME, GROUP) { }
|
|
|
|
#endregion
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
|
{
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
|
{
|
|
}
|
|
}
|
|
|
|
protected class MsgTickerJoinGame : NetMessage
|
|
{
|
|
#region REQUIRED
|
|
|
|
public const MsgGroups GROUP = MsgGroups.Command;
|
|
public const string NAME = nameof(MsgTickerJoinGame);
|
|
public MsgTickerJoinGame(INetChannel channel) : base(NAME, GROUP) { }
|
|
|
|
#endregion
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
|
{
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
|
{
|
|
}
|
|
}
|
|
|
|
protected class MsgTickerLobbyStatus : NetMessage
|
|
{
|
|
#region REQUIRED
|
|
|
|
public const MsgGroups GROUP = MsgGroups.Command;
|
|
public const string NAME = nameof(MsgTickerLobbyStatus);
|
|
public MsgTickerLobbyStatus(INetChannel channel) : base(NAME, GROUP) { }
|
|
|
|
#endregion
|
|
|
|
public bool IsRoundStarted { get; set; }
|
|
public bool YouAreReady { get; set; }
|
|
// UTC.
|
|
public DateTime StartTime { get; set; }
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
|
{
|
|
IsRoundStarted = buffer.ReadBoolean();
|
|
|
|
if (IsRoundStarted)
|
|
{
|
|
return;
|
|
}
|
|
|
|
YouAreReady = buffer.ReadBoolean();
|
|
StartTime = new DateTime(buffer.ReadInt64(), DateTimeKind.Utc);
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
|
{
|
|
buffer.Write(IsRoundStarted);
|
|
|
|
if (IsRoundStarted)
|
|
{
|
|
return;
|
|
}
|
|
|
|
buffer.Write(YouAreReady);
|
|
buffer.Write(StartTime.Ticks);
|
|
}
|
|
}
|
|
|
|
protected class MsgTickerLobbyInfo : NetMessage
|
|
{
|
|
#region REQUIRED
|
|
|
|
public const MsgGroups GROUP = MsgGroups.Command;
|
|
public const string NAME = nameof(MsgTickerLobbyInfo);
|
|
public MsgTickerLobbyInfo(INetChannel channel) : base(NAME, GROUP) { }
|
|
|
|
#endregion
|
|
|
|
public string TextBlob { get; set; }
|
|
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
|
{
|
|
TextBlob = buffer.ReadString();
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
|
{
|
|
buffer.Write(TextBlob);
|
|
}
|
|
}
|
|
}
|
|
}
|