Esempio n. 1
0
    /// <summary>
    /// 发送聊天信息 房间
    /// </summary>
    /// <param name="successAction"></param>
    /// <param name="failedAction"></param>
    public static void NotifyServerRoomChatMessage(string message, Action successAction, Action failedAction)
    {
#if UNITY_EDITOR
        if (StaticData.IsUsedLocalDataNotServer)
        {
            successAction?.Invoke();
            return;
        }
#endif

        CSChannelChat cSChannelChat = new CSChannelChat();
        cSChannelChat.Message = message;
        ProtocalManager.Instance().SendCSChannelChat(cSChannelChat, (SCEmtpyChannelChat sCEmtpyChannelChat) =>
        {
            Debug.Log("发送聊天信息成功!");
            successAction?.Invoke();
        },
                                                     (ErrorInfo er) =>
        {
            Debug.Log("通知服务器发送聊天信息:" + er.ErrorMessage);
            failedAction?.Invoke();
        });
    }
Esempio n. 2
0
        public void SendCSChannelChat(CSChannelChat cschannelchat, Action <SCEmtpyChannelChat> ResponseSCEmtpyChannelChatCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true)
        {
            OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSChannelChat> ();

            ProtoSendMethod.BusinessRequest <SCEmtpyChannelChat>(cschannelchat, opCodeType, ResponseSCEmtpyChannelChatCallBack, errorCallBack, isShowDefaultTip);
        }