示例#1
0
 private void Client_StatsReceived(Zlo.Extras.ZloBFGame Game, Dictionary <string, float> List)
 {
     if (Game == ZloBFGame.BF_4)
     {
         Dispatcher.Invoke(() => { StatsListWin.StatsDG.ItemsSource = List; });
     }
 }
示例#2
0
        //private void Client_APIVersionReceived(Version Current , Version Latest , bool IsNeedUpdate , string DownloadAdress)
        //{
        //    if (IsNeedUpdate)
        //    {
        //        Dispatcher.Invoke(() =>
        //        {
        //            MessageBox.Show($"Current dll version : {Current}\nLatest dll version : {Latest}\nPress Ok to start Updating Zlo.dll" , "Update Notification" , MessageBoxButton.OK);
        //            string Sourcedll = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , "Zlo.dll");
        //            string Newdll = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , "Zlo_New.dll");

        //            using (WebClient wc = new WebClient())
        //            {
        //                wc.DownloadFileCompleted += Wc_DownloadFileCompleted;
        //                wc.DownloadFileAsync(new Uri(DownloadAdress) , Newdll);
        //            }
        //        });
        //    }
        //    else
        //    {
        //        Dispatcher.Invoke(() =>
        //        {
        //            Title = $"Bigworld12 new API launcher (Version {Current.ToString()})";
        //        });
        //    }
        //}

        //        private void Wc_DownloadFileCompleted(object sender , System.ComponentModel.AsyncCompletedEventArgs e)
        //        {
        //            //Zlo.dll completed
        //            if (e.Error != null)
        //            {
        //                //error occured
        //                Client_ErrorOccured(e.Error , "Error occured when updating Zlo.dll");
        //            }
        //            else
        //            {
        //                //no errors
        //                string Sourcedll = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , "Zlo.dll");
        //                string Newdll = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , "Zlo_New.dll");
        //                string BatchText =
        //                   $@"
        //@ECHO off
        //SETLOCAL EnableExtensions
        //set EXE={AppDomain.CurrentDomain.FriendlyName}
        //echo Waiting for process %EXE% to close ...
        //:LOOP
        //@Timeout /T 1 /NOBREAK>nul
        //tasklist /FI ""IMAGENAME eq %EXE%"" 2>NUL | find /I /N ""%EXE%"">NUL
        //if ""%ERRORLEVEL%""==""0"" goto LOOP
        //echo Process %EXE% closed
        //move /y ""{Newdll}"" ""{Sourcedll}""
        //start """" ""{System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , AppDomain.CurrentDomain.FriendlyName)}"" ""done""
        //Exit
        //";
        //                var bat_path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory , "UpdateBat.bat");
        //                //create the bat file
        //                File.WriteAllText(bat_path , BatchText);
        //                ProcessStartInfo si = new ProcessStartInfo(bat_path)
        //                {
        //                    WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory
        //                };
        //                Process.Start(si);
        //                Dispatcher.Invoke(() => { Application.Current.Shutdown(); });
        //            }
        //        }

        private void Client_GameStateReceived(Zlo.Extras.ZloBFGame game, string type, string message)
        {
            Dispatcher.Invoke(() =>
            {
                App.GameStateViewer.StateReceived(game, type, message);
                LatestGameStateTextBlock.Text = $"[{game}] [{type}] {message}";
            });
        }
示例#3
0
 private void Client_ClanDogTagsReceived(Zlo.Extras.ZloBFGame game, ushort dogtag1, ushort dogtag2, string clanTag)
 {
     if (game == Zlo.Extras.ZloBFGame.BF_3)
     {
         Dispatcher.Invoke(() =>
         {
             BF3_DT1.Text = dogtag1.ToString();
             BF3_DT2.Text = dogtag2.ToString();
             BF3_CT.Text  = clanTag;
         });
     }
 }