示例#1
0
 /// <summary>
 /// 离开房间按钮点击
 /// </summary>
 public void OnCloseClick()
 {
     Global.Inst.GetController <MJGameController>().SendLeaveRoom(() =>
     {
         NetProcess.InitNetWork(GameManager.Instance.Ip, GameManager.Instance.port);
         Global.Inst.GetController <MJGameController>().ConnectedToHallServer(null);
     });
 }
示例#2
0
 /// <summary>
 /// 离开房间
 /// </summary>
 public void OnLeaveClick()
 {
     Global.Inst.GetController <CommonTipsController>().ShowTips("确定要离开房间?", "确定|取消", () =>
     {
         Global.Inst.GetController <MJGameController>().SendLeaveRoom(() =>
         {
             NetProcess.InitNetWork(GameManager.Instance.Ip, GameManager.Instance.port);
             Global.Inst.GetController <MJGameController>().ConnectedToHallServer(null);
         });
     }, null);
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        //不可销毁对象
        GameObject.DontDestroyOnLoad(this);
        gameObject.AddComponent <SetTimeout>();
        //初始化模块
        InitModule();
        //游戏网络
        InitNetWork();
        //
        InitDelay();
        //



        CallBack call = () =>
        {
            NetProcess.InitNetWork(GameManager.Instance.Ip, GameManager.Instance.port);

            //初始化创建管理器
            InitSceneMgr();

            //初始化音效管理器
            SoundProcess.Create();

            InitSixSdkManager();
#if YYVOICE
            //开启YY语音
            YYsdkManager.Create();
#endif

            //加载配置信息
            LoadConfig(() =>
            {
                LoginController loading = Global.Inst.GetController <LoginController>();
                loading.OpenWindow();
            });
            SoundProcess.PlayMusic("BGSOUND");
        };

        if (mUseUrl)
        {
            GetIp(call);
        }
        else
        {
            call();
        }
    }
示例#4
0
    /// <summary>
    /// 检测版本更新
    /// </summary>
    private void CheckVersion()
    {
        if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor)
        {
            DelayRun(1, OpenLogin);
            return;
        }

        Assets.LoadTxtFileCallText(GameManager.Instance.mVersionTxtUrl, (t) =>
        {
            if (string.IsNullOrEmpty(t))
            {
                Global.Inst.GetController <CommonTipsController>().ShowTips("检测版本失败", "确定", true, () =>
                {
                    CheckVersion();
                });
            }
            else
            {
                GameVersion txt = Json.Deserialize <GameVersion>(t);
                if (txt == null)
                {
                    Global.Inst.GetController <CommonTipsController>().ShowTips("检测版本失败", "确定", true, () =>
                    {
                        CheckVersion();
                    });
                }
                else
                {
                    if (Application.platform != RuntimePlatform.Android && GameManager.Instance.mVersion == txt.examineVersion)//不是安卓设备,并且是审核版本
                    {
                        LoginModel.Inst.IsVisitor = true;
                        GameManager.Instance.Ip   = txt.examineIp;
                        NetProcess.InitNetWork(GameManager.Instance.Ip, GameManager.Instance.port);
                        ConfigManager.LoadAllConfig(txt.ios_resUrl, txt.ios_resVersion, OpenLogin);
                    }
                    else
                    {
                        LoginModel.Inst.IsVisitor = false;
                        string[] local            = GameManager.Instance.mVersion.Split('.');
                        string[] net  = new string[3];
                        string ver    = "";
                        string appUrl = "";
                        string resUrl = "";
                        int resId     = 0;
                        if (Application.platform == RuntimePlatform.Android)
                        {
                            net    = txt.android_version.Split('.');
                            ver    = txt.android_version;
                            appUrl = txt.android_appUrl;
                            resUrl = txt.android_resUrl;
                            resId  = txt.android_resVersion;
                        }
                        else if (Application.platform == RuntimePlatform.IPhonePlayer)
                        {
                            net    = txt.ios_version.Split('.');
                            ver    = txt.ios_version;
                            appUrl = txt.ios_appUrl;
                            resUrl = txt.ios_resUrl;
                            resId  = txt.ios_resVersion;
                        }

                        if (GameManager.Instance.mVersion != ver)
                        {
                            UpdateVersion(net, local, appUrl, resUrl, resId);
                        }
                        else
                        {
                            //OpenLogin();
                            ConfigManager.LoadAllConfig(resUrl, resId, OpenLogin);
                        }
                    }
                }
            }
        }, false);
    }