示例#1
0
    /**
     * 刷新用户信息
     */
    public static void refreshUserInfo(Action <Error> action)
    {
        HttpUtil.Http.Get(URLManager.refreshUserInfoUrl()).OnSuccess(result =>
        {
            if (result != null)
            {
                UserInfoRefresh goodsList = JsonMapper.ToObject <UserInfoRefresh>(result);
                UserInfo userInfo         = goodsList.data;

                // 更新本地信息
                UserManager.Instance().userInfo = userInfo;
                UserManager.saveUserInfoToUserDefault(userInfo);

                if (action != null)
                {
                    action(null);
                }

                refreshMianView();
            }
            else
            {
                if (action != null)
                {
                    action(new Error(500, null));
                }
            }
        }).OnFail(result => {
            if (action != null)
            {
                action(new Error(500, null));
            }
        }).GoSync();
    }
示例#2
0
 /**
  * 授权成功获取用户信息
  */
 public static void authSuccess(Action <Error, UserInfo> action)
 {
     HttpUtil.Http.Get(URLManager.getUserInfoUrl()).OnSuccess(result =>
     {
         if (result != null)
         {
             UserInfoResult userResult = JsonMapper.ToObject <UserInfoResult>(result);
             if (userResult.ret == 1)
             {
                 UserManager.Instance().isLogin  = true;
                 UserManager.Instance().userInfo = userResult.data;
                 // 用户数据持久化
                 UserManager.saveUserAuthToUserDefault(UserManager.Instance().authModel);
                 UserManager.saveUserInfoToUserDefault(UserManager.Instance().userInfo);
                 if (action != null)
                 {
                     action(null, userResult.data);
                 }
             }
             else
             {
                 if (action != null)
                 {
                     action(new Error(userResult.ret, userResult.msg), null);
                 }
             }
         }
     }).OnFail(result =>
     {
         if (action != null)
         {
             action(new Error(500, null), null);
         }
     }).Go();
 }
示例#3
0
 public string GetSummonerGamesById()
 {
     try
     {
         using (this.client = new WebClient())
         {
             summonerGamesResponse = client.DownloadString(URLManager.SummonerGamesById(summonerId));
         }
         responseCode = "#02";
     }
     catch (Exception ex)
     {
         return("#03");
     }
     try
     {
         idName = ReaderManager.FileReader(jsonFilePath);
         SummonerGames summonerGamesModel = SerializerManager.SummonerGamesSerializer(summonerGamesResponse);
         this.SummonerGames = NameManager.GamesNameFiller(summonerGamesModel, this.summonerName, idName);
     }
     catch (Exception ex)
     {
         throw new ArgumentException("Either response serializing or finding name went wrong " + ex.Message);
     }
     return(responseCode);
 }
示例#4
0
    void OnReceivedMessageDelegate(UniWebView webView, UniWebViewMessage message)
    {
        Uri uri = null;

        try
        {
            uri = new Uri(message.rawMessage);
        }
        catch (Exception e)
        {
            return;
        }


        if (URLManager.CheckLoadURL(uri))
        {
            webView.Load(message.rawMessage);
        }
        else
        {
            Application.OpenURL(message.rawMessage);
        }

#if BUILD_TYPE_DEBUG
        Debug.Log("OnReceivedMessageDelegate: message.rawMessage" + message.rawMessage + " / " + webView.openLinksInExternalBrowser);
#endif
    }
示例#5
0
    private void openSupportDialog()
    {
        uint   uid        = LocalSaveManager.Instance.LoadFuncUserID();
        string userIdText = string.Format(GameTextUtil.GetText("mt21q_content"), UnityUtil.CreateDrawUserID(uid));
        Dialog newDialog  = Dialog.Create(DialogType.DialogYesNo).SetStrongYes();

        newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "mt21q_title");
        newDialog.SetDialogText(DialogTextType.MainText, userIdText);
        newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button4");
        newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button5");
        newDialog.SetDialogEvent(DialogButtonEventType.YES, new System.Action(() =>
        {
            ResetButtons();
            //DG0-1944 お問い合わせは強制的に外部ブラウザーで表示する
            string support_url = MasterDataUtil.GetMasterDataGlobalParamTextFromID(GlobalDefine.WEB_LINK_SUPPORT);
            URLManager.OpenURL(support_url, true);
        }));
        newDialog.EnableFadePanel();
        newDialog.DisableCancelButton();
        newDialog.Show();

        newDialog.SetDialogEvent(DialogButtonEventType.NO, () =>
        {
            ResetButtons();
        });
    }
