mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Send packets async too
This commit is contained in:
1 parent
7946399e7b
commit
7a033a1900
4 files changed
+5
-7
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Hazel;
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Impostor.Server.Hazel.Messages
|
||||
return output;
|
||||
}
|
||||
|
||||
public unsafe float ReadSingle()
|
||||
public float ReadSingle()
|
||||
{
|
||||
var output = BinaryPrimitives.ReadSingleLittleEndian(Buffer.Span.Slice(Position));
|
||||
Position += sizeof(float);
|
||||
@@ -136,7 +136,7 @@ namespace Impostor.Server.Hazel.Messages
|
||||
public void CopyTo(IMessageWriter writer)
|
||||
{
|
||||
writer.Write((ushort) Length);
|
||||
writer.Write((byte) Tag);
|
||||
writer.Write(Tag);
|
||||
writer.Write(Buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,9 @@ namespace Impostor.Server.Hazel.Messages
|
||||
|
||||
public IConnection Connection => _connection;
|
||||
|
||||
public ValueTask SendAsync()
|
||||
public async ValueTask SendAsync()
|
||||
{
|
||||
_connection.InnerConnection.Send(Writer);
|
||||
return default;
|
||||
await _connection.InnerConnection.Send(Writer);
|
||||
}
|
||||
}
|
||||
}
|
||||
Submodule submodules/Hazel-Networking updated: 1c5c51c2bd...de76089739.
Reference in new issue
Block a user