示例#1
0
        public static bool Start()
        {
            int threadCount = 1;

            if (threadCount == 1)
            {
                GlobalThread thread = new GlobalThread();
                if (thread.Start(_botNick, true))
                {
                    _threads = new[] { thread };
                }
            }
            else
            {
                List <GlobalThread> threadTemp = new List <GlobalThread>();
                for (int i = 0; i < threadCount; i++)
                {
                    GlobalThread temp = new GlobalThread();
                    if (temp.Start(_botNick + (i + 1), (threadTemp.Count == 0)))
                    {
                        threadTemp.Add(temp);
                    }
                }
                _threads = threadTemp.ToArray();
            }

            if (_threads.Length > 0)
            {
                //HookUpHandlers();
                return(true);
            }
            Logger.Log(LogType.SystemActivity, "GlobalChat functionality disabled.");
            return(false);
        }
示例#2
0
        private void OnClickLoginBtn()
        {
            var userName = UserNameInputField.text;
            var pwd      = PasswordInputField.text;

            AVUser.LogInAsync(userName, pwd).ContinueWith(t =>
            {
                if (t.IsFaulted || t.IsCanceled)
                {
                    var error = t.Exception.Message; // 登录失败,可以查看错误信息。
                    GlobalThread.runOnMainThread(() => {
                        PanelManager.FloatPanel.Show("登录失败,请联系管理员!");
                    });
                }
                else
                {
                    GlobalThread.runOnMainThread(() => {
                        PanelManager.FloatPanel.Show("登录成功!" + AVUser.CurrentUser.ObjectId);
                        SceneManager.LoadScene("Scenes/" + GameScene.LoadingScene);
                    });
                }
            });
        }
示例#3
0
        public static bool Start()
        {
            int threadCount = 1;

            if (threadCount == 1)
            {
                GlobalThread thread = new GlobalThread();
                if (thread.Start(botNick, true))
                {
                    threads = new[] { thread };
                }

            }
            else
            {
                List<GlobalThread> threadTemp = new List<GlobalThread>();
                for (int i = 0; i < threadCount; i++)
                {
                    GlobalThread temp = new GlobalThread();
                    if (temp.Start(botNick + (i + 1), (threadTemp.Count == 0)))
                    {
                        threadTemp.Add(temp);
                    }
                }
                threads = threadTemp.ToArray();
            }

            if (threads.Length > 0)
            {
                //HookUpHandlers();
                return true;
            }
            else
            {
                Logger.Log(LogType.SystemActivity, "GlobalChat functionality disabled.");
                return false;
            }
        }