コード例 #1
0
        private void Update()
        {
            string  sql        = string.Format("select gameid from sdk_gameInfo");
            DataSet dsGame     = aideNativeWebFacade.GetDataSetBySql(sql);
            string  sql2       = string.Format("select id,parentid from sdk_defaultplatform where platformname like '%_LeBian'");
            DataSet dsPlatform = aideNativeWebFacade.GetDataSetBySql(sql2);

            for (int i = 0; i < dsGame.Tables[0].Rows.Count; i++)
            {
                string gameid = dsGame.Tables[0].Rows[i]["gameid"].ToString();
                for (int j = 0; j < dsPlatform.Tables[0].Rows.Count; j++)
                {
                    string id  = dsPlatform.Tables[0].Rows[j]["id"].ToString();
                    string pid = dsPlatform.Tables[0].Rows[j]["parentid"].ToString();

                    string sql3 = string.Format("select 1 from sdk_PlatformConfig where gamename='{0}' and platformname='{1}'", gameid, id);

                    if (aideNativeWebFacade.GetDataSetBySql(sql3).Tables[0].Rows.Count > 0)
                    {
                        string sql4 = string.Format(@"update sdk_PlatformConfig set platformname='{0}',PlugInID=1 where gamename='{1}' and platformname='{2}'", pid, gameid, id);
                        aideNativeWebFacade.ExecuteSql(sql4);
                    }
                }
            }
        }
コード例 #2
0
        public string UpdatePlatformIconName(int platformID, string platformIconName)
        {
            //platformIconName = TextFilter.FilterScript(platformIconName);
            string sql = string.Format("update sdk_DefaultPlatform set PlatformIcon='{0}' where id={1}", platformIconName, platformID);

            aideNativeWebFacade.ExecuteSql(sql);
            return("{success:'success'}");
        }
コード例 #3
0
 protected void GameVersionList_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "del")
     {
         string[] arr           = e.CommandArgument.ToString().Split(',');
         string   id            = arr[0];
         string   SDKPackageDir = "";//SDKAndroidPackageGameFile
         if (platform == "Android")
         {
             SDKPackageDir = System.Configuration.ConfigurationManager.AppSettings["SDKAndroidPackageGameFile"] + gameName + "\\" + arr[1];
         }
         else
         {
             string[] split = new string[] { ".zip_" };
             SDKPackageDir = System.Configuration.ConfigurationManager.AppSettings["SDKIOSPackageGameFile"] + gamenamespell + "\\" + arr[1].Split(split, StringSplitOptions.None)[1];
         }
         if (System.IO.Directory.Exists(SDKPackageDir))
         {
             System.IO.Directory.Delete(SDKPackageDir, true);
         }
         string sql = string.Format(@"delete from sdk_UploadPackageInfo where id={0}", id);
         aideNativeWebFacade.ExecuteSql(sql);
         this.GameVersionList.DataBind();
     }
 }
コード例 #4
0
ファイル: Platform.aspx.cs プロジェクト: zhuthesea/TypeSDK
 protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "nullity")
     {
         int    id      = Convert.ToInt32(e.CommandArgument.ToString().Split(',')[0]);
         byte   nullity = Convert.ToByte(e.CommandArgument.ToString().Split(',')[1]);
         string sql     = string.Format(@"update [sdk_DefaultPlatform] set nullity={0} where id={1}", nullity == 0 ? 1 : 0, id);
         aideNativeWebFacade.ExecuteSql(sql);
         this.ListView1.DataBind();
     }
 }
コード例 #5
0
ファイル: resettask.aspx.cs プロジェクト: zhuthesea/TypeSDK
        private void ExecRestTask()
        {
            if (string.IsNullOrEmpty(taskid))
            {
                Response.Write("error");
                return;
            }

            string sql = string.Format(@"update sdk_NewPackageCreateTask set PackageTaskStatus=1 {1} where recid={0}", taskid, string.IsNullOrEmpty(mode) ? "" : ",CompileMode='" + mode + "'");
            int    row = aideNativeWebFacade.ExecuteSql(sql);

            if (row < 1)
            {
                Response.Write("error");
                return;
            }
            Response.Write("success");
            return;
        }
