public OnlineStat() { InitializeComponent(); initIndicator.Visibility = Visibility.Hidden; var mySqlConfig = new IpPortConfig { Ip = Settings.Default.mysql_ip, Port = Settings.Default.mysql_port }; var worldConfig = new IpPortConfig { Ip = Settings.Default.world_ip, Port = Settings.Default.world_port }; var addressSet = new AddressSet { LoadStatOnline = string.Format(Settings.Default.api_url + "?_key={0}&_url=online", Settings.Default.skey_api), }; _addressSet = addressSet; _mySqlConfig = mySqlConfig; _worldConfig = worldConfig; _launcher = new LauncherLogic(addressSet, mySqlConfig, worldConfig); _launcher.StatOnline += Launcher_OnStatOnline; _webClientFactory = new WebClientFactory(); _web = _webClientFactory.Create(); }
public LoginForm() { InitializeComponent(); Initialize(); initIndicator.Visibility = Visibility.Hidden; _webClientFactory = new WebClientFactory(); _xmlhelper = new XmlHelper(); _web = _webClientFactory.Create(); }
private async void UpdateOnlinePlayersCounter(string onlinePlayersAddress, string worldIp, int worldPort) { bool connected = await _launcher.CheckConnectionToServerAsync(worldIp, worldPort); if (connected) { on_off.Content = "Online"; on_off.Foreground = Brushes.Lime; WebClient web = _webClientFactory.Create(); onlinePlayer.Content = await web.DownloadStringTaskAsync(onlinePlayersAddress); } else { on_off.Content = "Offline"; on_off.Foreground = Brushes.Red; onlinePlayer.Content = "0"; } }
// переменные для каждого слота по картинке public CharacterInfo(string charName) { InitializeComponent(); initIndicator.Visibility = Visibility.Hidden; CharName = charName; bgCharInfo.DataContext = ImagePath; // дата контекст для переменных слотов s0.DataContext = Slot0; s1.DataContext = Slot0; s2.DataContext = Slot0; s3.DataContext = Slot0; s4.DataContext = Slot0; s5.DataContext = Slot0; s6.DataContext = Slot0; s7.DataContext = Slot0; s8.DataContext = Slot0; s9.DataContext = Slot0; s10.DataContext = Slot0; s11.DataContext = Slot0; s12.DataContext = Slot0; s13.DataContext = Slot0; s14.DataContext = Slot0; s15.DataContext = Slot0; s16.DataContext = Slot0; s17.DataContext = Slot0; s18.DataContext = Slot0; // дата контекст для переменных слотов var mySqlConfig = new IpPortConfig { Ip = Settings.Default.mysql_ip, Port = Settings.Default.mysql_port }; var worldConfig = new IpPortConfig { Ip = Settings.Default.world_ip, Port = Settings.Default.world_port }; var addressSet = new AddressSet { //ShowPlayerInfo = Settings.Default.site_link + "launcher/charinfo.php?charName=" + charName,// Display info character ShowPlayerInfo = string.Format(Settings.Default.api_url + "?_key={0}&_url=CharInfo/" + charName, Settings.Default.skey_api), PlayerImage = string.Format(Settings.Default.api_url + "?_key={0}&_url=CharItem/" + charName, Settings.Default.skey_api), }; _addressSet = addressSet; _mySqlConfig = mySqlConfig; _worldConfig = worldConfig; _launcher = new LauncherLogic(addressSet, mySqlConfig, worldConfig); _launcher.ShowPlayerInfo += Launcher_OnShowPlayerInfo; _launcher.PlayerImage += Launcher_OnPlayerImage; _webClientFactory = new WebClientFactory(); _web = _webClientFactory.Create(); }
public MainWindow() { InitializeComponent(); Initialize(); #region SET VISIBILITY ELEMENTS SetVisibilityToHotNewsBlock(false); ProgressBar1.Visibility = Visibility.Hidden; bannersLoader.Visibility = Visibility.Hidden; initIndicator.Visibility = Visibility.Hidden; #endregion SET VISIBILITY ELEMENTS #region Конфиги Mysql и игровые _webClientFactory = new WebClientFactory(); _web = _webClientFactory.Create(); var mySqlConfig = new IpPortConfig { Ip = Settings.Default.mysql_ip, Port = Settings.Default.mysql_port }; var worldConfig = new IpPortConfig { Ip = Settings.Default.world_ip, Port = Settings.Default.world_port }; #endregion Конфиги Mysql и игровые #region ADRESSET (Логика для использования функций серверной части) var addressSet = new AddressSet { ServerPid = UrlHelper.Combine(Settings.Default.update_folder, Wow.FileName.PID_FILE_NAME), ServerPidClientRu = UrlHelper.Combine(Settings.Default.down_client_ru, Wow.FileName.PID_FILE_NAME), ServerPidClientEn = UrlHelper.Combine(Settings.Default.down_client_en, Wow.FileName.PID_FILE_NAME), ServerPatchFile = Settings.Default.patchlist, //ServerFilesRoot = Settings.Default.update_folder, HotNews = string.Format(Settings.Default.api_url + "?_key={0}&_url=hot_news", Settings.Default.skey_api), LoadBannerNews = string.Format(Settings.Default.api_url + "?_key={0}&_url=news", Settings.Default.skey_api), }; #endregion ADRESSET (Логика для использования функций серверной части) _addressSet = addressSet; _mySqlConfig = mySqlConfig; _worldConfig = worldConfig; _xmlhelper = new XmlHelper(); var ClientLocation = LocalConfiguration.Instance.Files.ConfDataFile; string rootDirectory = _xmlhelper.GetSettingValue("realm1_client_location"); string localPidFile = Path.Combine(rootDirectory, Wow.FileName.PID_FILE_NAME); #region IF PATH TO GAME EXISTS - CHECK AN UPDATE if (rootDirectory != "") { string langApp = _xmlhelper.GetSettingValue("client_lang"); switch (langApp) { case "en": string ServerFilesRootEN = Settings.Default.down_client_en; string ServerPatchFileEn = Settings.Default.down_client_en_patch; _updater = new WowUpdater(rootDirectory, addressSet.ServerPidClientEn, localPidFile, ServerPatchFileEn, ServerFilesRootEN); _updater.UpdateProgressChanged += Updater_UpdateProgressChanged; _updater.UpdateStateChanged += Updater_UpdateStateChanged; _updater.UpdateDownloadInfo += Updater_UpdateInfoChanged; break; default: break; } WelcomeBlock.HideBlock(); } else { WelcomeBlock.ShowBlock(); playButton.Visibility = Visibility.Hidden; } #endregion IF PATH TO GAME EXISTS - CHECK AN UPDATE #region LAUNCHER LOGIC _launcher = new LauncherLogic(addressSet, mySqlConfig, worldConfig); #endregion LAUNCHER LOGIC }
public MainWindow() { InitializeComponent(); TransformGroup group = (TransformGroup)bg.RenderTransform; _translate = (TranslateTransform)group.Children[3]; TransformGroup group1 = (TransformGroup)hand.RenderTransform; _translate1 = (TranslateTransform)group1.Children[3]; TransformGroup group2 = (TransformGroup)handAxe.RenderTransform; _translate2 = (TranslateTransform)group2.Children[3]; TransformGroup group3 = (TransformGroup)blik.RenderTransform; _translate3 = (TranslateTransform)group3.Children[3]; SetVisibilityToHotNewsBlock(false); progressBar.Visibility = Visibility.Hidden; bannersLoader.Visibility = Visibility.Hidden; bannersFrame.Visibility = Visibility.Hidden; hotNewsTextBox.Text = "Initialization..."; initIndicator.Visibility = Visibility.Hidden; _webClientFactory = new WebClientFactory(); _web = _webClientFactory.Create(); var mySqlConfig = new IpPortConfig { Ip = Settings.Default.mysql_ip, Port = Settings.Default.mysql_port }; var worldConfig = new IpPortConfig { Ip = Settings.Default.world_ip, Port = Settings.Default.world_port }; var addressSet = new AddressSet { OnlinePlayers = string.Format(Settings.Default.api_url + "?_key={0}&_url=count_online", Settings.Default.skey_api), ServerPid = UrlHelper.Combine(Settings.Default.new_files, Wow.FileName.PID_FILE_NAME), ServerPatchFile = Settings.Default.patchlist, ServerFilesRoot = Settings.Default.new_files, NewsAboutUpdate = string.Format(Settings.Default.api_url + "?_key={0}&_url=news", Settings.Default.skey_api), HotNews = string.Format(Settings.Default.api_url + "?_key={0}&_url=hot_news", Settings.Default.skey_api), LoadBannerNews = string.Format(Settings.Default.api_url + "?_key={0}&_url=news", Settings.Default.skey_api), }; _addressSet = addressSet; _mySqlConfig = mySqlConfig; _worldConfig = worldConfig; string rootDirectory = AppDomain.CurrentDomain.BaseDirectory; string localPidFile = Path.Combine(rootDirectory, Wow.FileName.PID_FILE_NAME); _updater = new WowUpdater(rootDirectory, addressSet.ServerPid, localPidFile, addressSet.ServerPatchFile, addressSet.ServerFilesRoot); _updater.UpdateProgressChanged += Updater_UpdateProgressChanged; _updater.UpdateStateChanged += Updater_UpdateStateChanged; _launcher = new LauncherLogic(addressSet, mySqlConfig, worldConfig); _launcher.DataLoadingStateChanged += Launcher_DataLoadingStateChanged; _launcher.NewsLoadStateChanged += Launcher_NewsLoadStateChanged; _launcher.NewsLoadBanner += Launcher_NewsLoadBanner; }