示例#1
0
        public static void Reset()
        {
            MonoSingleton <SRPG.Network> .Instance.mTicket = 1;
            MonoSingleton <SRPG.Network> .Instance.mRequests.Clear();

            GsccBridge.Reset();
        }
示例#2
0
        private void OpenURL()
        {
            this.uniWebView = (UniWebView)this.Target.GetComponent <UniWebView>();
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.uniWebView, (UnityEngine.Object)null))
            {
                this.uniWebView = (UniWebView)this.Target.AddComponent <UniWebView>();
            }
            this.uniWebView.OnLoadComplete            += new UniWebView.LoadCompleteDelegate(this.OnLoadComplete);
            this.uniWebView.OnReceivedMessage         += new UniWebView.ReceivedMessageDelegate(this.OnReceivedMessage);
            this.uniWebView.InsetsForScreenOreitation += new UniWebView.InsetsForScreenOreitationDelegate(this.InsetsForScreenOreitation);
            this.uniWebView.insets = new UniWebViewEdgeInsets(0, 0, 0, 0);
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            GsccBridge.SetWebViewHeaders(new Action <string, string>(dictionary.Add));
            using (Dictionary <string, string> .Enumerator enumerator = dictionary.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <string, string> current = enumerator.Current;
                    this.uniWebView.SetHeaderField(current.Key, current.Value);
                }
            }
            this.uniWebView.SetShowSpinnerWhenLoading(true);
            this.uniWebView.url = MonoSingleton <GameManager> .Instance.FgGAuthHost;
            this.uniWebView.Load();
        }
示例#3
0
 private void ConnectingGsc(WebAPI api)
 {
     ++SRPG.Network.TicketID;
     SRPG.Network.IsError = false;
     SRPG.Network.ErrCode = SRPG.Network.EErrCode.Success;
     MonoSingleton <SRPG.Network> .Instance.mCurrentRequest = api;
     GsccBridge.Send(api, false);
 }
示例#4
0
 public static void RequestAPIImmediate(WebAPI api, bool autoRetry)
 {
     MonoSingleton <SRPG.Network> .Instance.mImmediateMode = true;
     GsccBridge.SendImmediate(api);
     if (!MonoSingleton <SRPG.Network> .Instance.mImmediateMode)
     {
         return;
     }
     MonoSingleton <SRPG.Network> .Instance.mImmediateMode = false;
     if (!autoRetry)
     {
         return;
     }
     --SRPG.Network.TicketID;
     SRPG.Network.ResetError();
     SRPG.Network.RequestAPI(api, true);
 }
示例#5
0
        public static void RemoveAPI()
        {
            GsccBridge.Reset();
            if (MonoSingleton <SRPG.Network> .Instance.mImmediateMode)
            {
                MonoSingleton <SRPG.Network> .Instance.mImmediateMode = false;
            }
            else if (MonoSingleton <SRPG.Network> .Instance.mRequests.Count <= 0)
            {
                DebugUtility.LogWarning("Instance.mRequestsGsc.Count <= 0");
            }
            else
            {
                MonoSingleton <SRPG.Network> .Instance.mRequests.Remove(MonoSingleton <SRPG.Network> .Instance.mCurrentRequest);

                if (MonoSingleton <SRPG.Network> .Instance.mRequests.Count != 0)
                {
                    return;
                }
                CriticalSection.Leave(CriticalSections.Network);
            }
        }
示例#6
0
        private void Start()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.Target, (UnityEngine.Object)null))
            {
                return;
            }
            string text = FlowNode_Variable.Get("SHARED_WEBWINDOW_TITLE");

            if (!string.IsNullOrEmpty(text))
            {
                this.Target.SetTitleText(text);
            }
            string url = FlowNode_Variable.Get("SHARED_WEBWINDOW_URL");

            if (!string.IsNullOrEmpty(url))
            {
                if (this.usegAuth)
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    GsccBridge.SetWebViewHeaders(new Action <string, string>(dictionary.Add));
                    using (Dictionary <string, string> .Enumerator enumerator = dictionary.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            KeyValuePair <string, string> current = enumerator.Current;
                            this.Target.SetHeaderField(current.Key, current.Value);
                        }
                    }
                }
                this.Target.OpenURL(url);
                FlowNode_Variable.Set("SHARED_WEBWINDOW_URL", string.Empty);
            }
            else
            {
                this.Caution.SetActive(true);
            }
        }
示例#7
0
        private void Create()
        {
            GameObject gameObject = AssetManager.Load <GameObject>("UI/WebView");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                this.webView = (WebView)((GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject)).GetComponent <WebView>();
                if (this.useVariable)
                {
                    string str1 = FlowNode_Variable.Get(this.URL);
                    if (!string.IsNullOrEmpty(str1))
                    {
                        this.URL = str1;
                    }
                    string str2 = FlowNode_Variable.Get(this.Title);
                    if (!string.IsNullOrEmpty(str2))
                    {
                        this.Title = str2;
                    }
                }
                this.webView.OnClose = new UIUtility.DialogResultEvent(this.OnClose);
                this.webView.Text_Title.set_text(LocalizedText.Get(this.Title));
                if (this.usegAuth)
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    GsccBridge.SetWebViewHeaders(new Action <string, string>(dictionary.Add));
                    using (Dictionary <string, string> .Enumerator enumerator = dictionary.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            KeyValuePair <string, string> current = enumerator.Current;
                            this.webView.SetHeaderField(current.Key, current.Value);
                        }
                    }
                }
                if (this.URL.StartsWith("http://") || this.URL.StartsWith("https://"))
                {
                    this.webView.OpenURL(this.URL);
                }
                else if (this.URLMode == FlowNode_WebView.URL_Mode.APIHost)
                {
                    this.webView.OpenURL(Network.Host + this.URL);
                }
                else if (this.URLMode == FlowNode_WebView.URL_Mode.SiteHost)
                {
                    this.webView.OpenURL(Network.SiteHost + this.URL);
                }
                else
                {
                    if (this.URLMode != FlowNode_WebView.URL_Mode.NewsHost)
                    {
                        return;
                    }
                    this.webView.OpenURL(Network.NewsHost + this.URL);
                }
            }
            else
            {
                Debug.Log((object)"Prefab not Found");
            }
        }
示例#8
0
 public static void SetRetry()
 {
     GsccBridge.Retry();
 }