示例#6
0
        public HttpResponseMessage HashUrl(string sUrl)
        {
            URLManager          _urlManager = new URLManager();
            var                 result      = _urlManager.HashUrl(sUrl);
            HttpResponseMessage response    = Request.CreateResponse(HttpStatusCode.OK, result);

            return(response);
        }
示例#7
0
        public HttpResponseMessage ShortenURL(string longUrl)
        {
            URLManager          _urlManager = new URLManager();
            var                 result      = _urlManager.Shorten(longUrl);
            HttpResponseMessage response    = Request.CreateResponse(HttpStatusCode.OK, result);

            return(response);
        }
示例#8
0
    static void GetURI()
    {
        URL = URLManager.GetURL(SDKInterfaceDefine.PropertiesKey_SelectServerURL);

        if (!string.IsNullOrEmpty(SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_SelectServerURL, null)))
        {
            URL = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_SelectServerURL, null);
        }
    }
        private static string Redirect(out int status, out string location, int PortalID, PortalSettings pS, int TabID, string result, URLEntity CurrentURL, string QueryParameters)
        {
            URLEntity RedirectURL = URLManager.GetDefaultURL(CurrentURL.ModuleID, CurrentURL.EntityID, CurrentURL.Entity, CurrentURL.Language);

            location = URLFactory.GetFriendlyURL(null, pS, RedirectURL.Slug, QueryParameters, RedirectURL.Language, RedirectURL.PageName);
            status   = 301;

            return(result);
        }
示例#10
0
    // ダイアログ ガイドライン
    public void OnClickProbability()
    {
        if (ServerApi.IsExists)
        {
            return;
        }

        URLManager.OpenURL(m_ProbabilityUrl);
    }
示例#11
0
    static void ShowLog()
    {
        scrollPos = GUILayout.BeginScrollView(scrollPos);

        try
        {
            GUIUtil.SafeTextArea(showContent);
        }
        catch (Exception e)
        {
            GUILayout.TextArea(e.ToString());
        }

        GUILayout.EndScrollView();

        if (URLManager.GetURL("LogUpLoadURL") != null)
        {
            if (GUILayout.Button("上传日志"))
            {
                HTTPTool.Upload_Request_Thread(URLManager.GetURL("LogUpLoadURL"), LogPath, UploadCallBack);
            }
        }
        else
        {
            GUILayout.Label("上传日志需要在 URLConfig -> LogUpLoadURL 配置上传目录");
        }

#if UNITY_ANDROID
        if (GUILayout.Button("导出到设备"))
        {
            try
            {
                string path = phonePath + LogName + ".txt";
                FileTool.CreatFilePath(path);
                File.Copy(LogPath, path, true);
                GUIUtil.ShowTips("复制成功");
            }
            catch (Exception e)
            {
                GUIUtil.ShowTips(e.ToString());
            }
        }
#endif

        if (GUILayout.Button("复制到剪贴板"))
        {
            TextEditor tx = new TextEditor();
            tx.text = showContent;
            tx.OnFocus();
            tx.Copy();
        }

        if (GUILayout.Button("返回上层"))
        {
            isShowLog = false;
        }
    }
示例#12
0
    static void ReplayListGUI()
    {
        scrollPos = GUILayout.BeginScrollView(scrollPos);

        for (int i = 0; i < FileNameList.Length; i++)
        {
            if (!isUploadReplay)
            {
                if (GUILayout.Button(FileNameList[i]))
                {
                    ChoseReplayMode(true, FileNameList[i]);
                }
            }
            else
            {
                if (GUILayout.Button("上传 " + FileNameList[i]))
                {
                    string replayPath = GetReplayEventFilePath(FileNameList[i]);
                    string randomPath = GetReplayRandomFilePath(FileNameList[i]);

                    HTTPTool.Upload_Request_Thread(URLManager.GetURL("ReplayFileUpLoadURL"), replayPath, UploadCallBack);
                    HTTPTool.Upload_Request_Thread(URLManager.GetURL("ReplayFileUpLoadURL"), randomPath, UploadCallBack);
                }
            }
        }

        GUILayout.EndScrollView();

        if (GUILayout.Button("清除记录"))
        {
            OpenWarnWindow("确定要删除所有记录吗?", () =>
            {
                Debug.Log("已删除所有记录");
                FileTool.SafeDeleteDirectory(PathTool.GetAbsolutePath(ResLoadLocation.Persistent, c_directoryName));
                FileNameList = new string[0];
            });
        }

        if (URLManager.GetURL("ReplayFileUpLoadURL") != null)
        {
            if (GUILayout.Button("上传模式 : " + isUploadReplay))
            {
                isUploadReplay = !isUploadReplay;
            }
        }
        else
        {
            GUILayout.Label("上传持久数据需要在 URLConfig -> ReplayFileUpLoadURL 配置上传目录");
        }

        if (GUILayout.Button("返回上层"))
        {
            MenuStatus = DevMenuEnum.MainMenu;
        }
    }