コード例 #6
0
        /// <summary>
        /// 插入任务
        /// </summary>
        /// <param name="taskid"></param>
        /// <param name="UserName"></param>
        /// <param name="placeidlist"></param>
        /// <param name="createtaskid"></param>
        /// <param name="platform"></param>
        /// <param name="gameId"></param>
        /// <param name="gameversion"></param>
        /// <param name="gamelable"></param>
        /// <param name="platformversionlist"></param>
        /// <param name="isencryption"></param>
        /// <param name="adplatformlist"></param>
        /// <param name="adidlist"></param>
        private void SetPackageTask(string taskid, string UserName, string createtaskid, string platform, string gameId, string gameversion, string gamelable, string platformversionlist, string isencryption, string adplatformlist, string adidlist)
        {
            string[] strplaceidlist         = placeidlist.Split(',');         //渠道ID组
            string[] strplatformversionlist = platformversionlist.Split(','); //渠道版本组
            string[] stradplatformlist      = adplatformlist.Split(',');      //广告商组
            string[] stradidlist            = adidlist.Split('_');            //广告商ID组
            string[] strpluginidlist        = pluginidlist.Split(',');        //插件ID组
            string   sql           = string.Format(@"select top 1 gpfi.pluginversion from sdk_DefaultPlatform dpf inner join sdk_GamePlatFromInfo gpfi
                                                 on gpfi.VersionPlatFromID=dpf.id and gpfi.GameID={0} and gpfi.SystemID=1 and gpfi.PlugInID=1", gameId);
            string   pluginversion = aideNativeWebFacade.GetScalarBySql(sql);
            string   compileMode   = (this.CheckBoxCompileMode.Checked && Cache["Roleid"].ToString() == "0") ? "debug" : "release";
            bool     flag          = false;

            for (int i = 0; i < strplaceidlist.Length; i++)
            {
                if (platform == "Android")
                {
                    string placeid = strplaceidlist[i];
                    if (strplaceidlist.Length == 1)
                    {
                        placeid = strplaceidlist[i].Substring(0, strplaceidlist[i].Length - 2);
                    }
                    else if (i == 0)
                    {
                        placeid = strplaceidlist[i].Substring(0, strplaceidlist[i].Length - 3);
                    }
                    else if (i < strplaceidlist.Length - 1)
                    {
                        placeid = strplaceidlist[i].Substring(1, strplaceidlist[i].Length - 4);
                    }
                    else
                    {
                        placeid = strplaceidlist[i].Substring(1, strplaceidlist[i].Length - 3);
                    }

                    if (!string.IsNullOrEmpty(adplatformlist) && !string.IsNullOrEmpty(adidlist))
                    {
                        for (int j = 0; j < stradplatformlist.Length; j++)//判断是否是需要加广告商的任务
                        {
                            try
                            {
                                if (stradplatformlist[j] == strplaceidlist[i].Replace("'", ""))
                                {
                                    flag = true;
                                    string[] arradid = stradidlist[j].Split(',');
                                    for (int k = 0; k < arradid.Length; k++)//循环添加不同广告商id任务
                                    {
                                        //逐条添加带有adid的任务
                                        string sqlQueryAd = string.Format(@"insert into sdk_NewPackageCreateTask (PackageTaskID,CreateUser,PlatFormID,CreateTaskID,GameID,GameFileVersion,GameVersionLable,PlatformVersion,IsEncryption,AdID,AdName,PlugInID,PlugInVersion,CompileMode) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}',{11},'{12}','{13}')",
                                                                          taskid, UserName, placeid, createtaskid, gameId, gameversion, gamelable, strplatformversionlist[i], isencryption, arradid[k], GetAdName(arradid[k]), string.IsNullOrEmpty(pluginversion) ? "0" : "1", pluginversion, compileMode);
                                        aideNativeWebFacade.ExecuteSql(sqlQueryAd);
                                        //PrintTxt.RecordLog("D://sqlData/", sqlQueryAd);
                                    }
                                    break;
                                }
                            }
                            catch (Exception)
                            {
                                break;
                            }
                        }
                    }
                    if (!flag)//非广告商任务
                    {
                        string sqlQuery = string.Format(@"insert into sdk_NewPackageCreateTask (PackageTaskID,CreateUser,PlatFormID,CreateTaskID,GameID,GameFileVersion,GameVersionLable,PlatformVersion,IsEncryption,PlugInID,PlugInVersion,CompileMode) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}',{9},'{10}','{11}')",
                                                        taskid, UserName, placeid, createtaskid, gameId, gameversion, gamelable, strplatformversionlist[i], isencryption, strpluginidlist[i] == "0" ? "0" : "1", strpluginidlist[i] == "0" ? "" : pluginversion, compileMode);
                        aideNativeWebFacade.ExecuteSql(sqlQuery);
                        //PrintTxt.RecordLog("D://sqlData/", sqlQuery);
                    }
                }
                else
                {
                    string sqlQuery = string.Format(@"insert into sdk_NewPackageCreateTask_IOS (PackageTaskID,CreateUser,PlatFormID,CreateTaskID,GameID,GameFileVersion,GameVersionLable,PlatformVersion) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')",
                                                    taskid, UserName, strplaceidlist[i], createtaskid, gameId, gameversion, gamelable, strplatformversionlist[i]);
                    aideNativeWebFacade.ExecuteSql(sqlQuery);
                }
            }

            //跳转
            Response.Redirect("SelectPackageInfo.aspx?gameid=" + gameId + "&gameName=" + gameName + "&gameDisplayName=" + gameDisplayName + "&platform=" + platform + "&createtaskid=" + createtaskid + "&gameversion=" + gameversion + "&isencryption=" + isencryption);
        }
コード例 #7
0
        /// <summary>
        /// 获取一条任务
        /// </summary>
        private void GetTask()
        {
            string msg      = "";
            string platform = GameRequest.GetQueryString("platform");

            if (string.IsNullOrEmpty(platform))
            {
                msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
            }
            else if (platform != "Android" && platform != "iOS")
            {
                msg = "{\"status\":\"error\",\"msg\":\"error03\"}";
            }
            else
            {
                if (platform == "Android")
                {
                    Message umsg = aideNativeWebFacade.GetGainTask(platform);
                    if (umsg.Success)
                    {
                        GainTask gt = umsg.EntityList[0] as GainTask;
                        if (gt.RecID == 0)
                        {
                            msg = "{\"status\":\"success\",\"msg\":\"no data now\",\"data\":null}";
                        }
                        else
                        {
                            string recid = gt.RecID.ToString();

                            try
                            {
                                CheckManifest(gt);
                            }
                            catch (Exception ex)
                            {
                                msg = "{\"status\":\"error99\",\"msg\":\"" + Server.UrlEncode(ex.Message) + "\",\"data\":null}"; Response.Write(msg);
                                PrintLog(recid, platform, msg);
                                PrintServerLog(recid, platform, "Manifest:" + msg);
                                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]");
                                aideNativeWebFacade.ExecuteSql(sql);
                                return;
                            }


                            //string urlHead = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + "/";

                            string gameid             = gt.GameID;
                            string gamename           = gt.GameName;
                            string platFormName       = gt.PlatFormName;
                            string gameVersion        = gt.GameVersion;
                            string strCollectDatetime = gt.StrCollectDatetime;
                            string strIconPath        = gt.IconPath;
                            string strCreateTaskID    = gt.CreateTaskID;
                            string strmyversion       = gt.MyVersion;
                            string strChannelVersion  = gt.ChannelVersion;
                            string strIsEncryption    = gt.IsEncryption;
                            string strAdID            = gt.AdID;
                            int    strPlugInID        = gt.PlugInID;
                            string strPlugInVersion   = gt.PlugInVersion;
                            string strCompileMode     = gt.CompileMode;
                            string strKeyname         = gt.KeyName;

                            msg = "{\"status\":\"success\",\"msg\":\"gainTask_OK\",\"data\":[{\"TaskID\":\"" + recid + "\",\"Channel\":\"" + platFormName + "\",\"GameID\":\"" + gameid + "\",\"ChannelVersion\":\"" + strChannelVersion + "\",\"GameVersion\":\"" + gameVersion + "_" + strCollectDatetime + "\",\"IconID\":\"" + strIconPath + "\",\"BatchNo\":\"" + strCreateTaskID + "\",\"SdkVer\":\"" + strmyversion + "\",\"IsEncrypt\":\"" + strIsEncryption + "\",\"AdID\":\"" + strAdID + "\",\"PluginID\":\"" + strPlugInID + "\",\"PluginVersion\":\"" + strPlugInVersion + "\",\"CompileMode\":\"" + strCompileMode + "\",\"SignKey\":\"" + strKeyname + "\"}]}";

                            PrintLog(recid, platform, msg);
                        }
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error02\"}";
                    }
                }
                else
                {
                    Message umsg = aideNativeWebFacade.GetGainTask(platform);
                    if (umsg.Success)
                    {
                        GainTask gt = umsg.EntityList[0] as GainTask;
                        if (gt.RecID == 0)
                        {
                            msg = "{\"status\":\"success\",\"msg\":\"no data now\",\"data\":null}";
                        }
                        else
                        {
                            string urlHead            = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + "/";
                            string recid              = gt.RecID.ToString();
                            string gameid             = gt.GameID;
                            string gamename           = gt.GameName;
                            string platFormName       = gt.PlatFormName;
                            string gameVersion        = gt.GameVersion;
                            string strCollectDatetime = gt.StrCollectDatetime;
                            string strIconPath        = gt.IconPath;
                            string strCreateTaskID    = gt.CreateTaskID;
                            string strmyversion       = gt.MyVersion;
                            string strChannelVersion  = gt.ChannelVersion;
                            string strgamenamespell   = gt.GameNameSpell;
                            string strunityver        = gt.UnityVer;
                            string strproductname     = gt.ProductName;

                            //msg = "{\"status\":\"success\",\"msg\":\"gainTask_OK\",\"data\":[{\"TaskID\":\"" + recid + "\",\"Channel\":\"" + platFormName.ToLower() + "\",\"GameID\":\"" + strgamenamespell + "\",\"GameVersion\":\"" + strCollectDatetime + "\",\"IconID\":\"" + strIconPath + "\",\"BatchNo\":\"" + strCreateTaskID + "\",\"SdkVer\":\"" + strmyversion + "\",\"GameFileName\":\"" + gameVersion + "\",\"UnityVer\":\"" + strunityver + "\",\"ProductName\":\"" + strproductname + "\"}]}";
                            msg = "{\"status\":\"success\",\"msg\":\"gainTask_OK\",\"data\":[{\"TaskID\":\"" + recid + "\",\"Channel\":\"" + platFormName + "\",\"GameID\":\"" + gameid + "\",\"ChannelVersion\":\"" + strChannelVersion + "\",\"GameVersion\":\"" + gameVersion + "\",\"CreateTime\":\"" + strCollectDatetime + "\",\"IconID\":\"" + strIconPath + "\",\"BatchNo\":\"" + strCreateTaskID + "\",\"SdkVer\":\"" + strmyversion + "\",\"GameFileName\":\"" + gamename + "\",\"UnityVer\":\"" + strunityver + "\",\"ProductName\":\"" + strproductname + "\"}]}";

                            PrintLog(recid, platform, msg);
                        }
                    }
                    else
                    {
                        msg = "{\"status\":\"error\",\"msg\":\"error02_2\"}";
                    }
                }
            }
            Response.Write(msg);
        }
