Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Creating a game launcher with patching

$
0
0
Hello everyone :D Ok so I made a launcher and I want to implement patching for it so if the user is not on the right version then it will detect it and patch it. Here's the code I have currently

WebClient Client = new WebClient();
            WebClient Server = new WebClient();

            Client.DownloadFileAsync(new Uri("http://www.pytheria.com/Relapse/Patches/GameVersion.txt"), @"C:\Program Files (x86)\Pytheria\Relapse\Patches\GameVersion.txt");
            Server.DownloadFileAsync(new Uri("http://www.pytheria.com/Relapse/Patches/LauncherVersion.txt"), @"C:\Program Files (x86)\Pytheria\Relapse\Patches\LauncherVersion.txt");

            //Read text files//
            GameVersion = System.IO.File.ReadAllText(@"C:\Program Files (x86)\Pytheria\Relapse\Patches\GameVersion.txt");
            LauncherServerVersion = System.IO.File.ReadAllText(@"C:\Program Files (x86)\Pytheria\Relapse\Patches\LauncherVersion.txt");
            

            if (LauncherClientVersion == LauncherServerVersion)
            {
                MessageBox.Show("Your Launcher is Up-To-Date!");
            }

            if (GameClientVersion == GameVersion)
            {
                MessageBox.Show("Your Game is Up-To-Date");
            }



Also are my if statements are right? Also I tried to put a textbox to text the file reading but it didnt work I did the .ToString() at the end to so it looked like

txtbox1.text = GameVersion.ToString();


Thanks everyone!

-Kevin

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>