Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions com.unity.multiplayer.mlapi/Runtime/Core/NetworkedBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ private void NetworkedVarUpdate()
if (writtenAny)
{
if (IsServer)
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_NETWORKED_VAR_DELTA, channelsForNetworkedVarGroups[j], stream, SecuritySendFlags.None, this.NetworkedObject);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_NETWORKED_VAR_DELTA, channelsForNetworkedVarGroups[j], stream, SecuritySendFlags.None);
else
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_NETWORKED_VAR_DELTA, channelsForNetworkedVarGroups[j], stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_NETWORKED_VAR_DELTA, channelsForNetworkedVarGroups[j], stream, SecuritySendFlags.None);
}
}
}
Expand Down Expand Up @@ -880,7 +880,7 @@ internal void SendServerRPCPerformance(ulong hash, Stream messageStream, string
}
else
{
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
ProfilerStatManager.rpcsSent.Record();
}
}
Expand Down Expand Up @@ -938,7 +938,7 @@ internal RpcResponse<T> SendServerRPCPerformanceResponse<T>(ulong hash, Stream m

ResponseMessageManager.Add(response.Id, response);

InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_RPC_REQUEST, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_RPC_REQUEST, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
ProfilerStatManager.rpcsSent.Record();

return response;
Expand Down Expand Up @@ -979,7 +979,7 @@ internal void SendClientRPCPerformance(ulong hash, List<ulong> clientIds, Strea
}
}

InternalMessageSender.Send(MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security, this.NetworkedObject);
InternalMessageSender.Send(MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security);
ProfilerStatManager.rpcsSent.Record(clientIds?.Count ?? NetworkingManager.Singleton.ConnectedClientsList.Count);
}
}
Expand Down Expand Up @@ -1021,7 +1021,7 @@ internal void SendClientRPCPerformance(ulong hash, Stream messageStream, ulong c
}
}

InternalMessageSender.Send(MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIdToIgnore, stream, security, this.NetworkedObject);
InternalMessageSender.Send(MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIdToIgnore, stream, security);
ProfilerStatManager.rpcsSent.Record(NetworkingManager.Singleton.ConnectedClientsList.Count - 1);
}
}
Expand Down Expand Up @@ -1063,7 +1063,7 @@ internal void SendClientRPCPerformance(ulong hash, ulong clientId, Stream messag
}
else
{
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
ProfilerStatManager.rpcsSent.Record();
}
}
Expand Down Expand Up @@ -1127,7 +1127,7 @@ internal RpcResponse<T> SendClientRPCPerformanceResponse<T>(ulong hash, ulong cl

ResponseMessageManager.Add(response.Id, response);

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC_REQUEST, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC_REQUEST, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
ProfilerStatManager.rpcsSent.Record();

return response;
Expand Down
6 changes: 3 additions & 3 deletions com.unity.multiplayer.mlapi/Runtime/Core/NetworkedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static void NetworkShow(List<NetworkedObject> networkedObjects, ulong cli
SpawnManager.WriteSpawnCallForObject(stream, clientId, networkedObjects[i], payload);
}

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_ADD_OBJECTS, "MLAPI_INTERNAL", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_ADD_OBJECTS, "MLAPI_INTERNAL", stream, SecuritySendFlags.None);
}
}

Expand Down Expand Up @@ -321,7 +321,7 @@ public void NetworkHide(ulong clientId)
{
writer.WriteUInt64Packed(NetworkId);

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_DESTROY_OBJECT, "MLAPI_INTERNAL", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_DESTROY_OBJECT, "MLAPI_INTERNAL", stream, SecuritySendFlags.None);
}
}
}
Expand Down Expand Up @@ -373,7 +373,7 @@ public static void NetworkHide(List<NetworkedObject> networkedObjects, ulong cli
}
}

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_DESTROY_OBJECTS, "MLAPI_INTERNAL", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_DESTROY_OBJECTS, "MLAPI_INTERNAL", stream, SecuritySendFlags.None);
}
}

Expand Down
13 changes: 7 additions & 6 deletions com.unity.multiplayer.mlapi/Runtime/Core/NetworkingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void SendCustomMessage(List<ulong> clientIds, BitStream stream, string ch
return;
}

InternalMessageSender.Send(MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security, null);
InternalMessageSender.Send(MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security);
}

