Esempio n. 1
0
        /// <summary>
        /// a8用户数据采集
        /// </summary>
        /// <param name="dataType"></param>
        /// <param name="openId"></param>
        public static void UserAction(string dataType, string openId = "", string session = "", string server = "",
                                      NbManagerEntity managerEntity  = null)
        {
            //"{dataType,sessionId,gameNum,channelAlias,channelId,deviceId,model,release,uid,uname,serverId,serverName,roleId,roleName,roleLevel,ext,sdkVersion}";
            NbManagerEntity manager = null;

            if (managerEntity == null)
            {
                var list = NbManagerMgr.GetByAccount(openId, ShareUtil.ZoneName);
                if (list != null && list.Count > 0)
                {
                    manager = list[0];
                }
            }
            else
            {
                manager = managerEntity;
            }
            var postDataStr = "";

            if (manager == null)
            {
                postDataStr = "dataType=" + dataType;
            }
            else
            {
                var ip = "";
                try
                {
                    ip = UAHelper.GetRealIP();
                }
                catch (Exception)
                {
                }
                var ext          = "";
                var channelAlias = "";
                var sessionId1   = "";
                var entity       = WebServerHandler.GetStartgameEntity(openId, ShareUtil.PlatformCode,
                                                                       ShareUtil.PlatformZoneName);
                if (entity != null)
                {
                    var serverId = entity.ServerId;
                    ext          = entity.State;
                    channelAlias = entity.Pf;
                    sessionId1   = entity.SessionId;
                    //release=1   暂留,没有实际意义
                    postDataStr = "dataType=" + dataType + "&sessionId=" +
                                  sessionId1
                                  + "&gameNum=" + (int)A8csdkEnum.csdkId + "&channelAlias=" + channelAlias +
                                  "&channelId=" + entity.JsNeed + "&deviceId=" + ip + "&model=" + "&release=1" +
                                  "&channelAlias=" + channelAlias + "&subChannel=" + "&serverId=" + serverId +
                                  "&uid=" + openId + "&uname=" + "&serverId=" + serverId + "&serverName=" +
                                  serverId + "&roleId=" + openId +
                                  "&roleName=" + manager.Name + "&roleLevel=" + manager.Level + "&ext=" + ext +
                                  "&sdkVersion=";
                }
            }
            var url       = UAFactory.Instance.GetRedirectURL(ShareUtil.PlatformCode, "useraction");
            var retString = UAHelper.HttpPost(url, postDataStr);
        }
Esempio n. 2
0
        private void UserActionNew(string dataType, string sessionId, string channelAlias, string openId, string jsNeed, string serverId, string state)
        {
            //"{dataType,sessionId,gameNum,channelAlias,channelId,deviceId,model,release,uid,uname,serverId,serverName,roleId,roleName,roleLevel,ext,sdkVersion}";
            NbManagerEntity manager = null;
            var             name    = "";
            var             level   = 1;

            try
            {
                var list = NbManagerMgr.GetByAccount(openId, ShareUtil.ZoneName);
                if (list != null && list.Count > 0)
                {
                    manager = list[0];
                    name    = manager.Name;
                    level   = manager.Level;
                }
            }
            catch (Exception ex)
            {
            }

            var postDataStr = "";

            if (manager == null)
            {
                postDataStr = "dataType=" + dataType;
            }
            else
            {
                var ip = "";
                try
                {
                    ip = UAHelper.GetRealIP();
                }
                catch (Exception)
                {
                }
                var oId = UAHelper.StrToUtf8(openId);


                //release=1   暂留,没有实际意义
                postDataStr = "dataType=" + dataType + "&sessionId=" +
                              sessionId
                              + "&gameNum=" + (int)A8csdkEnum.csdkId + "&channelAlias=" + channelAlias +
                              "&channelId=" + jsNeed + "&deviceId=" + ip + "&model=" + "&release=1" +
                              "&channelAlias=" + channelAlias + "&subChannel=" + "&serverId=" + serverId +
                              "&uid=" + oId + "&uname=" + "&serverId=" + serverId + "&serverName=" +
                              serverId + "&roleId=" + openId +
                              "&roleName=" + name + "&roleLevel=" + level + "&ext=" + state +
                              "&sdkVersion=";     //第一个枚举参数不变     第二个枚举参数作废不更改
            }
            var url       = UAFactory.Instance.GetRedirectURL(ShareUtil.PlatformCode, "useraction");
            var retString = UAHelper.HttpPost(url, postDataStr);
        }
Esempio n. 3
0
 public List <NbManagerEntity> GetManagerList(string account)
 {
     try
     {
         return(NbManagerMgr.GetByAccount(account));
     }
     catch (Exception ex)
     {
         LogHelper.Insert(ex);
         return(null);
     }
 }
        private bool GetManagerByAccount(string zoneId)
        {
            var account = txtAccount.Text.Trim();

            if (!string.IsNullOrEmpty(account))
            {
                var managers = NbManagerMgr.GetByAccount(account, zoneId);
                if (managers != null && managers.Count > 0)
                {
                    SetAccount(managers[0], zoneId);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 5
0
 public static Guid GetManagerId(string account)
 {
     try
     {
         var list = NbManagerMgr.GetByAccount(account);
         if (list != null)
         {
             return(list[0].Idx);
         }
         else
         {
             return(Guid.Empty);
         }
     }
     catch (Exception ex)
     {
         LogHelper.Insert(ex);
         return(Guid.Empty);
     }
 }
Esempio n. 6
0
 public MessageCode CheckActive(string account)
 {
     try
     {
         var manager = NbManagerMgr.GetByAccount(account);
         if (manager == null || manager.Count <= 0)
         {
             return(MessageCode.MissManager);
         }
         else
         {
             return(MessageCode.Success);
         }
     }
     catch (Exception ex)
     {
         SystemlogMgr.Error("Admin CheckActive", ex);
         return(MessageCode.Exception);
     }
 }
Esempio n. 7
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                var zoneId = ZoneId;
                if (string.IsNullOrEmpty(zoneId))
                {
                    ShowMessage("请选择区");
                    return;
                }
                var users = txtUserList.Text;
                if (string.IsNullOrEmpty(users))
                {
                    ShowMessage("请选择用户");
                    return;
                }
                var title = txtMailTitle.Text;
                if (string.IsNullOrEmpty(title))
                {
                    ShowMessage("请输入标题");
                    return;
                }
                var content = txtMailContent.Text;
                if (string.IsNullOrEmpty(content))
                {
                    ShowMessage("请输入内容");
                    return;
                }
                List <NbManagerEntity> managers = new List <NbManagerEntity>();
                var ss = users.Split(',');
                foreach (var s in ss)
                {
                    var manager = NbManagerMgr.GetByAccount(s, zoneId);
                    if (manager == null || manager.Count < 1)
                    {
                        ShowMessage("未找到对应经理,账号:" + s);
                        return;
                    }
                    managers.Add(manager[0]);
                }
                var mailType    = ConvertHelper.ConvertToInt(dr_type.SelectedValue);
                var attachments = GetAttachments();
                if (mailType == 1)
                {
                    MailBuilder mail = new MailBuilder(title, content);

                    if (attachments.Count > 0)
                    {
                        foreach (var entity in attachments)
                        {
                            switch (entity.Type)
                            {
                            case 1:
                                mail.AddAttachment(EnumCurrencyType.Coin, entity.Count);
                                break;

                            case 2:
                                mail.AddAttachment(EnumCurrencyType.Point, entity.Count);
                                break;

                            case 3:
                                mail.AddAttachment(entity.Count, entity.ItemCode, entity.IsBinding, entity.Strength);
                                break;

                            case 4:    //声望
                                mail.AddAttachment(EnumCurrencyType.Prestige, entity.Count);
                                break;

                            case 8:    //绑劵
                                mail.AddAttachment(EnumCurrencyType.BindPoint, entity.Count);
                                break;
                            }
                        }
                    }
                    List <MailInfoEntity> mailList = new List <MailInfoEntity>(managers.Count);
                    var mailInfo = mail.MailInfo;
                    foreach (var entity in managers)
                    {
                        var mailEntity = mailInfo.Clone();
                        mailEntity.ManagerId = entity.Idx;
                        mailList.Add(mailEntity);
                    }
                    var mailTable = MailCore.BuildMailBulkTable(mailList);
                    if (MailSqlHelper.SaveMailBulk(mailTable,
                                                   ConnectionFactory.Instance.GetConnectionString(zoneId, "Main")))
                    {
                        ShowMessage("发送成功");
                        datagrid1.DataSource = null;
                        datagrid1.DataBind();
                        LocalAttachment = null;
                    }
                    else
                    {
                        ShowMessage("发送失败");
                    }
                }
                else if (mailType == 2)
                {
                    //{
                    //    MailShareBuilder mail = new MailShareBuilder(title, content);

                    //    if (attachments.Count > 0)
                    //    {
                    //        foreach (var entity in attachments)
                    //        {
                    //            switch (entity.Type)
                    //            {
                    //                case 1:
                    //                    mail.AddAttachment(EnumCurrencyType.Coin, entity.Count);
                    //                    break;
                    //                case 2:
                    //                    mail.AddAttachment(EnumCurrencyType.Point, entity.Count);
                    //                    break;
                    //                case 3:
                    //                    mail.AddAttachment(entity.Count, entity.ItemCode, entity.IsBinding, entity.Strength);
                    //                    break;
                    //                case 4://声望
                    //                    mail.AddAttachment(EnumCurrencyType.Prestige, entity.Count);
                    //                    break;
                    //                case 8://绑劵
                    //                    mail.AddAttachment(EnumCurrencyType.BindPoint, entity.Count);
                    //                    break;
                    //            }
                    //        }
                    //    }
                    //    MailshareInfoEntity mailList = new MailshareInfoEntity();
                    //    var mailInfo = mail.MailInfo;
                    //    if (managers.Count > 1)
                    //    {
                    //        ShowMessage("只支持单个发送");
                    //        return;
                    //    }
                    //    foreach (var entity in managers)
                    //    {
                    //        var mailEntity = mailInfo.Clone();
                    //        mailEntity.Account = entity.Account;
                    //    }

                    //    if (mail.Save(zoneId))
                    //    {
                    //        ShowMessage("发送成功");
                    //        datagrid1.DataSource = null;
                    //        datagrid1.DataBind();
                    //        LocalAttachment = null;
                    //    }
                    //    else
                    //    {
                    //        ShowMessage("发送失败");
                    //    }
                    //}

                    ShowMessage("请选择邮件类型");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Insert(ex);
                ShowMessage("发送失败:" + ex.Message);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// pay回调
        /// </summary>
        /// <returns></returns>
        private string Charge()
        {
            try
            {
                /*${payNotifyURL}?sign=96d740ea416b8bf118ead1c49c9a1eda&goodsId=105&price=29&game
                 * OrderId=8a71d1a4-fc36-4487-9577-0b3a3b848b65&payResult=0&playerId=h5_a89e3df51e43f8
                 * 4002b843ecd16fd59617&channelAlias=h5_a8&state=&serverId=default&payTime=1449475293
                 * 422&orderId=1751615
                 * 返回值:{"ret":"success","msg":"ok"}*/

                string sign           = GetParam("sign");
                string nonce_str      = GetParam("nonce_str");
                string extra          = GetParam("extra");
                string isTest         = GetParam("isTest");
                string appId          = GetParam("appId");
                string product_id     = GetParam("product_id");
                string order_id       = GetParam("order_id");
                string transaction_id = GetParam("transaction_id");
                string price          = GetParam("cash");
                string uid            = GetParam("uid");
                string game_uid       = GetParam("game_uid");
                string payResult      = GetParam("result");
                //UAHelper.WriteLog("bear Charge",
                //   string.Format(
                //       @"appId={0}&cash={1}&extra={2}&game_uid={3}&isTest={4}&nonce_str={5}&order_id={6}&product_id={7}&result={8}&transaction_id={9}&uid={10}||{11}"
                //       , appId, price, extra, game_uid, isTest, nonce_str, order_id, product_id, payResult, transaction_id, uid,
                //        sign));
                if (string.IsNullOrEmpty(sign) ||
                    string.IsNullOrEmpty(nonce_str) ||
                    string.IsNullOrEmpty(extra) ||
                    string.IsNullOrEmpty(payResult) ||
                    string.IsNullOrEmpty(game_uid) ||
                    string.IsNullOrEmpty(transaction_id) ||
                    string.IsNullOrEmpty(price) ||
                    string.IsNullOrEmpty(sign) ||
                    string.IsNullOrEmpty(uid)
                    )
                {
                    return("{\"ret\":\"fail\",\"msg\":\"参数为空\"}");
                }
                if (payResult.Trim().ToLower() != "success")
                {
                    return("{\"ret\":\"fail\",\"msg\":\"没有付款成功\"}");
                }



                var channelAliasEntity = UAFactory.Instance.GetPlatform(platFormKey);
                if (channelAliasEntity == null)
                {
                    return("{\"ret\":\"fail\",\"msg\":\"channelAlias错误\"}");
                }
                string cryptKey = channelAliasEntity.ChargeKey;


                string signParam =
                    CryptHelper.GetMD5(string.Format(@"appId={0}&cash={1}&extra={2}&game_uid={3}&isTest={4}&nonce_str={5}&order_id={6}&product_id={7}&result={8}&transaction_id={9}&uid={10}{11}"
                                                     , appId, price, extra, game_uid, isTest, nonce_str, order_id, product_id, payResult, transaction_id, uid, cryptKey));
                if (sign != signParam)
                {
                    return("{\"ret\":\"fail\",\"msg\":\"sign错误\"}");
                }
                var ary     = extra.Split('|');
                var server  = "";
                var orderId = "";
                if (ary.Length > 1)
                {
                    orderId = ary[0];
                    server  = ary[1];
                }
                decimal cash = ConvertHelper.ConvertToDecimal(price, 0) / 100; //价格单位是  分

                var zoneName = ShareUtil.ZoneName;
                var list     = NbManagerMgr.GetByAccount(uid, zoneName);
                var manager  = new NbManagerEntity();
                if (list.Count > 0)
                {
                    manager = list[0];
                }
                var result = WebServerHandler.BuyPointShipments(platFormKey, server, "" + manager.Idx,
                                                                orderId, order_id, cash, ConvertHelper.ConvertToInt(product_id));
                if (result == 0)
                {
                    return("OK");
                }
                switch (result)
                {
                case 2062:
                    return("{\"ret\":\"fail\",\"msg\":\"未找到角色\"}");

                case 5211:
                    return("{\"ret\":\"fail\",\"msg\":\"未找到订单\"}");

                case 151:
                    return("{\"ret\":\"fail\",\"msg\":\"物品ID错误\"}");

                default:
                    return("{\"ret\":\"fail\",\"msg\":\"系统内部错误\"}");
                }
            }
            catch (Exception ex)
            {
                SystemlogMgr.Error("bear Charge", ex);
                return("{\"ret\":\"fail\",\"msg\":\"系统内部错误2\"}");
            }
        }
Esempio n. 9
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                var users = txtUserList.Text;
                if (string.IsNullOrEmpty(users))
                {
                    ShowMessage("请选择用户");
                    return;
                }
                var title = txtMailTitle.Text;
                if (string.IsNullOrEmpty(title))
                {
                    ShowMessage("请输入标题");
                    return;
                }
                var content = txtMailContent.Text;
                if (string.IsNullOrEmpty(content))
                {
                    ShowMessage("请输入内容");
                    return;
                }
                List <LocalMailManagerCorssEntity> managers = new List <LocalMailManagerCorssEntity>();
                var ss = users.Split('|');
                foreach (var s in ss)
                {
                    var sss     = s.Split(',');
                    var manager = NbManagerMgr.GetByAccount(sss[1], sss[0]);
                    if (manager == null || manager.Count < 1)
                    {
                        ShowMessage("未找到对应经理,账号:" + s);
                        return;
                    }
                    managers.Add(new LocalMailManagerCorssEntity()
                    {
                        ManagerId = manager[0].Idx, ZoneId = sss[0], Account = sss[1]
                    });
                }

                MailBuilder mail        = new MailBuilder(title, content);
                var         attachments = GetAttachments();
                if (attachments.Count > 0)
                {
                    foreach (var entity in attachments)
                    {
                        switch (entity.Type)
                        {
                        case 1:
                            mail.AddAttachment(EnumCurrencyType.Coin, entity.Count);
                            break;

                        case 2:
                            mail.AddAttachment(EnumCurrencyType.Point, entity.Count);
                            break;

                        case 3:
                            mail.AddAttachment(entity.Count, entity.ItemCode, entity.IsBinding, entity.Strength);
                            break;

                        case 4:    //声望
                            mail.AddAttachment(EnumCurrencyType.Prestige, entity.Count);
                            break;

                        case 8:    //绑劵
                            mail.AddAttachment(EnumCurrencyType.BindPoint, entity.Count);
                            break;
                        }
                    }
                }
                var    mailInfo = mail.MailInfo;
                string failList = "";
                foreach (var entity in managers)
                {
                    try
                    {
                        var mailEntity = mailInfo.Clone();
                        mailEntity.ManagerId = entity.ManagerId;
                        MailInfoMgr.Insert(mailEntity, null, entity.ZoneId);
                    }
                    catch (Exception ex)
                    {
                        LogHelper.Insert(ex);
                        failList = string.Format("{0}{1},{2}|", failList, entity.ZoneId, entity.Account);
                    }
                }
                if (!string.IsNullOrEmpty(failList))
                {
                    ShowMessage("部分发送失败,列表:" + failList.TrimEnd('|'));
                }
                else
                {
                    ShowMessage("发送成功");
                }

                datagrid1.DataSource = null;
                datagrid1.DataBind();
                LocalAttachment = null;
            }
            catch (Exception ex)
            {
                LogHelper.Insert(ex);
                ShowMessage("发送失败:" + ex.Message);
            }
        }
Esempio n. 10
0
 protected void btnSendMail_Click(object sender, EventArgs e)
 {
     try
     {
         string notSendString = "";
         string sendString    = txt_SendString.Text;
         string mailName      = txt_MailName.Text;
         string info          = txt_mailInfo.Text;
         if (sendString.Trim().Length == 0 || mailName.Trim().Length <= 0 || info.Trim().Length <= 0)
         {
             ShowMessage("请输入串");
             return;
         }
         var malls = sendString.Split('|');
         List <LocalMailManagerCorssEntity> managers = new List <LocalMailManagerCorssEntity>();
         foreach (var s in malls)
         {
             var sss     = s.Split(',');
             var manager = NbManagerMgr.GetByAccount(sss[1], sss[0]);
             if (manager == null || manager.Count < 1)
             {
                 ShowMessage("未找到对应经理,账号:" + s);
                 return;
             }
             managers.Add(new LocalMailManagerCorssEntity()
             {
                 ManagerId = manager[0].Idx, ZoneId = sss[0], Account = sss[1], Point = ConvertHelper.ConvertToInt(sss[2])
             });
         }
         MailBuilder mail = null;
         foreach (var item in managers)
         {
             try
             {
                 if (item.Point <= 0)
                 {
                     continue;
                 }
                 mail = new MailBuilder(mailName, info);
                 //mail = new MailBuilder(item.ManagerId, mailName);
                 mail.AddAttachment(EnumCurrencyType.Point, item.Point);
                 var mailInfo   = mail.MailInfo;
                 var mailEntity = mailInfo.Clone();
                 mailEntity.ManagerId = item.ManagerId;
                 if (!MailInfoMgr.Insert(mailEntity, null, item.ZoneId))
                 {
                     notSendString += item.ZoneId + "," + item.Account + "," + item.Point + "|";
                     LogHelper.Insert(item.ZoneId + "," + item.Account + "," + item.Point + "-----失败",
                                      LogType.Info);
                 }
                 else
                 {
                     LogHelper.Insert(item.ZoneId + "," + item.Account + "," + item.Point + "-----成功",
                                      LogType.Info);
                 }
             }
             catch (Exception ex)
             {
                 notSendString += item.ZoneId + "," + item.Account + "," + item.Point + "|";
                 LogHelper.Insert(item.ZoneId + "," + item.Account + "," + item.Point + "-----失败",
                                  LogType.Info);
             }
         }
         if (notSendString.Trim().Length > 0)
         {
             ShowMessage("未成功发送的串:" + notSendString);
         }
         else
         {
             ShowMessage("发送成功");
         }
     }
     catch (Exception ex)
     {
         LogHelper.Insert(ex);
         ShowMessage("发送失败:" + ex.Message);
     }
 }