Skip to content

Commit 7bd0f12

Browse files
committed
Fix remaining errors.
1 parent 7a92da2 commit 7bd0f12

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Transports/Unified/UnifiedNetcodeTransport.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,12 @@ public void Disconnect(Connection connection)
140140
DisconnectQueue.Add(connection);
141141
}
142142

143-
public void SendRpc(TransportRpc rpc)
143+
public void SendRpc(TransportRpc rpc, Entity connectionEntity)
144144
{
145145
var rpcQueue = SystemAPI.GetSingleton<RpcCollection>().GetRpcQueue<TransportRpc, TransportRpc>();
146146
var ghostInstance = GetComponentLookup<GhostInstance>();
147-
foreach (var rpcDataStreamBuffer in SystemAPI.Query<DynamicBuffer<OutgoingOutOfBandRpcDataStreamBuffer>>())
148-
{
149-
rpcQueue.Schedule(rpcDataStreamBuffer, ghostInstance, rpc);
150-
}
147+
var rpcDataStreamBuffer = EntityManager.GetBuffer<OutgoingOutOfBandRpcDataStreamBuffer>(connectionEntity);
148+
rpcQueue.Schedule(rpcDataStreamBuffer, ghostInstance, rpc);
151149
}
152150

153151
protected override void OnUpdate()
@@ -249,7 +247,7 @@ public override unsafe void Send(ulong clientId, ArraySegment<byte> payload, Net
249247
rpc.Value.Buffer.Length = amount;
250248

251249
var updateSystem = m_NetworkManager.NetcodeWorld.GetExistingSystemManaged<UnifiedNetcodeUpdateSystem>();
252-
updateSystem.SendRpc(rpc);
250+
updateSystem.SendRpc(rpc, connectionInfo.Connection.ConnectionEntity);
253251

254252
connectionInfo.SendQueue.Consume(amount);
255253
}

0 commit comments

Comments
 (0)