mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-10 07:44:37 +00:00
8c6a533918
todo: improve code and finish base structures
40 lines
781 B
C#
40 lines
781 B
C#
using Supercell.GUT.Titan.Logic.DataStream;
|
|
|
|
namespace Supercell.GUT.Titan.Logic.Message;
|
|
|
|
public abstract class PiranhaMessage
|
|
{
|
|
public ByteStream ByteStream { get; }
|
|
|
|
public int MessageVersion { get; set; }
|
|
|
|
public PiranhaMessage(int messageVersion)
|
|
{
|
|
this.ByteStream = new ByteStream();
|
|
this.MessageVersion = messageVersion;
|
|
}
|
|
|
|
public virtual void Encode()
|
|
{
|
|
;
|
|
}
|
|
|
|
public virtual void Decode()
|
|
{
|
|
;
|
|
}
|
|
|
|
public abstract int GetServiceNodeType();
|
|
public abstract int GetMessageType();
|
|
|
|
public int GetEncodingLength()
|
|
{
|
|
return this.ByteStream.Length;
|
|
}
|
|
|
|
public virtual void Destruct()
|
|
{
|
|
this.ByteStream.Destruct();
|
|
this.MessageVersion = 0;
|
|
}
|
|
}
|