示例#13
0
 public override void Write(string data)
 {
     URLManager.CreatePath(path);
     try
     {
         File.WriteAllText(source, data);
     }
     catch (Exception exception)
     {
         Debug.LogException(exception);
     }
 }
示例#14
0
    static void ShowPersistentFileList()
    {
        scrollPos = GUILayout.BeginScrollView(scrollPos);

        for (int i = 0; i < FileNameList.Length; i++)
        {
            if (GUILayout.Button(FileNameList[i]))
            {
                //isShowPersistentFile = true;
                //scrollPos = Vector2.zero;
                //showContent = PersistentFileManager.GetData(FileNameList[i]);
                //LogPath = PersistentFileManager.GetPath(FileNameList[i]);

                string path = PersistentFileManager.GetPath(FileNameList[i]);
                HTTPTool.Upload_Request_Thread(URLManager.GetURL("PersistentFileUpLoadURL"), path, UploadCallBack);
            }
        }

        GUILayout.EndScrollView();

        if (URLManager.GetURL("PersistentFileUpLoadURL") != null)
        {
            if (GUILayout.Button("上传所有持久数据文件"))
            {
                for (int i = 0; i < FileNameList.Length; i++)
                {
                    string path = PersistentFileManager.GetPath(FileNameList[i]);
                    HTTPTool.Upload_Request_Thread(URLManager.GetURL("PersistentFileUpLoadURL"), path, UploadCallBack);
                }
            }
        }
        else
        {
            GUILayout.Label("上传持久数据文件需要在 URLConfig -> PersistentFileUpLoadURL 配置上传目录");
        }

        if (GUILayout.Button("清除持久数据文件"))
        {
            OpenWarnWindow("确定要删除所有持久数据文件吗?", () =>
            {
                Debug.Log("已删除所有持久数据文件");
                FileTool.SafeDeleteDirectory(PathTool.GetAbsolutePath(ResLoadLocation.Persistent, PersistentFileManager.c_directoryName));
                FileNameList = new string[0];
            });
        }

        if (GUILayout.Button("返回上层"))
        {
            MenuStatus = DevMenuEnum.MainMenu;
        }
    }
示例#15
0
 /**
  * 获取签到列表
  */
 public static void requestSignInList(Action <Error, SignInResult> action)
 {
     HttpUtil.Http.Get(URLManager.signInListUrl()).OnSuccess(result =>
     {
         if (result != null)
         {
             SignInResult signInResult = JsonMapper.ToObject <SignInResult>(result);
             action(null, signInResult);
         }
     }).OnFail(result =>
     {
         action(new Error(500, null), null);
     }).Go();
 }
示例#16
0
 /**
  * 领取签到奖励
  */
 public static void receiveSignInReward(int isMore, Action <Error, ReceiveSignInResult> action)
 {
     HttpUtil.Http.Get(URLManager.receiveSignInRewardUrl(isMore)).OnSuccess(result =>
     {
         if (result != null)
         {
             ReceiveSignInResult receiveSignInResult = JsonMapper.ToObject <ReceiveSignInResult>(result);
             action(null, receiveSignInResult);
         }
     }).OnFail(result =>
     {
         action(new Error(500, null), null);
     }).Go();
 }
示例#17
0
 /// <summary>
 /// Initializating managers and uOw
 /// </summary>
 public TaskExecuter()
 {
     uOw               = new UnitOfWork();
     elasticuOw        = new ElasticUnitOfWork();
     parsermanager     = new ParserTaskManager(uOw);
     propmanager       = new PropertyManager(uOw);
     goodManager       = new GoodManager(uOw);
     urlManager        = new URLManager(uOw);
     htmlValidator     = new HtmlValidator();
     priceManager      = new PriceManager(uOw);
     elasticManager    = new ElasticManager(elasticuOw);
     goodwizardManager = new GoodDatabasesWizard(elasticuOw, uOw);
     taskinfoManager   = new ExecuteManager(uOw);
 }