コード例 #8
0
        /// <summary>
        /// 添加游戏
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonAddGame_Click(object sender, EventArgs e)
        {
            //if (!UploadGameIcon()) return;
            string gamename             = CtrlHelper.GetText(txtGameName);
            string gamedisplayname      = CtrlHelper.GetText(txtGameDisplayName);
            string gameAndroidVersionID = CtrlHelper.GetSelectValue(ddlAndroidVersionList);
            string gameIOSVersionID     = CtrlHelper.GetSelectValue(ddlIOSVersionList);
            string gameAndroidKeyID     = CtrlHelper.GetSelectValue(ddlAndroidKeyList);
            string gameNameSpell        = CtrlHelper.GetText(txtGameNameSpell);
            string gameUnityVer         = CtrlHelper.GetText(txtUnityVer);
            string gameicon             = this.hfGameIcon.Value;
            string gameProductName      = CtrlHelper.GetText(txtProductName);
            string gameIsEncryption     = this.CheckBoxIsEncryption.Checked ? "1" : "0";
            //追加sdk相关
            string sdkgameid  = CtrlHelper.GetText(txtSDKGameID);
            string sdkgamekey = CtrlHelper.GetText(txtSDKGameKey);

            if (gamename == "" || gamedisplayname == "")
            {
                MessageLabel.Text = "游戏名字不能为空";
                return;
            }

            if (sdkgameid == "" || sdkgamekey == "")
            {
                MessageLabel.Text = "SDK通信ID及KEY不能为空";
                return;
            }


            string sql = "";

            if (hfSubmitType.Value == "add")
            {
                Message umsg = aideNativeWebFacade.AddGame(gamename, gamedisplayname, gameAndroidVersionID, gameIOSVersionID, gameAndroidKeyID, "", gameicon, Context.User.Identity.Name, gameNameSpell, gameUnityVer, gameProductName, gameIsEncryption, sdkgameid, sdkgamekey);
                if (umsg.Success)
                {
                    BindingList();
                    MessageLabel.Text = "游戏新增成功";
                    CreateGameImgList(umsg.Content, gamename, gameicon, false);
                    CreateIOSIcon(umsg.Content, gameNameSpell, gameicon, true);
                }
                else
                {
                    MessageLabel.Text = "游戏新增失败";
                }
            }
            else if (hfSubmitType.Value == "edit")
            {
                sql = string.Format(@"UPDATE [sdk_GameInfo] SET  [GameName]='{0}',[GameDisplayName]='{1}',[AndroidVersionID]={2},[IOSVersionID]={3},[AndroidKeyID]={4},
                                      [GameIcon]='{5}',[CreateUser]='{6}',[GameNameSpell]='{8}',[UnityVer]='{9}',ProductName='{10}',IsEncryption='{11}',SDKGameID='{12}',SDKGameKey='{13}' WHERE GAMEID={7}"
                                    , gamename, gamedisplayname, gameAndroidVersionID, gameIOSVersionID, gameAndroidKeyID, gameicon, Context.User.Identity.Name, CtrlHelper.GetInt(hfgameID, 0), gameNameSpell, gameUnityVer, gameProductName, gameIsEncryption, sdkgameid, sdkgamekey);



                int row = aideNativeWebFacade.ExecuteSql(sql);
                if (row > 0)
                {
                    BindingList();
                    MessageLabel.Text = "游戏更新成功";
                    CreateGameImgList(CtrlHelper.GetText(hfgameID), gamename, gameicon, true);
                    CreateIOSIcon(CtrlHelper.GetText(hfgameID), gameNameSpell, gameicon, true);
                }
                else
                {
                    MessageLabel.Text = "游戏更新失败";
                }
            }
            else
            {
                MessageLabel.Text = "抱歉,未识别操作!";
                return;
            }
        }