Hi folks,
I have promised a tutorial the other day on how to create a game updater but unfortunately I have been quite busy and to be completely honest it's easier and quicker for me to write something rather than create a high quality guide.
The advantage of using this patcher is that you do not need to keep track of your patches or create any sort of zips, simply commit your changes to your repository containing your client and the updater will automatically sort everything out for you
This patcher requires only one configuration file which is called appsettings.json. In there you need to set up a few things for the patcher to work correctly, those are:
RepositoryName - set this to the name of your public repository containing your game client.
ApiKey - you need to generate an api key and store it inside appsettings.json file, to create your api key, go to this link. This api key requires only repo:status priveleges (access to read commits from public repositories), you can set other privileges at your own risk. Please ensure you set no this token expiration date to "No expiration".
Owner - GitHub username of account that is the owner of the repository. In other words, if I created a repository called kopClient, then I would change my appsettings RepositoryName to kopClient and change Owner to champ.
This solution is written in C#, which consists of two projects:
PkodevUpdater project - WPF application with the GUI of the updater.
UpdaterLibrary - .NET core library which contains the main functionality of the updater.
This updater is free to use and was released for PkoDev.net specifically, therefore I kindly ask to not post this updater outside of PkoDev.net community.
To compile this project you need Visual Studio 2019 and above, as well as .NET 5.0 framework.
Please bear in mind there are a few things that could be improved and those were marked with TODO comments. For instance:
The method that updates client hash accepts a hash string param but the code does not check if that string is a valid hash.
When a file is deleted and the directory where this file was deleted from is empty, the launcher does not delete that directory or the corresponding parent directory.
Please let me know if you come across any issues or bugs. If you would like to contribute, then please fork the repository and create a PR.
The image used in the updater is a placeholder only and I strongly suggest that you do not use anything that belongs to King of Pirates without my consent.
Link to the repository: click me