mirror of
https://github.com/BtbN/ClanServer.git
synced 2026-09-07 07:55:16 -05:00
Add 2S8 and fix word/byteBuf parsing
This commit is contained in:
@@ -123,7 +123,7 @@ namespace eAmuseCore.KBinXML
|
||||
{
|
||||
if (!dataByteBuf.Any())
|
||||
{
|
||||
dataByteBuf = dataBuf;
|
||||
dataByteBuf = dataBuf.Take(4);
|
||||
dataBuf = dataBuf.Skip(4);
|
||||
}
|
||||
var res = dataByteBuf.Take(1);
|
||||
@@ -134,7 +134,7 @@ namespace eAmuseCore.KBinXML
|
||||
{
|
||||
if (!dataWordBuf.Any())
|
||||
{
|
||||
dataWordBuf = dataBuf;
|
||||
dataWordBuf = dataBuf.Take(4);
|
||||
dataBuf = dataBuf.Skip(4);
|
||||
}
|
||||
var res = dataWordBuf.Take(2);
|
||||
|
||||
@@ -209,6 +209,33 @@ namespace eAmuseCore.KBinXML.XmlTypes
|
||||
static public KDouble FromBytes(IEnumerable<byte> input) => new KDouble(input.FirstD());
|
||||
}
|
||||
|
||||
[KValue(16, "2s8", Count = 2, Size = 1)]
|
||||
public class K2S8 : KValueList<S8>
|
||||
{
|
||||
public K2S8(S8 v1, S8 v2)
|
||||
{
|
||||
Add(v1);
|
||||
Add(v2);
|
||||
}
|
||||
|
||||
static public K2S8 FromString(string input)
|
||||
{
|
||||
string[] fields = input.Split(' ');
|
||||
if (fields.Length != 2)
|
||||
throw new ArgumentException("input string had invalid field count", "input");
|
||||
return new K2S8(
|
||||
S8.FromString(fields[0]),
|
||||
S8.FromString(fields[1]));
|
||||
}
|
||||
|
||||
static public K2S8 FromBytes(IEnumerable<byte> input)
|
||||
{
|
||||
return new K2S8(
|
||||
S8.FromBytes(input.Skip(0)),
|
||||
S8.FromBytes(input.Skip(1)));
|
||||
}
|
||||
}
|
||||
|
||||
[KValue(27, "3u8", Count = 3, Size = 1)]
|
||||
public class K3U8 : KValueList<U8>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user