示例#18
0
        public void GetUrlsFromOnePage()
        {
            AutoMapperConfig.Configure();
            // mock Repo logic
            var uof        = new Mock <IUnitOfWork>();
            var mngr       = new URLManager(uof.Object);
            var testurl    = "http://rozetka.com.ua/notebooks/c80004/filter/page=1;preset=dlya-biznesa/";
            var testxpath  = "xpath-//div[@id='block_with_goods']/div/div/div/div/div/div/div/a";
            var result     = mngr.GetUrlsFromOnePage(testurl, testxpath);
            var resultList = new List <string>()
            {
                "http://rozetka.com.ua/apple_a1708_macbook_pro_13_mll42ua_a/p12318700/",
                "http://rozetka.com.ua/dell_monet14skl1703_016_ubu/p11041615/",
                "http://rozetka.com.ua/lenovo_20evs03n00/p9311138/",
                "http://rozetka.com.ua/lenovo_20evs03m00/p9310900/",
                "http://rozetka.com.ua/hp_t6p10ea/p10126687/",
                "http://rozetka.com.ua/hp_p5r72ea/p10113779/",
                "http://rozetka.com.ua/dell_van15skl1701_017_ubu/p8914053/",
                "http://rozetka.com.ua/hp_p5s45ea/p10101893/",
                "http://rozetka.com.ua/hp_p4p07ea/p10151852/",
                "http://rozetka.com.ua/dell_van15skl1703_009_ubu/p11042350/",
                "http://rozetka.com.ua/hp_probook_450_w4p15ea/p11107282/",
                "http://rozetka.com.ua/hp_probook_440_g3_p5s55ea/p8425390/",
                "http://rozetka.com.ua/hp_probook_450_w4p13ea/p11099869/",
                "http://rozetka.com.ua/hp_probook_440_w4p04ea/p11095368/",
                "http://rozetka.com.ua/hp_probook_430_x0p48es/p11092932/",
                "http://rozetka.com.ua/dell_monet14skl1703_008/p11041370/",
                "http://rozetka.com.ua/hp_probook_470_w4p87ea/p11107660/",
                "http://rozetka.com.ua/dell_n002l347014emea_ubu/p11080178/",
                "http://rozetka.com.ua/hp_probook_450_w4p68ea/p11107338/",
                "http://rozetka.com.ua/asus_pro_p2520la_xo0131r/p12154843/",
                "http://rozetka.com.ua/dell_van15skl1703_008_ubu/p10988933/",
                "http://rozetka.com.ua/hp_probook_440_v5e85av/p12011434/",
                "http://rozetka.com.ua/apple_macbook_pro_retina_15_mjlq2uaa/p3252779/",
                "http://rozetka.com.ua/dell_van15skl1703_006/p11042287/",
                "http://rozetka.com.ua/asus_pu301la-ro173h/p1839562/",
                "http://rozetka.com.ua/hp_probook_430_w4n80ea/p11090097/",
                "http://rozetka.com.ua/dell_vostro_5459_monet14skl1605_007glw/p8913871/",
                "http://rozetka.com.ua/lenovo_20ets03100/p9303305/",
                "http://rozetka.com.ua/hp_probook_470_w4p93ea/p11107520/",
                "http://rozetka.com.ua/hp_probook_450_w4p51ea/p11107009/",
                "http://rozetka.com.ua/hp_probook_450_p4p32ea/p6592119/",
                "http://rozetka.com.ua/dell_monet14skl1703_011/p11041902/",
            };

            Assert.IsNotNull(result, "Null property returned");
            Assert.AreEqual(resultList, result);
        }
示例#19
0
        /**
         *  获取用户牌局记录
         */
        public void pokerRecordList(Action <Error, UserPokerRecord> action)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            HttpUtil.Http.Get(URLManager.recordList("10", "1")).OnSuccess(result =>
            {
                if (result != null)
                {
                    UserPokerRecord userPokerRecordList = JsonMapper.ToObject <UserPokerRecord>(result);
                    action(null, userPokerRecordList);
                }
            }).OnFail(result =>
            {
                action(new Error(500, null), null);
            }).GoSync();
        }
