Re-organize in-memory character profile storage.

Now uses a dictionary of int -> profile instead of an array filled with nulls.
This commit is contained in:
Pieter-Jan Briers
2020-10-06 15:13:16 +02:00
parent 0b1fd94dc9
commit 390d064304
12 changed files with 228 additions and 204 deletions

View File

@@ -0,0 +1,33 @@
using Lidgren.Network;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.Network;
namespace Content.Shared.Network.NetMessages
{
/// <summary>
/// The client sends this to select a character slot.
/// </summary>
public class MsgSelectCharacter : NetMessage
{
#region REQUIRED
public const MsgGroups GROUP = MsgGroups.Command;
public const string NAME = nameof(MsgSelectCharacter);
public MsgSelectCharacter(INetChannel channel) : base(NAME, GROUP) { }
#endregion
public int SelectedCharacterIndex;
public override void ReadFromBuffer(NetIncomingMessage buffer)
{
SelectedCharacterIndex = buffer.ReadVariableInt32();
}
public override void WriteToBuffer(NetOutgoingMessage buffer)
{
buffer.WriteVariableInt32(SelectedCharacterIndex);
}
}
}