mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Add missing channelId to NetworkConnectionToClient.Send calls (#1509)
* fix: Add missing channelId to NetworkConnectionToClient.Send calls * Updated ChangeLog * Added braces * Found one more
This commit is contained in:
parent
bf47ae4cf1
commit
b8bcd9ad25
@ -216,7 +216,7 @@ internal static void ActivateLocalClientScene()
|
||||
|
||||
// this is like SendToReady - but it doesn't check the ready flag on the connection.
|
||||
// this is used for ObjectDestroy messages.
|
||||
static bool SendToObservers<T>(NetworkIdentity identity, T msg) where T : IMessageBase
|
||||
static bool SendToObservers<T>(NetworkIdentity identity, T msg, int channelId = Channels.DefaultReliable) where T : IMessageBase
|
||||
{
|
||||
if (LogFilter.Debug) Debug.Log("Server.SendToObservers id:" + typeof(T));
|
||||
|
||||
@ -246,7 +246,10 @@ static bool SendToObservers<T>(NetworkIdentity identity, T msg) where T : IMessa
|
||||
|
||||
// send to all internet connections at once
|
||||
if (connectionIdsCache.Count > 0)
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment);
|
||||
{
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment, channelId);
|
||||
}
|
||||
|
||||
NetworkDiagnostics.OnSend(msg, Channels.DefaultReliable, segment.Count, identity.observers.Count);
|
||||
|
||||
return result;
|
||||
@ -312,7 +315,10 @@ public static bool SendToAll<T>(T msg, int channelId = Channels.DefaultReliable)
|
||||
|
||||
// send to all internet connections at once
|
||||
if (connectionIdsCache.Count > 0)
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment);
|
||||
{
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment, channelId);
|
||||
}
|
||||
|
||||
NetworkDiagnostics.OnSend(msg, channelId, segment.Count, connections.Count);
|
||||
|
||||
return result;
|
||||
@ -394,7 +400,10 @@ public static bool SendToReady<T>(NetworkIdentity identity, T msg, bool includeO
|
||||
|
||||
// send to all internet connections at once
|
||||
if (connectionIdsCache.Count > 0)
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment);
|
||||
{
|
||||
result &= NetworkConnectionToClient.Send(connectionIdsCache, segment, channelId);
|
||||
}
|
||||
|
||||
NetworkDiagnostics.OnSend(msg, channelId, segment.Count, count);
|
||||
|
||||
return result;
|
||||
@ -698,11 +707,11 @@ public static void SendToClientOfPlayer(NetworkIdentity identity, int msgType, M
|
||||
/// <typeparam name="T">Message type</typeparam>
|
||||
/// <param name="identity"></param>
|
||||
/// <param name="msg"></param>
|
||||
public static void SendToClientOfPlayer<T>(NetworkIdentity identity, T msg) where T : IMessageBase
|
||||
public static void SendToClientOfPlayer<T>(NetworkIdentity identity, T msg, int channelId = Channels.DefaultReliable) where T : IMessageBase
|
||||
{
|
||||
if (identity != null)
|
||||
{
|
||||
identity.connectionToClient.Send(msg);
|
||||
identity.connectionToClient.Send(msg, channelId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ Mirror uses semantic versioning, and the versions shown here are those that were
|
||||
- Fixed: Host Player race condition for Ready message.
|
||||
- Fixed: NetworkAnimator and NetworkTransform now correctly check for client authority in their respective Command methods.
|
||||
- Fixed: Network Room Manager Script Template had a virtual method instead of an override.
|
||||
- Fixed: NetworkServer's calls to NetworkConnectionToClient.Send now includes the channelId parameter that was missing.
|
||||
- Changed: NetworkSceneChecker now works from OnEnable instead of Awake, and uses Scene instead of scene name.
|
||||
- Changed: Renamed NeworkWriter.Write to WriteMessage for consistency.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user