/// <summary>
Expand All @@ -258,7 +258,7 @@ public void SendCustomMessage(List<ulong> clientIds, BitStream stream, string ch
[Obsolete("Use CustomMessagingManager.SendUnnamedMessage instead")]
public void SendCustomMessage(ulong clientId, BitStream stream, string channel = null, SecuritySendFlags security = SecuritySendFlags.None)
{
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
}

private void OnValidate()
Expand Down Expand Up @@ -656,6 +656,7 @@ private void Update()
{
if (IsListening)
{
// Process received data
if ((NetworkTime - lastReceiveTickTime >= (1f / NetworkConfig.ReceiveTickrate)) || NetworkConfig.ReceiveTickrate <= 0)
{
ProfilerStatManager.rcvTickRate.Record();
Expand Down Expand Up @@ -769,7 +770,7 @@ internal void SendConnectionRequest()
writer.WriteByteArray(NetworkConfig.ConnectionData);
}

InternalMessageSender.Send(ServerClientId, MLAPIConstants.MLAPI_CONNECTION_REQUEST, "MLAPI_INTERNAL", stream, SecuritySendFlags.Authenticated | SecuritySendFlags.Encrypted, null);
InternalMessageSender.Send(ServerClientId, MLAPIConstants.MLAPI_CONNECTION_REQUEST, "MLAPI_INTERNAL", stream, SecuritySendFlags.Authenticated | SecuritySendFlags.Encrypted);
}
}

Expand Down Expand Up @@ -1222,7 +1223,7 @@ private void SyncTime()
using (PooledBitWriter writer = PooledBitWriter.Get(stream))
{
writer.WriteSinglePacked(Time.realtimeSinceStartup);
InternalMessageSender.Send(MLAPIConstants.MLAPI_TIME_SYNC, "MLAPI_TIME_SYNC", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(MLAPIConstants.MLAPI_TIME_SYNC, "MLAPI_TIME_SYNC", stream, SecuritySendFlags.None);
}
}
#if DEVELOPMENT_BUILD || UNITY_EDITOR
Expand Down Expand Up @@ -1356,7 +1357,7 @@ internal void HandleApproval(ulong clientId, bool createPlayerObject, ulong? pla
}
}

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CONNECTION_APPROVED, "MLAPI_INTERNAL", stream, SecuritySendFlags.Encrypted | SecuritySendFlags.Authenticated, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CONNECTION_APPROVED, "MLAPI_INTERNAL", stream, SecuritySendFlags.Encrypted | SecuritySendFlags.Authenticated);

if (OnClientConnectedCallback != null)
OnClientConnectedCallback.Invoke(clientId);
Expand Down Expand Up @@ -1418,7 +1419,7 @@ internal void HandleApproval(ulong clientId, bool createPlayerObject, ulong? pla
ConnectedClients[clientId].PlayerObject.WriteNetworkedVarData(stream, clientPair.Key);
}

InternalMessageSender.Send(clientPair.Key, MLAPIConstants.MLAPI_ADD_OBJECT, "MLAPI_INTERNAL", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(clientPair.Key, MLAPIConstants.MLAPI_ADD_OBJECT, "MLAPI_INTERNAL", stream, SecuritySendFlags.None);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static void LogServer(string message, LogType logType)

writer.WriteStringPacked(message);

InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_LOG, "MLAPI_INTERNAL", stream, SecuritySendFlags.None, null);
InternalMessageSender.Send(NetworkingManager.Singleton.ServerClientId, MLAPIConstants.MLAPI_SERVER_LOG, "MLAPI_INTERNAL", stream, SecuritySendFlags.None);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void SendUnnamedMessage(List<ulong> clientIds, BitStream stream, s
return;
}

InternalMessageSender.Send(MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security, null);
InternalMessageSender.Send(MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, stream, security);
}

/// <summary>
Expand All @@ -67,7 +67,7 @@ public static void SendUnnamedMessage(List<ulong> clientIds, BitStream stream, s
/// <param name="security">The security settings to apply to the message</param>
public static void SendUnnamedMessage(ulong clientId, BitStream stream, string channel = null, SecuritySendFlags security = SecuritySendFlags.None)
{
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_UNNAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, stream, security);
}
#endregion
#region Named
Expand Down Expand Up @@ -172,7 +172,7 @@ public static void SendNamedMessage(string name, ulong clientId, Stream stream,

messageStream.CopyFrom(stream);

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_NAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, messageStream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_NAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, messageStream, security);
}
}

Expand Down Expand Up @@ -203,7 +203,7 @@ public static void SendNamedMessage(string name, List<ulong> clientIds, Stream s
return;
}

InternalMessageSender.Send(MLAPIConstants.MLAPI_NAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, messageStream, security, null);
InternalMessageSender.Send(MLAPIConstants.MLAPI_NAMED_MESSAGE, string.IsNullOrEmpty(channel) ? "MLAPI_DEFAULT_MESSAGE" : channel, clientIds, messageStream, security);
}
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ internal static void HandleServerRPCRequest(ulong clientId, Stream stream, strin
responseWriter.WriteObjectPacked(result);
}

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_SERVER_RPC_RESPONSE, channelName, responseStream, security, SpawnManager.SpawnedObjects[networkId]);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_SERVER_RPC_RESPONSE, channelName, responseStream, security);
ProfilerStatManager.rpcsSent.Record();
}
}
Expand Down Expand Up @@ -871,7 +871,7 @@ internal static void HandleClientRPCRequest(ulong clientId, Stream stream, strin
responseWriter.WriteObjectPacked(result);
}

InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC_RESPONSE, channelName, responseStream, security, null);
InternalMessageSender.Send(clientId, MLAPIConstants.MLAPI_CLIENT_RPC_RESPONSE, channelName, responseStream, security);
ProfilerStatManager.rpcsSent.Record();
}
}
Expand Down
Loading