feat[protocol]: 提升协议的兼容性,协议向前兼容

This commit is contained in:
jaysunxiao
2022-05-22 22:26:42 +08:00
parent 389de2b6b3
commit 78cb8bd2fc
28 changed files with 1192 additions and 1315 deletions
@@ -88,6 +88,10 @@ namespace CsProtocol.Buffer
return bytes;
}
public bool IsReadable()
{
return writeOffset > readOffset;
}
// -------------------------------------------------write/read-------------------------------------------------
public void WriteBool(bool value)
@@ -1907,7 +1911,7 @@ namespace CsProtocol.Buffer
return map;
}
public void WritePacket<T>(T packet, short protocolId)
{
IProtocolRegistration protocolRegistration = ProtocolManager.GetProtocol(protocolId);
@@ -1920,4 +1924,4 @@ namespace CsProtocol.Buffer
return (T) protocolRegistration.Read(this);
}
}
}
}