Adds PacketDecoder & Makes NetState testable (#286)
This commit is contained in:
parent
e0da7209f6
commit
3337cfa4e2
5 changed files with 177 additions and 35 deletions
|
|
@ -161,7 +161,17 @@ namespace Server.Buffers
|
|||
throw new OutOfMemoryException();
|
||||
}
|
||||
|
||||
Position += encoding.GetBytes(src, _buffer.Slice(Position));
|
||||
var bytesWritten = encoding.GetBytes(src, _buffer.Slice(Position));
|
||||
Position += bytesWritten;
|
||||
|
||||
if (fixedLength > -1)
|
||||
{
|
||||
var extra = fixedLength * sizeT - bytesWritten;
|
||||
if (extra > 0)
|
||||
{
|
||||
Clear(extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue