/// <summary>
        /// 获取实卡展示图片
        /// </summary>
        /// <param name="context"></param>
        private void GetCardImage(HttpContext context)
        {
            //获取类类型ID
            int cardTypeID = GameRequest.GetInt("param", 0);

            if (cardTypeID == 0)
            {
                return;
            }

            TreasureFacade aideTreasureFacade = new TreasureFacade( );
            GlobalLivcard  cardType           = aideTreasureFacade.GetGlobalLivcardInfo(cardTypeID);

            if (cardType == null)
            {
                return;
            }

            //if( cardType.Image != null )
            //{
            //    context.Response.Clear();
            //    context.Response.ContentType = "image/Bmp";
            //    context.Response.BinaryWrite( cardType.Image );
            //    context.Response.End();
            //}
        }
Exemple #2
0
        public string SendMailUseGmail()
        {
            int     recid        = GameRequest.GetInt("taskid", 0);
            string  systemname   = GameRequest.GetQueryString("platform");
            string  sql          = string.Format(@"  select npct.RecID as taskid,gi.GameDisplayName,u.Compellation,npct.CollectDatetime,dpf.PlatformDisplayName from 
  [{1}] npct
  inner join sdk_DefaultPlatform dpf on npct.RecID={0} and npct.PlatFormID=dpf.Id
  inner join sdk_GameInfo gi on npct.GameID=gi.GameID
  inner join AspNetUsers u on npct.CreateUser=u.Email", recid, systemname == "Android" ? "sdk_NewPackageCreateTask" : "sdk_NewPackageCreateTask_IOS");
            DataSet ds           = aideNativeWebFacade.GetDataSetBySql(sql);
            string  createuser   = "";
            string  gamename     = "";
            string  platformname = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                createuser   = ds.Tables[0].Rows[0]["Compellation"].ToString();
                gamename     = ds.Tables[0].Rows[0]["GameDisplayName"].ToString();
                platformname = ds.Tables[0].Rows[0]["PlatformDisplayName"].ToString();
            }

            string toMail = GameRequest.GetQueryString("platform") == "Android" ? System.Configuration.ConfigurationManager.AppSettings["SDKPackageLoseEmail_Android"] : System.Configuration.ConfigurationManager.AppSettings["SDKPackageLoseEmail_IOS"];


            string subject = string.Format("打包任务失败({0},{1},{2},{3},{4})", recid, gamename, systemname, platformname, createuser);//邮件标题
            string context = GetErrorLog(ds);

            return(SendEamil.SendMailUseGmail(toMail, subject, context));
        }
 public JsonResult GetOnlineCountList()
 {
     try
     {
         RequestMessage requestMessage = new RequestMessage(3);
         string         text           = requestMessage.Post();
         if (text.Contains("["))
         {
             List <OnlineCount> list = JsonHelper.DeserializeJsonToList <OnlineCount>(text);
             if (list.Count > 0)
             {
                 int sid = GameRequest.GetInt("ServerID", 0);
                 int kid = GameRequest.GetInt("KindID", 0);
                 if (kid > 0)
                 {
                     list = (from q in list
                             where q.KindID == kid
                             select q).ToList();
                 }
                 if (sid > 0)
                 {
                     list = (from q in list
                             where q.ServerID == sid
                             select q).ToList();
                 }
                 return(Json(new
                 {
                     IsOk = true,
                     Msg = "",
                     Total = list.Count,
                     Data = JsonHelper.SerializeObject(list)
                 }));
             }
         }
         if (!(text == "") && !text.Contains("null"))
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = text
             }));
         }
         return(Json(new
         {
             IsOk = true,
             Msg = "",
             Total = 0,
             Data = ""
         }));
     }
     catch (Exception ex)
     {
         return(Json(new
         {
             IsOk = false,
             Msg = ex.Message
         }));
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            //验证登陆

            if (!FacadeManage.aidePlatformManagerFacade.CheckedUserLogon())
            {
                return;
            }

            //自定义头像
            int customID = GameRequest.GetInt("customid", 0);

            if (customID == 0)
            {
                return;
            }

            AccountsFacade accountsFacade = new AccountsFacade();
            AccountsFace   faceModel      = accountsFacade.GetAccountsFace(customID);

            if (faceModel == null)
            {
                return;
            }
            else
            {
                byte[] faceByte = ( byte[] )faceModel.CustomFace;

                // 新建画布
                int    width  = 48;
                int    height = 48;
                Bitmap bitmap = new Bitmap(width, height);

                // 循环像素
                int site = 4;
                for (int y = 0; y < 48; y++)
                {
                    for (int x = 0; x < 48; x++)
                    {
                        byte b = faceByte[site - 4];
                        byte g = faceByte[site - 3];
                        byte r = faceByte[site - 2];
                        bitmap.SetPixel(x, y, Color.FromArgb(r, g, b));
                        site = site + 4;
                    }
                }

                // 输出图片
                System.IO.MemoryStream ms = new System.IO.MemoryStream( );
                bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
                context.Response.ClearContent( );
                context.Response.ContentType = "image/jpeg";
                context.Response.BinaryWrite(ms.ToArray( ));
                bitmap.Dispose( );
            }
        }
Exemple #5
0
 private static int State    = 0; //区分是大厅充值还是房间充值
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ConfigId = GameRequest.GetInt("configid", 0);
         UserId   = GameRequest.GetInt("userid", 0);
         State    = GameRequest.GetInt("state", 0);
     }
 }
Exemple #6
0
        //获取金币排行榜,前50
        protected void GetScoreRank(HttpContext context)
        {
            StringBuilder msg       = new StringBuilder( );
            int           pageIndex = GameRequest.GetInt("pageindex", 1);
            int           pageSize  = GameRequest.GetInt("pagesize", 10);
            int           userID    = GameRequest.GetInt("UserID", 0);

            if (pageIndex <= 0)
            {
                pageIndex = 1;
            }
            if (pageSize <= 0)
            {
                pageSize = 10;
            }
            if (pageSize > 50)
            {
                pageSize = 50;
            }

            //获取用户排行
            string  sqlQuery = string.Format("SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY Score DESC) as ChartID,UserID,Score FROM GameScoreInfo) a WHERE UserID={0}", userID);
            DataSet dsUser   = treasureFacade.GetDataSetByWhere(sqlQuery);
            int     uChart   = 0;
            Int64   uScore   = 0;

            if (dsUser.Tables[0].Rows.Count != 0)
            {
                uChart = Convert.ToInt32(dsUser.Tables[0].Rows[0]["ChartID"]);
                uScore = Convert.ToInt64(dsUser.Tables[0].Rows[0]["Score"]);
            }

            //获取总排行
            DataSet ds = treasureFacade.GetList("GameScoreInfo", pageIndex, pageSize, " ORDER BY Score DESC", " ", "UserID,Score").PageSet;

            if (ds.Tables[0].Rows.Count > 0)
            {
                msg.Append("[");

                //添加用户排行
                msg.Append("{\"NickName\":\"" + Fetch.GetNickNameByUserID(userID) + "\",\"Score\":" + uScore + ",\"Rank\":" + uChart + "},");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    msg.Append("{\"NickName\":\"" + Fetch.GetNickNameByUserID(Convert.ToInt32(dr["UserID"])) + "\",\"Score\":" + dr["Score"] + "},");
                }
                msg.Remove(msg.Length - 1, 1);
                msg.Append("]");
            }
            else
            {
                msg.Append("{}");
            }
            context.Response.Write(msg.ToString( ));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int    pageID = GameRequest.GetInt("PageID", 0);
            string sql    = "Select ResponseUrl From GamePageItem(nolock) Where PageID=" + pageID;
            object obj    = FacadeManage.aidePlatformFacade.GetObjectBySql(sql);

            if (obj != null)
            {
                string url = obj.ToString();
                Response.Redirect(url);
            }
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            int    @int        = GameRequest.GetInt("PageID", 0);
            string sqlQuery    = "Select ResponseUrl From GamePageItem(nolock) Where PageID=" + @int;
            object objectBySql = FacadeManage.aidePlatformFacade.GetObjectBySql(sqlQuery);

            if (objectBySql != null)
            {
                string url = objectBySql.ToString();
                base.Response.Redirect(url);
            }
        }
Exemple #9
0
        /// <summary>
        /// 用户代理列表获取接口
        /// </summary>
        private static void GetBelowList(string type, string query)
        {
            int       number    = GameRequest.GetInt("pagesize", 15);
            int       page      = GameRequest.GetInt("pageindex", 1);
            long      pCount    = 0;
            BelowList list      = new BelowList();
            string    sqlUserId = "";

            if (!string.IsNullOrEmpty(query))
            {
                sqlUserId = " AND UserID IN (SELECT UserID FROM WHQJAccountsDB.DBO.AccountsInfo(NOLOCK) " +
                            (Validate.IsPositiveInt(query)
                                ? $"WHERE GameID={query} OR NickName='{query}') "
                                : $"WHERE NickName = '{query}') ");
            }
            string sqlWhere = $"WHERE AgentID IN (SELECT AgentID FROM AgentInfo(NOLOCK) WHERE UserID={UserId})";

            if (!string.IsNullOrEmpty(type))
            {
                sqlWhere += type == "agent"
                    ? " AND UserID IN (SELECT UserID FROM AgentInfo(NOLOCK)) "
                    : " AND UserID NOT IN (SELECT UserID FROM AgentInfo(NOLOCK)) ";
            }
            sqlWhere += sqlUserId;
            var ps = FacadeManage.aideAgentFacade.GetBelowListPagerSet(sqlWhere, page, number);

            if (ps?.PageCount > 0)
            {
                foreach (DataRow dr in ps.PageSet.Tables[0].Rows)
                {
                    AccountsInfo ai =
                        FacadeManage.aideAccountsFacade.GetAccountsInfoByUserID(
                            Convert.ToInt32(dr["UserID"].ToString()));
                    BelowDetail detail = new BelowDetail
                    {
                        UserID       = ai.UserID,
                        GameID       = ai.GameID,
                        NickName     = ai.NickName,
                        AgentID      = ai.AgentID,
                        RegisterDate = Convert.ToDateTime(dr["CollectDate"]).ToString("yyyy/MM/dd HH:mm:ss"),
                        TotalDiamond = FacadeManage.aideAgentFacade.GetTotalDiamondAward(UserId, ai.UserID),
                        TotalGold    = FacadeManage.aideAgentFacade.GetTotalGoldAward(UserId, ai.UserID)
                    };
                    pCount++;
                    list.dataList.Add(detail);
                }
            }
            _ajv.SetDataItem("list", list.dataList);
            _ajv.SetDataItem("total", ps?.RecordCount ?? 0);
            _ajv.SetDataItem("count", pCount);
            _ajv.SetDataItem("pageCount", ps?.PageCount ?? 0);
            _ajv.SetValidDataValue(true);
        }
Exemple #10
0
        public void ProcessRequest(HttpContext context)
        {
            //允许跨站请求域名
            context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
            context.Response.ContentType = "application/json";

            int    userid   = GameRequest.GetQueryInt("userid", 0);
            int    customId = GameRequest.GetInt("customid", 0);
            string time     = GameRequest.GetQueryString("time");
            string sign     = GameRequest.GetQueryString("sign");

            //签名验证
            AjaxJsonValid ajv = Fetch.VerifySignData(userid + AppConfig.MoblieInterfaceKey + time, sign);

            ////接口版本号
            //ajv.SetDataItem("apiVersion", 20171106);
            //if (ajv.code == (int) ApiCode.VertySignErrorCode)
            //{
            //    context.Response.Write(ajv.SerializeToJson());
            //    return;
            //}
            //参数验证
            if (userid <= 0 || customId <= 0)
            {
                ajv.code = (int)ApiCode.VertyParamErrorCode;
                ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), "");
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            AccountsFace faceModel = FacadeManage.aideAccountsFacade.GetAccountsFace(customId);

            if (faceModel == null || faceModel.UserID != userid)
            {
                ajv.msg = "抱歉,头像参数无效";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            ConfigInfo webCfg =
                FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.WebSiteConfig.ToString());
            string imageServerHost = webCfg.Field2;

            ajv.SetValidDataValue(true);
            ajv.SetDataItem("UserID", faceModel.UserID);
            ajv.SetDataItem("FaceUrl",
                            string.IsNullOrEmpty(faceModel.FaceUrl)
                    ? ""
                    : (faceModel.FaceUrl.IndexOf("http://", StringComparison.Ordinal) > -1
                        ? faceModel.FaceUrl
                        : $"{imageServerHost}{faceModel.FaceUrl}"));
            context.Response.Write(ajv.SerializeToJson());
        }
Exemple #11
0
        private string GetErrorLog(DataSet ds)
        {
            int    recid        = GameRequest.GetInt("taskid", 0);
            string systemname   = GameRequest.GetQueryString("platform");
            string createtaskid = GameRequest.GetQueryString("batchno");

            string logHeadText = "";

            if (ds.Tables[0].Rows.Count > 0)
            {
                logHeadText += "  任务ID  :    " + recid + "<br>";
                logHeadText += "  平  台  :    " + systemname + "<br>";
                logHeadText += "  游戏名称  :    " + ds.Tables[0].Rows[0]["GameDisplayName"].ToString() + "<br>";
                logHeadText += "  渠道名称  :    " + ds.Tables[0].Rows[0]["PlatformDisplayName"].ToString() + "<br>";
                logHeadText += "  创建人  :    " + ds.Tables[0].Rows[0]["Compellation"].ToString() + "<br>";
                logHeadText += "  创建时间  :    " + ds.Tables[0].Rows[0]["CollectDatetime"].ToString() + "<br>";
                logHeadText += "<br>  ↓  ↓  ↓  ↓  ↓  ↓  ↓  ↓  详 细 错 误  ↓  ↓  ↓  ↓  ↓  ↓  ↓  ↓<br>";
            }

            try
            {
                string logPath;
                if (systemname == "Android")
                {
                    logPath = "\\\\192.168.1.6/package_share/output/logs/" + createtaskid + "/" + recid + ".log ";
                }
                else
                {
                    logPath = "\\\\192.168.1.125/package_share_ios/output/logs/" + createtaskid + "/" + recid + ".log ";
                }
                string content = "";
                if (systemname == "Android")
                {
                    using (StreamReader sr = new StreamReader(logPath, System.Text.Encoding.UTF8))
                    {
                        content = sr.ReadToEnd().Replace("\n", "<br>");
                    }
                    return(logHeadText + content);
                }
                else
                {
                    content = "<a href=\"http://192.168.1.35:81/PJPackage/sdkPackageLog?taskid=" + recid + "&createtaskid=" + createtaskid + "&systemname=IOS\">点击查看详情</a>";
                    return(logHeadText + content);
                }
            }
            catch (Exception) { return(logHeadText + "由于未知原因打包失败,log 未生成,请联系打包组开发人员!taskid:" + recid + "  systemname:" + systemname + "  createtaskid:" + createtaskid + "\r\n logPath:\\\\192.168.1.125/package_share_ios/output/logs/" + createtaskid + "/" + recid + ".log "); }
        }
Exemple #12
0
        /// <summary>
        /// 接口主路由
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            //允许跨站请求域名
            context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
            context.Response.ContentType = "application/json";

            string action = GameRequest.GetString("action");

            //签名验证 //接口版本号
            _ajv = new AjaxJsonValid();
            _ajv.SetDataItem("apiVersion", 20171120);
            if (_userId <= 0)
            {
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " userid 为空");
                _ajv.SetValidDataValue(false);
                context.Response.Write(_ajv.SerializeToJson());
                return;
            }
            switch (action)
            {
            case "userspreadhome":
                UserSpreadHome();
                break;

            case "userspreadreceive":
                int num = GameRequest.GetInt("num", 0);
                if (num <= 0)
                {
                    _ajv.code = (int)ApiCode.VertyParamErrorCode;
                    _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " num(领取数量)");
                    _ajv.SetValidDataValue(false);
                    context.Response.Write(_ajv.SerializeToJson());
                    return;
                }
                UserSpreadReveice(num);
                break;

            default:
                _ajv.code = (int)ApiCode.VertyParamErrorCode;
                _ajv.msg  = string.Format(EnumHelper.GetDesc(ApiCode.VertyParamErrorCode), " action");
                _ajv.SetValidDataValue(false);
                break;
            }

            context.Response.Write(_ajv.SerializeToJson());
        }
        public string GetMySpread()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    UserTicketInfo userCookie = Fetch.GetUserCookie();
                    if (userCookie == null || userCookie.UserID != @int)
                    {
                        UserInfo userInfo = message.EntityList[0] as UserInfo;
                        Fetch.SetUserCookie(userInfo.ToUserTicketInfo());
                    }
                    System.Data.DataTable mySpread = FacadeManage.aideTreasureFacade.GetMySpread(@int);
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 0,
                        Data = mySpread
                    });
                }
            }
            return(result);
        }
Exemple #14
0
        protected void GetWeekScoreRank(HttpContext context)
        {
            try
            {
                int      userID    = GameRequest.GetInt("UserID", 0);
                DateTime dt        = DateTime.Now;                      //当前时间
                DateTime startWeek = dt.AddDays(1 - (int)dt.DayOfWeek); //本周周一
                DateTime endWeek   = startWeek.AddDays(6);              //本周周日
                DataSet  ds        = FacadeManage.aideTreasureFacade.GetRank(startWeek, endWeek, userID);
                //
                SendRank(ds, userID, context, startWeek, endWeek);
            }
            catch (Exception exp)
            {
                ScoreRankCode newScoreRankCode = new ScoreRankCode();
                CommonTools.SendStringToClient(context, newScoreRankCode);
//                 context.Response.Write(exp.Message.ToString()+":"+exp.StackTrace.ToString());
            }
        }
Exemple #15
0
        /// <summary>
        /// 任务启动 更改数据库状态
        /// </summary>
        private void StartUpTask()
        {
            string msg        = "";
            int    recid      = GameRequest.GetInt("taskid", 0);
            string platform   = GameRequest.GetQueryString("platform");
            string serveraddr = GameRequest.GetString("serveraddr");

            //string fileaddr = GameRequest.GetString("fileaddr");
            //string filename = GameRequest.GetString("filename");
            if (recid == 0)
            {
                msg = "{\"status\":\"error\",\"msg\":\"error04\"}";
            }
            else if (string.IsNullOrEmpty(serveraddr))
            {
                msg = "{\"status\":\"error\",\"msg\":\"'error05\"}";
            }
            //else if (string.IsNullOrEmpty(fileaddr)) { msg = "{status:'error',msg:'error06'}"; }
            //else if (string.IsNullOrEmpty(filename)) { msg = "{status:'error',msg:'error07'}"; }
            else
            {
                if (platform != "Android" && platform != "iOS")
                {
                    msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
                }
                else
                {
                    string sql = string.Format(@"  update {2} set PackageTaskStatus=2, StartDatetime=GETDATE(),serverAddr='{0}'
                                               where RecID='{1}' and ((PackageTaskStatus=0 and DATEDIFF(N,StartDatetime,GETDATE())<5) or PackageTaskStatus=1)", serveraddr, recid, platform == "Android" ? "[sdk_NewPackageCreateTask]" : "[sdk_NewPackageCreateTask_IOS]");
                    int    row = aideNativeWebFacade.ExecuteSql(sql);
                    if (row > 0)
                    {
                        msg = "{\"status\":\"success\",\"msg\":\"startTask_OK\"}";
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error08\"}";
                    }
                }
            }
            Response.Write(msg);
        }
        public string GetWithdrawals()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            int    int2    = GameRequest.GetInt("pageIndex", 1);
            int    int3    = GameRequest.GetInt("pageSize", 20);
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    PagerSet list = FacadeManage.aideTreasureFacade.GetList("(select * from RYAgentDB.dbo.T_SpreadBalance where  userid = " + @int + ") as tab", int2, int3, "Order By ID DESC", "");
                    System.Data.DataTable data = list.PageSet.Tables[0];
                    result = JsonHelper.SerializeObject(new
                    {
                        Code  = 0,
                        Data  = data,
                        Total = list.RecordCount
                    });
                }
            }
            return(result);
        }
        public string GetMyLowerMember()
        {
            int    @int    = GameRequest.GetInt("userid", 0);
            string @string = GameRequest.GetString("signature");
            string string2 = GameRequest.GetString("time");
            int    int2    = GameRequest.GetInt("pageIndex", 1);
            int    int3    = GameRequest.GetInt("pageSize", 20);
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                Message message = FacadeManage.aideAccountsFacade.CheckUserSignature(@int, string2, @string);
                if (!message.Success)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = message.Content
                    });
                }
                else
                {
                    PagerSet list = FacadeManage.aideTreasureFacade.GetList("(SELECT * FROM RYAgentDB.dbo.Fn_GetSpreadDowns(" + @int + ",0)) as tab", int2, int3, "Order By NowYj", "");
                    System.Data.DataTable data = list.PageSet.Tables[0];
                    result = JsonHelper.SerializeObject(new
                    {
                        Code  = 0,
                        Data  = data,
                        Total = list.RecordCount
                    });
                }
            }
            return(result);
        }
        public void GetQuestionType(System.Web.HttpContext context)
        {
            int    @int    = GameRequest.GetInt("typeId", 0);
            string tabName = "GameIssueInfo";

            if (@int == 1)
            {
                tabName = "GameIssueInfo";
            }
            if (@int == 2)
            {
                tabName = "GameFeedbackInfo";
            }
            if (@int == 3)
            {
                tabName = "GameAccuseInfo";
            }
            System.Data.DataTable type = FacadeManage.aideTreasureFacade.GetType(tabName);
            context.Response.Write(JsonHelper.SerializeObject(type));
        }
        public void ProcessRequest(HttpContext context)
        {
            //允许跨站请求域名
            context.Response.AddHeader("Access-Control-Allow-Origin", AppConfig.MoblieInterfaceDomain);
            //接口返回数据格式
            context.Response.ContentType = "application/json";
            //接口请求类型
            string action = GameRequest.GetQueryString("action").ToLower();

            try
            {
                lock (lockobj)
                {
                    System.IO.Stream s   = context.Request.InputStream;
                    StreamReader     sr  = new StreamReader(s, System.Text.ASCIIEncoding.UTF8);
                    string           ret = sr.ReadToEnd();
                    //Log4Net.WriteInfoLog("ret:" + ret);

                    string userid = context.Request.Form["userid"];
                    //string log = context.Request.Form["logtext"];
                    int    platformType = GameRequest.GetInt("platformType", 0);
                    string TypeName     = "";
                    if (platformType == 1)
                    {
                        TypeName = "Android";
                    }
                    else if (platformType == 2)
                    {
                        TypeName = "IOS";
                    }
                    Writelog(ret, userid, TypeName);
                    context.Response.Write("true");
                }
            }
            catch (Exception ex)
            {
                Log4Net.WriteInfoLog("下面一条为接口故障信息", "LogInterface");
                Log4Net.WriteErrorLog(ex, "LogInterface");
                context.Response.Write(ex);
            }
        }
        public JsonResult GetAndroidConfigureList()
        {
            int           @int          = GameRequest.GetInt("pageIndex", 1);
            int           int2          = GameRequest.GetInt("pageSize", 10);
            int           int3          = GameRequest.GetInt("ServerID", 0);
            StringBuilder stringBuilder = new StringBuilder(" WHERE 1=1");

            if (int3 > 0)
            {
                stringBuilder.AppendFormat(" AND ServerID ={0}", int3);
            }
            PagerSet list = FacadeManage.aideAccountsFacade.GetList("AndroidConfigure", @int, int2, stringBuilder.ToString(), "ORDER BY BatchID DESC");

            return(Json(new
            {
                IsOk = true,
                Msg = "",
                Total = list.RecordCount,
                Data = JsonHelper.SerializeObject(list.PageSet.Tables[0])
            }));
        }
Exemple #21
0
        /// <summary>
        /// 完成任务
        /// </summary>
        private void FinishTask()
        {
            string msg      = "";
            int    recid    = GameRequest.GetInt("taskid", 0);
            string platform = GameRequest.GetQueryString("platform");
            //string packageaddr = GameRequest.GetString("packageaddr");
            string packagename = GameRequest.GetString("packagename");

            if (recid == 0)
            {
                msg = "{\"status\":\"error\",\"msg\":\"error04\"}";
            }
            //else if (string.IsNullOrEmpty(packageaddr)) { msg = "{\"status\":\"error\",\"msg\":\"error09\"}"; }
            else if (string.IsNullOrEmpty(packagename))
            {
                msg = "{\"status\":\"error\",\"msg\":\"error10\"}";
            }
            else
            {
                if (platform != "Android" && platform != "iOS")
                {
                    msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
                }
                else
                {
                    string sql = string.Format(@"  update {2} set PackageTaskStatus=3, FinishDatetime=GETDATE(),
                                                [packagename]='{1}' where RecID='{0}' and PackageTaskStatus=2", recid, packagename, platform == "Android" ? "[sdk_NewPackageCreateTask]" : "[sdk_NewPackageCreateTask_IOS]");
                    int    row = aideNativeWebFacade.ExecuteSql(sql);
                    if (row > 0)
                    {
                        msg = "{\"status\":\"success\",\"msg\":\"finishTask_OK\"}";
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error11\"}";
                    }
                }
            }
            Response.Write(msg);
        }
Exemple #22
0
        /// <summary>
        /// 打包任务失败
        /// </summary>
        private void LoseTask()
        {
            string msg      = "";
            int    recid    = GameRequest.GetInt("taskid", 0);
            string platform = GameRequest.GetQueryString("platform");

            if (recid == 0)
            {
                msg = "{\"status\":\"error\",\"msg\":\"error04\"}";
            }
            else
            {
                if (platform != "Android" && platform != "iOS")
                {
                    msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
                }
                else
                {
                    string sql = string.Format(@"update {1} set PackageTaskStatus=4,FinishDatetime=getdate() where recid={0} and (PackageTaskStatus=2 or PackageTaskStatus=0)", recid, platform == "Android" ? "[sdk_NewPackageCreateTask]" : "[sdk_NewPackageCreateTask_IOS]");
                    int    row = aideNativeWebFacade.ExecuteSql(sql);
                    if (row > 0)
                    {
                        msg = "{\"status\":\"success\",\"msg\":\"loseTask_OK\"}";
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error12\"}";
                    }
                }
            }
            try
            {
                if (IsSendMail(recid))
                {
                    SendMailUseGmail();
                }
            }
            catch (Exception) { }
            Response.Write(msg);
        }
        public void GetQuestionList(System.Web.HttpContext context)
        {
            int    @int    = GameRequest.GetInt("hot", 0);
            string @string = GameRequest.GetString("title");
            int    int2    = GameRequest.GetInt("typeId", 0);

            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("WHERE Nullity=0");
            if (@int > 0)
            {
                stringBuilder.Append(" AND Hot=1");
            }
            if (@string != "")
            {
                stringBuilder.Append(" AND IssueTitle like '%'+@title+'%'");
            }
            if (int2 > 0)
            {
                stringBuilder.AppendFormat(" AND TypeID={0}", int2);
            }
            System.Data.DataTable questionList = FacadeManage.aideNativeWebFacade.GetQuestionList(stringBuilder.ToString(), @string);
            context.Response.Write(JsonHelper.SerializeObject(questionList));
        }
Exemple #24
0
        protected void GetPreDayScoreRank(HttpContext context)
        {
            try
            {
                int userID = GameRequest.GetInt("UserID", 0);

                DateTime dt        = DateTime.Now.AddDays(-1);
                DateTime startYear = new DateTime(dt.Year, dt.Month, dt.Day, 0, 0, 0); //本年年初
                DateTime endYear   = new DateTime(dt.Year, 12, 31);                    //本年年末
                DataSet  ds        = FacadeManage.aideTreasureFacade.GetRank(startYear, endYear, userID);
                SendRank(ds, userID, context, startYear, endYear);
//                 //
//                 ScoreRankCode newScoreRankCode = new ScoreRankCode();
//                 for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
//                 {
//                     ScoreRank newScoreRank = new ScoreRank();
//                     newScoreRank.RankId = Convert.ToInt32(ds.Tables[0].Rows[i]["RankId"]);
//                     newScoreRank.UserID = Convert.ToInt32(ds.Tables[0].Rows[i]["UserID"]);
//                     newScoreRank.UserName = ds.Tables[0].Rows[i]["UserName"].ToString();
//                     newScoreRank.SumScore = Convert.ToInt32(ds.Tables[0].Rows[i]["SumScore"]);
//                     newScoreRank.RankType = Convert.ToInt32(ds.Tables[0].Rows[i]["RankType"]);
//                     newScoreRank.FaceId = Convert.ToInt32(ds.Tables[0].Rows[i]["FaceID"]);
//
//                     newScoreRankCode.ScoreRanks.Add(newScoreRank);
//                     if (newScoreRank.UserID == userID)
//                         newScoreRankCode.MyScore = newScoreRank;
//                 }
//                 string s = Newtonsoft.Json.JsonConvert.SerializeObject(newScoreRankCode);
//                 newScoreRankCode.msg = startYear.ToString() + "--" + endYear.ToString();
//                 CommonTools.SendStringToClient(context, newScoreRankCode);
            }
            catch (Exception exp)
            {
                ScoreRankCode newScoreRankCode = new ScoreRankCode();
                CommonTools.SendStringToClient(context, newScoreRankCode);

//                 context.Response.Write(exp.Message.ToString() + ":" + exp.StackTrace.ToString());
            }
        }
Exemple #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteMaster.Menu = 1;
            payId           = GameRequest.GetInt("id", 0);
            if (!IsPostBack)
            {
                //获取登录信息
                UserTicketInfo user = userTicket;
                if (payId <= 0)
                {
                    Response.Redirect("/Menu/Buy.aspx");
                }

                //获取游戏豆信息
                UserCurrencyInfo currency = FacadeManage.aideTreasureFacade.GetUserCurrencyInfo(user.UserID);
                lbCurrency.Text = currency != null?Convert.ToInt32(currency.Currency).ToString() : "0";

                //获取房卡信息
                UserRoomCard card = FacadeManage.aideTreasureFacade.GetUserRoomCard(user.UserID);
                lbRoomCard.Text = card != null?card.RoomCard.ToString() : "0";
            }
        }
Exemple #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int typeId = GameRequest.GetInt("id", 1);
         if (typeId == 1)
         {
             btn = "<a href = \"/RoomCard/Buy.aspx\"> 继续购买 </a><a href = \"/RoomCard/Index.aspx\" > 查看记录 </a>";
             lblAlertInfo.Text = "恭喜您,购买成功!";
         }
         else if (typeId == 1)
         {
             btn = "<a href = \"/RoomCard/Exch.aspx\"> 继续兑换 </a><a href = \"/RoomCard/ExchRecord.aspx\" > 查看记录 </a>";
             lblAlertInfo.Text = "恭喜您,兑换成功!";
         }
         else
         {
             btn = "<a href = \"/RoomCard/BuyByGold.aspx\"> 继续购买 </a><a href = \"/RoomCard/GoldBuyRecord.aspx\" > 查看记录 </a>";
             lblAlertInfo.Text = "恭喜您,购买成功!";
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            type = GameRequest.GetInt("type", 0);
            switch (type)
            {
            case 0:
                typeName = "帐号";
                break;

            case 1:
                typeName = "昵称";
                break;
            }

            if (Header != null)
            {
                Title = StrTitle;
            }

            if (!IsPostBack)
            {
                BindData();
            }
        }
Exemple #28
0
        //获取金币排行榜,前50
        protected void GetScoreRank(HttpContext context)
        {
            StringBuilder msg       = new StringBuilder( );
            int           pageIndex = GameRequest.GetInt("pageindex", 1);
            int           pageSize  = GameRequest.GetInt("pagesize", 10);

            if (pageIndex <= 0)
            {
                pageIndex = 1;
            }
            if (pageSize <= 0)
            {
                pageSize = 10;
            }
            if (pageSize > 50)
            {
                pageSize = 50;
            }
            DataSet ds = treasureFacade.GetList("GameScoreInfo", pageIndex, pageSize, " ORDER BY Score DESC", " WHERE UserID IN(SELECT UserID FROM QPAccountsDBLink.QPAccountsDB.dbo.AccountsInfo)", "UserID,Score").PageSet;

            if (ds.Tables[0].Rows.Count > 0)
            {
                msg.Append("[");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    msg.Append("{\"NickName\":\"" + Fetch.GetNickNameByUserID(Convert.ToInt32(dr["UserID"])) + "\",\"Score\":" + dr["Score"] + "},");
                }
                msg.Remove(msg.Length - 1, 1);
                msg.Append("]");
            }
            else
            {
                msg.Append("{}");
            }
            context.Response.Write(msg.ToString( ));
        }
        public JsonResult UpdateCount()
        {
            int    @int        = GameRequest.GetInt("ID", 0);
            int    int2        = GameRequest.GetInt("KindID", 0);
            int    int3        = GameRequest.GetInt("ServerID", 0);
            int    int4        = GameRequest.GetInt("AddCounts", 0);
            int    int5        = GameRequest.GetInt("ChangeRate", 0);
            string formString  = GameRequest.GetFormString("StartTime");
            string formString2 = GameRequest.GetFormString("EndTime");

            if (int3 > 0 && int4 > 0 && !(formString == "") && !(formString2 == "") && int5 >= 0)
            {
                try
                {
                    Dictionary <string, object> dictionary = new Dictionary <string, object>();
                    dictionary["ID"]               = @int;
                    dictionary["KindID"]           = int2;
                    dictionary["ServerID"]         = int3;
                    dictionary["AddCounts"]        = int4;
                    dictionary["ChangeRate"]       = int5;
                    dictionary["StartTime"]        = formString.Substring(0, 5);
                    dictionary["EndTime"]          = formString2.Substring(0, 5);
                    dictionary["strErrorDescribe"] = "";
                    Message message = FacadeManage.aideAccountsFacade.ExcuteByProce("RYPlatformDB..NET_PW_SaveOnlineCount", dictionary);
                    if (!message.Success)
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = message.Content
                        }));
                    }
                    RequestMessage requestMessage = new RequestMessage(5);
                    string         text           = requestMessage.Post();
                    if (!text.Contains("OK"))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = text
                        }));
                    }
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "操作成功"
                    }));
                }
                catch
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "操作失败"
                    }));
                }
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "参数错误"
            }));
        }
        public string Balance()
        {
            int    @int = GameRequest.GetInt("userid", 0);
            string result;

            if (@int <= 0)
            {
                result = JsonHelper.SerializeObject(new
                {
                    Code = 1,
                    Msg  = "参数错误"
                });
            }
            else
            {
                UserTicketInfo userCookie = Fetch.GetUserCookie();
                if (userCookie == null || userCookie.UserID != @int)
                {
                    result = JsonHelper.SerializeObject(new
                    {
                        Code = 1,
                        Msg  = "已超时,请从大厅重新操作"
                    });
                }
                else
                {
                    double num = System.Convert.ToDouble(base.Request["rtnFee"]);
                    if (num <= 0.0)
                    {
                        result = JsonHelper.SerializeObject(new
                        {
                            Code = 1,
                            Msg  = "提现金额必须大于0"
                        });
                    }
                    else
                    {
                        System.Collections.Generic.Dictionary <string, object> dictionary = new System.Collections.Generic.Dictionary <string, object>();
                        dictionary["dwUserID"]    = @int;
                        dictionary["strOrderID"]  = PayHelper.GetOrderIDByPrefix("tg");
                        dictionary["dwRtnFee"]    = num;
                        dictionary["strClientIP"] = GameRequest.GetUserIP();
                        dictionary["strErr"]      = "";
                        Message message = FacadeManage.aideAccountsFacade.ExcuteByProce("RYAgentDB.dbo.P_SpreadBalance", dictionary);
                        if (message.Success)
                        {
                            result = JsonHelper.SerializeObject(new
                            {
                                Code = 0,
                                Msg  = "提现申请成功,请等待处理!"
                            });
                        }
                        else
                        {
                            result = JsonHelper.SerializeObject(new
                            {
                                Code = 1,
                                Msg  = message.Content
                            });
                        }
                    }
                }
            }
            return(result);
        }