yyl
22 小时以前 4b5b31a23a74c1559460643836d70778d7d49931
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
 
 
public class DisconnectHintWin : UIBase
{
    [SerializeField] Text m_Content;
    [SerializeField] Button m_Confirm;
    [SerializeField] Button m_Cancel;
 
    #region Built-in
 
    protected override void InitComponent()
    {
        m_Cancel.AddListener(Cancel);
        m_Confirm.AddListener(Confirm);
    }
 
    protected override void OnPreOpen()
    {
        if (StageManager.Instance.currentStage == StageName.Login)
        {
            m_Content.text = Language.Get("Disconnected_2");
        }
        else
        {
            m_Content.text = Language.Get("Disconnected_1");
        }
    }
 
    #endregion
 
    private void Confirm()
    {
        switch (Application.internetReachability)
        {
            case NetworkReachability.NotReachable:
                GameNetSystem.Instance.LoginOut();
                ServerForceExitHintWin.reason = 111;
                break;
            case NetworkReachability.ReachableViaCarrierDataNetwork:
            case NetworkReachability.ReachableViaLocalAreaNetwork:
                if (StageManager.Instance.currentStage == StageName.Login)
                {
                    LoginManager.Instance.busy = false;
                    LoginManager.Instance.AccountLogin(LoginManager.Instance.accountBuf, LoginManager.Instance.ipBuf,
                    LoginManager.Instance.portBuf, LoginManager.Instance.gamePortBuf);
                }
                else
                {
                    GameNetSystem.Instance.Reconnect();
                }
                break;
        }
 
        CloseWindow();
    }
 
    private void Cancel()
    {
        if (!(StageManager.Instance.currentStage == StageName.Login))
        {
            GameNetSystem.Instance.LoginOut();
        }
 
        CloseWindow();
    }
 
}