Add channelId to Send Method (#862)

This is to achieve parity with NetworkConnection:

```cs
public virtual bool Send<T>(T msg, int channelId = Channels.DefaultReliable) where T: IMessageBase
{
    // pack message and send
    byte[] message = MessagePacker.Pack(msg);
    return SendBytes(message, channelId);
}
```
This commit is contained in:
MrGadget 2019-05-06 12:46:24 -04:00 committed by vis2k
parent 68e14dd828
commit e9f2f538ca

View File

@ -195,7 +195,7 @@ public static bool Send(short msgType, MessageBase msg)
return false; return false;
} }
public static bool Send<T>(T message) where T : IMessageBase public static bool Send<T>(T message, int channelId = Channels.DefaultReliable) where T : IMessageBase
{ {
if (connection != null) if (connection != null)
{ {
@ -204,7 +204,7 @@ public static bool Send<T>(T message) where T : IMessageBase
Debug.LogError("NetworkClient Send when not connected to a server"); Debug.LogError("NetworkClient Send when not connected to a server");
return false; return false;
} }
return connection.Send(message); return connection.Send(message, channelId);
} }
Debug.LogError("NetworkClient Send with no connection"); Debug.LogError("NetworkClient Send with no connection");
return false; return false;