Ejemplo n.º 1
0
        public bool HookChat(
            ClientInfo clientInfo,
            EChatType eChatType,
            int senderId,
            string message,
            string mainName               = null,
            bool localizeMain             = false,
            List <int> recipientEntityIds = null
            )
        {
            var recipientEntityIdsString = string.Empty;

            if (recipientEntityIds != null)
            {
                recipientEntityIdsString = recipientEntityIds.ToString();
            }

            var response = _httpTool.Post(new NameValueCollection()
            {
                ClientInfoAsNameValueCollection(clientInfo),
                HookTypeNameValueCollection(EnumHookType.Chat),
                { "Message", message ?? string.Empty },
                { "EChatType", eChatType.ToString() },
                { "SenderId", senderId.ToString() },
                { "MainName", mainName ?? string.Empty },
                { "LocalizeMain", localizeMain.ToString() },
                { "RecipientEntityIds", recipientEntityIdsString },
            }
                                          );

            return(IsMessageModerateAndOk(response));
        }
Ejemplo n.º 2
0
        public bool HookChat(EChatType eChatType, string message)
        {
            var response = _httpTool.Post(new NameValueCollection()
            {
                ClientInfoAsNameValueCollection(null),
                HookTypeNameValueCollection(EnumHookType.SystemChat),
                { "Message", message ?? string.Empty },
                { "EChatType", eChatType.ToString() },
                { "SenderId", string.Empty },
                { "MainName", string.Empty },
                { "LocalizeMain", string.Empty },
                { "RecipientEntityIds", string.Empty },
            }
                                          );

            return(IsMessageModerateAndOk(response));
        }