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 delete a character profile.
/// </summary>
public class MsgDeleteCharacter : NetMessage
{
#region REQUIRED
public const MsgGroups GROUP = MsgGroups.Command;
public const string NAME = nameof(MsgDeleteCharacter);
public MsgDeleteCharacter(INetChannel channel) : base(NAME, GROUP) { }
#endregion
public int Slot;
public override void ReadFromBuffer(NetIncomingMessage buffer)
{
Slot = buffer.ReadInt32();
}
public override void WriteToBuffer(NetOutgoingMessage buffer)
{
buffer.Write(Slot);
}
}
}