mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Merge branch 'master' of https://github.com/vis2k/Mirror
This commit is contained in:
commit
d1b9f89c4a
@ -13,7 +13,7 @@ public ULocalConnectionToClient() : base ("localClient")
|
||||
connectionId = 0;
|
||||
}
|
||||
|
||||
internal override bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
internal override bool Send(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
{
|
||||
NetworkClient.localClientPacketQueue.Enqueue(bytes);
|
||||
return true;
|
||||
@ -30,7 +30,7 @@ public ULocalConnectionToServer() : base("localServer")
|
||||
connectionId = 0;
|
||||
}
|
||||
|
||||
internal override bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
internal override bool Send(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
{
|
||||
if (bytes.Length == 0)
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ public virtual bool Send(int msgType, MessageBase msg, int channelId = Channels.
|
||||
{
|
||||
// pack message and send
|
||||
byte[] message = MessagePacker.PackMessage(msgType, msg);
|
||||
return SendBytes(message, channelId);
|
||||
return Send(message, channelId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -240,12 +240,12 @@ public virtual bool Send<T>(T msg, int channelId = Channels.DefaultReliable) whe
|
||||
// pack message and send
|
||||
byte[] message = MessagePacker.Pack(msg);
|
||||
NetworkDiagnostics.OnSend(msg, channelId, message.Length, 1);
|
||||
return SendBytes(message, channelId);
|
||||
return Send(message, channelId);
|
||||
}
|
||||
|
||||
// internal because no one except Mirror should send bytes directly to
|
||||
// the client. they would be detected as a message. send messages instead.
|
||||
internal virtual bool SendBytes(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
internal virtual bool Send(byte[] bytes, int channelId = Channels.DefaultReliable)
|
||||
{
|
||||
if (logNetworkMessages) Debug.Log("ConnectionSend con:" + connectionId + " bytes:" + BitConverter.ToString(bytes));
|
||||
|
||||
|
@ -228,7 +228,7 @@ static bool SendToObservers(NetworkIdentity identity, short msgType, MessageBase
|
||||
bool result = true;
|
||||
foreach (KeyValuePair<int, NetworkConnection> kvp in identity.observers)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes);
|
||||
result &= kvp.Value.Send(bytes);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -249,7 +249,7 @@ static bool SendToObservers<T>(NetworkIdentity identity, T msg) where T: IMessag
|
||||
bool result = true;
|
||||
foreach (KeyValuePair<int, NetworkConnection> kvp in identity.observers)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes);
|
||||
result &= kvp.Value.Send(bytes);
|
||||
}
|
||||
NetworkDiagnostics.OnSend(msg, Channels.DefaultReliable, bytes.Length, identity.observers.Count);
|
||||
return result;
|
||||
@ -272,7 +272,7 @@ public static bool SendToAll(int msgType, MessageBase msg, int channelId = Chann
|
||||
bool result = true;
|
||||
foreach (KeyValuePair<int, NetworkConnection> kvp in connections)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes, channelId);
|
||||
result &= kvp.Value.Send(bytes, channelId);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -295,7 +295,7 @@ public static bool SendToAll<T>(T msg, int channelId = Channels.DefaultReliable)
|
||||
bool result = true;
|
||||
foreach (KeyValuePair<int, NetworkConnection> kvp in connections)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes, channelId);
|
||||
result &= kvp.Value.Send(bytes, channelId);
|
||||
}
|
||||
|
||||
NetworkDiagnostics.OnSend(msg, channelId, bytes.Length, connections.Count);
|
||||
@ -322,7 +322,7 @@ public static bool SendToReady(NetworkIdentity identity, short msgType, MessageB
|
||||
{
|
||||
if (kvp.Value.isReady)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes, channelId);
|
||||
result &= kvp.Value.Send(bytes, channelId);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -357,7 +357,7 @@ public static bool SendToReady<T>(NetworkIdentity identity, T msg, bool includeS
|
||||
if ((!isSelf || includeSelf) &&
|
||||
kvp.Value.isReady)
|
||||
{
|
||||
result &= kvp.Value.SendBytes(bytes, channelId);
|
||||
result &= kvp.Value.Send(bytes, channelId);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user