示例#20
0
        /**
         * 获取用户详细信息
         */
        public void userDetail(Action <Error, UserDetail> action)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            HttpUtil.Http.Get(URLManager.userDetail()).OnSuccess(result =>
            {
                if (result != null)
                {
                    UserDetail userDetail = JsonMapper.ToObject <UserDetail>(result);
                    action(null, userDetail);
                }
            }).OnFail(result =>
            {
                action(new Error(500, null), null);
            }).Go();
        }
示例#21
0
 public string GetSummonerIdByName(string sumName)
 {
     try
     {
         using (this.client = new WebClient())
         {
             string summonerId = client.DownloadString(URLManager.SummonerByName(sumName)).ExtractID();
             this.SummonerId   = int.Parse(summonerId);
             this.SummonerName = sumName;
         }
         return(responseCode = "#02");
     }
     catch (Exception ex)
     {
         return("#03");
     }
 }
示例#22
0
    void OnShowAgreementDialog()
    {
        Dialog newDialog = Dialog.Create(DialogType.DialogYesNo);

        newDialog.SetDialogTextFromTextkey(DialogTextType.Title, "pp6q_title");
        if (m_firstAgreement == true)
        {
            // 初回時
            newDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "pp6q_content");
            Debug.LogError("Agreement first");
        }
        else
        {
            // バージョン更新時
            newDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "pp6q_content2");
            Debug.LogError("Agreement ver update");
        }
        newDialog.SetDialogTextFromTextkey(DialogTextType.YesText, "common_button2");
        newDialog.SetDialogTextFromTextkey(DialogTextType.NoText, "common_button3");
        newDialog.SetMenuInButton(true);
        newDialog.SetDialogTextFromTextkey(DialogTextType.InButtonText, "pp6q_button");
        newDialog.SetDialogEvent(DialogButtonEventType.YES, new System.Action(() =>
        {
            //----------------------------------------
            // 利用規約に同意したことをセーブ
            //----------------------------------------
            LocalSaveManager.Instance.SaveFuncInformationOK(LocalSaveManager.AGREEMENT.AGREE_OK);
            newDialog.Hide();
            SceneSplashFSM.Instance.SendFsmPositiveEvent();
        }));
        newDialog.SetDialogEvent(DialogButtonEventType.NO, new System.Action(() =>
        {
            newDialog.Hide();
            SceneSplashFSM.Instance.SendFsmNegativeEvent();
        }));
        newDialog.SetDialogEvent(DialogButtonEventType.INBUTTON, new System.Action(() =>
        {
            string url = Patcher.Instance.GetAgreementUrl();
            URLManager.OpenURL(url);
        }));
        newDialog.EnableFadePanel();
        newDialog.DisableCancelButton();
        newDialog.DisableAutoHide();
        newDialog.Show();
    }
示例#23
0
    public void OnClick()
    {
        if (ButtonBlocker.Instance.IsActive())
        {
            return;
        }

        SoundUtil.PlaySE(SEID.SE_MENU_OK);

#if BUILD_TYPE_DEBUG
        Debug.Log("CALL Banner#OnClick:" + gameObject.name + " link:" + Context.link);
#endif
        if (Context.link.StartsWith("http"))
        {
            URLManager.OpenURL(Context.link);
            return;
        }
        else
        {
            switch (Context.JumpToInApp_Place)
            {
            case "areamap":
                MainMenuParam.m_RegionID = MasterDataUtil.GetRegionIDFromCategory(MasterDataDefineLabel.REGION_CATEGORY.STORY);
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT_AREA_STORY, false, false);
                break;

            case "scratch":
                MainMenuParam.m_GachaMaster = MasterDataUtil.GetActiveGachaMaster().FirstOrDefault(g => g.fix_id == Context.JumpToInApp_Id);
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_GACHA_MAIN, false, false);
                break;

            case "area":
                MainMenuParam.SetQuestSelectParam(Context.JumpToInApp_Id);
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_QUEST_SELECT, false, false, false);
                break;

            case "challenge":
                MainMenuParam.SetChallengeSelectParamFromEventID(Context.JumpToInApp_Id);
                MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_CHALLENGE_SELECT, false, false, false);
                break;
            }

            return;
        }
    }
示例#24
0
 /**
  * 获取任务列表
  */
 public static void getTaskList(Action <Error, UserTaskMongoModel> action)
 {
     HttpUtil.Http.Get(URLManager.taskListUrl()).OnSuccess(result =>
     {
         if (result != null)
         {
             TaskListResult taskList = JsonMapper.ToObject <TaskListResult>(result);
             action(null, taskList.data);
         }
         else
         {
             action(new Error(500, null), null);
         }
     }).OnFail(result =>
     {
         action(new Error(500, null), null);
     }).GoSync();
 }
