void Client_GetAdminInfoCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.User.AdminInfo> e) { App.BusyToken.CloseBusyWindow(); if (e.Cancelled) { return; } if (e.Error != null) { MessageBox.Show("服务器连接失败。"); SetUIEnable(true); return; } if (e.Result == null) { MessageBox.Show("获取管理员信息失败。"); SetUIEnable(true); return; } GlobalData.InitUser(e.Result); App.BusyToken.ShowBusyWindow("正在加载服务器配置..."); GlobalData.Client.GetGameConfig(); }
void Client_LoginAdminCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <string> e) { if (e.Cancelled) { return; } if (e.Error != null) { App.BusyToken.CloseBusyWindow(); //LogHelper.Instance.AddErrorLog("服务器连接失败。", e.Error); MessageBox.Show("服务器连接失败。"); SetUIEnable(true); return; } if (string.IsNullOrEmpty(e.Result)) { App.BusyToken.CloseBusyWindow(); MessageBox.Show("用户名不存在,或密码不正确。"); SetUIEnable(true); return; } if (e.Result == "ISLOGGED") { App.BusyToken.CloseBusyWindow(); MessageBox.Show("您的账户正在其它客户端登录,我们已将对方退出,请重新登录。"); SetUIEnable(true); return; } GlobalData.InitToken(e.Result); //this._syn.Post(o => //{ // this.txtAdminUserName.Text = ""; // this.txtPassword.Password = ""; //}, null); App.BusyToken.ShowBusyWindow("正在加载管理员信息..."); GlobalData.Client.GetAdminInfo(); }
void Client_GetGameConfigCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.SystemConfig.SystemConfigin1> e) { SetUIEnable(true); App.BusyToken.CloseBusyWindow(); if (e.Cancelled) { return; } if (e.Error != null) { MessageBox.Show("服务器连接失败。"); return; } if (e.Result == null) { MessageBox.Show("获取服务器配置失败。"); return; } GlobalData.GameConfig = e.Result.GameConfig; GlobalData.RegisterUserConfig = e.Result.RegisterUserConfig; GlobalData.AwardReferrerLevelConfig = new MetaData.SystemConfig.AwardReferrerLevelConfig(); GlobalData.AwardReferrerLevelConfig.SetListAward(new List <AwardReferrerConfig>(e.Result.AwardReferrerConfigList)); GlobalData.RouletteConfig = e.Result.RouletteConfig; if (!isHidden) { isHidden = true; _winMain = new MainWindow(); _winMain.Closed += WinMain_Closed; this.Visibility = System.Windows.Visibility.Hidden; _winMain.Show(); } }