15 lines
478 B
C#
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();
|
|
}
|
|
}
|