sharp-chat/SharpChat/IServerPacket.cs
2025-04-25 15:49:46 +00:00

15 lines
478 B
C#

using System.Collections.Generic;
namespace SharpChat {
public interface IServerPacket {
long SequenceId { get; }
IEnumerable<string> Pack();
}
public abstract class ServerPacket(long sequenceId = 0) : IServerPacket {
// Allow sequence id to be manually set for potential message repeats
public long SequenceId { get; } = sequenceId > 0 ? sequenceId : SharpId.Next();
public abstract IEnumerable<string> Pack();
}
}