mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
LocalConnectionToClient: update comments
This commit is contained in:
parent
d6c43a343b
commit
8ec937dfa6
@ -12,14 +12,12 @@ public LocalConnectionToClient() : base(LocalConnectionId) {}
|
|||||||
|
|
||||||
public override string address => "localhost";
|
public override string address => "localhost";
|
||||||
|
|
||||||
// Send stage two: serialized NetworkMessage as ArraySegment<byte>
|
|
||||||
internal override void Send(ArraySegment<byte> segment, int channelId = Channels.Reliable)
|
internal override void Send(ArraySegment<byte> segment, int channelId = Channels.Reliable)
|
||||||
{
|
{
|
||||||
// get a writer to copy the message into since the segment is only
|
// instead of invoking it directly, we enqueue and process next update.
|
||||||
// valid until returning.
|
// this way we can simulate a similar call flow as with remote clients.
|
||||||
// => pooled writer will be returned to pool when dequeuing.
|
// the closer we get to simulating host as remote, the better!
|
||||||
// => WriteBytes instead of WriteArraySegment because the latter
|
|
||||||
// includes a 4 bytes header. we just want to write raw.
|
|
||||||
//Debug.Log($"Enqueue {BitConverter.ToString(segment.Array, segment.Offset, segment.Count)}");
|
//Debug.Log($"Enqueue {BitConverter.ToString(segment.Array, segment.Offset, segment.Count)}");
|
||||||
NetworkWriterPooled writer = NetworkWriterPool.Get();
|
NetworkWriterPooled writer = NetworkWriterPool.Get();
|
||||||
writer.WriteBytes(segment.Array, segment.Offset, segment.Count);
|
writer.WriteBytes(segment.Array, segment.Offset, segment.Count);
|
||||||
|
Loading…
Reference in New Issue
Block a user