示例#25
0
        /**
         * 退出登录
         */
        public void logout(Action <Error, string> action)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            HttpUtil.Http.Post(URLManager.logoutUrl()).Form(dic).OnSuccess(result =>
            {
                if (result != null)
                {
                    action(null, null);
                }
            }).OnFail(result =>
            {
                if (action != null)
                {
                    action(new Error(500, null), null);
                }
            }).Go();
        }
示例#26
0
 /**
  * 领取任务奖励
  */
 public static void taskReceive(string taskId, Action <Error, ReceiveTaskRewardResult> action)
 {
     HttpUtil.Http.Get(URLManager.taskReceiveUrls(taskId)).OnSuccess(result =>
     {
         if (result != null)
         {
             ReceiveTaskRewardResult taskList = JsonMapper.ToObject <ReceiveTaskRewardResult>(result);
             action(null, taskList);
         }
         else
         {
             action(new Error(500, null), null);
         }
     }).OnFail(result =>
     {
         action(new Error(500, null), null);
     }).Go();
 }
示例#27
0
        private static void buildPreviewRepository()
        {
            uint i = 0;
            TextureRepository repository = new TextureRepository();

            AssetBundleBuild[] existingBundles = AssetDatabase.GetAllAssetBundleNames().Select(
                bundleName =>
            {
                Debug.Log(string.Format("Scanning Bundle: {0}", bundleName));
                string[] assets = AssetDatabase.GetAssetPathsFromAssetBundle(bundleName);
                foreach (string pageName in assets)
                {
                    if (pageName == lastUsedAssetPath)
                    {
                        wizard.GameContainer.TestImageID = i;
                    }
                    if (pageName.Contains(".jpg"))
                    {
                        repository.Add(new Texture(
                                           i,
                                           pageName,
                                           bundleName
                                           ));
                        Debug.Log(string.Format("\tAsset: \"{0}\"", pageName));
                        Debug.Log(repository.ToJSON());
                    }
                    i++;
                }
                return(new AssetBundleBuild {
                    assetBundleName = bundleName,
                    assetBundleVariant = "",
                    assetNames = assets
                });
            }).ToArray();

            AssetPath.CreateAssetPath(AssetPath.DEFAULT_REPOSITORY_EXPORT_PATH);

            File.WriteAllText(URLManager.CombinePath(
                                  Application.streamingAssetsPath,
                                  AssetPath.DEFAULT_REPOSITORY_IN_SA,
                                  URLManager.DEFAULT_TEXTURE_REPOSITORY_FILENAME),
                              repository.ToJSON());
        }
示例#28
0
        public static string CreateAssetPath(string path)
        {
            string[] foldersChain = URLManager.SplitPath(path);
            if (foldersChain.Length <= 0)
            {
                return(string.Empty);
            }
            string currentPath = foldersChain[0];

            for (int i = 0; i < foldersChain.Length - 1; i++)
            {
                if (!AssetDatabase.IsValidFolder(currentPath + "/" + foldersChain[i + 1]))
                {
                    AssetDatabase.CreateFolder(currentPath, foldersChain[i + 1]);
                }
                currentPath = Path.Combine(currentPath, foldersChain[i + 1]);
            }
            return(path);
        }
示例#29
0
 /**
  * 钻石兑换
  */
 public static void exchargeDiamond(string goodID, Action <Error> action)
 {
     HttpUtil.Http.Get(URLManager.diamondExchangeUrl(goodID)).OnSuccess(result =>
     {
         Dictionary <string, object> resultDict = JsonMapper.ToObject <Dictionary <string, object> >(result);
         string ret = resultDict["ret"].ToString();
         if (ret == "1")
         {
             action(null);
         }
         else
         {
             action(new Error(500, null));
         }
     }).OnFail(result =>
     {
         action(new Error(500, null));
     }).Go();
 }
示例#30
0
        /**
         * 更新昵称
         */
        public void nickname(string nickname, Action <Error, string> action)
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("nickname", nickname);

            HttpUtil.Http.Post(URLManager.postNickname()).Form(dic).OnSuccess(result =>
            {
                if (result != null)
                {
                    action(null, nickname);
                }
            }).OnFail(result =>
            {
                if (action != null)
                {
                    action(new Error(500, null), null);
                }
            }).Go();
        }