示例#1
0
 internal void InternalSend(short msgType, BaseNetworkMessage msg)
 {
     if (m_activeTransport != null)
     {
         m_activeTransport.Send(0, msgType, msg);
         return;
     }
     if (NetConfig.logFilter >= LogFilter.Error)
     {
         Log.Error("Failed to send message to connection ID '" + 0 + ", not found in connection list");
     }
 }
 protected bool SendData <T>(long connectionId, T messageData) where T : new()
 {
     //if (LogInfo)
     //{
     //    Debug.Log("Send Msg =>::" +typeof(T).Name+"-->"+ JsonUtility.ToJson(messageData));
     //}
     if (transport == null || msgManager == null)
     {
         return(false);
     }
     byte[] datas = msgManager.SerializeMsg(messageData);
     return(transport.Send(connectionId, datas));
 }