Jump to content
Sign in to follow this  
champ

GitHub Based Game Client Updater

Recommended Posts

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:

  1. RepositoryName - set this to the name of your public repository containing your game client.
  2. 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".
  3. 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:

  1. PkodevUpdater project - WPF application with the GUI of the updater.
  2. UpdaterLibrary - .NET core library which contains the main functionality of the updater.

 

Capture1.PNG

 

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.

 

Capture.PNG

 

 

Please bear in mind there are a few things that could be improved and those were marked with TODO comments. For instance:

  1. The method that updates client hash accepts a hash string param but the code does not check if that string is a valid hash.
  2. 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

  • Like 3
  • Thanks 3

Share this post


Link to post
Share on other sites
32 minutes ago, Ropedann said:

Классаная идея!)

Согласен с Вами. Не знаю, почему мне данная идея не пришла в голову, когда был свой сервер 🤷‍♂️ В любом случае, надеюсь, что кому-то пригодится.

Share this post


Link to post
Share on other sites

Да блин это гениально! =D Я писал лаунчер на основе идеии что клиент лежит на фтп сервере и есть софт который гененрирует хэш суммы для каждого файла и измененые файлы заносит в отдельный список после игрок уже получает список этих файлов и качает. а используя гит это все можно опустить)

 

19 часов назад, champ сказал:

Согласен с Вами. Не знаю, почему мне данная идея не пришла в голову, когда был свой сервер 🤷‍♂️ В любом случае, надеюсь, что кому-то пригодится.

 

Share this post


Link to post
Share on other sites

I loved the idea.

However, I tried to put 5 plain text files inside a folder to do a test. The program creates the folder and sometimes downloads one file or another, but never all of them.

Could you tell me what I'm doing wrong?

Share this post


Link to post
Share on other sites
On 8/2/2022 at 4:24 PM, farofa0 said:

I loved the idea.

However, I tried to put 5 plain text files inside a folder to do a test. The program creates the folder and sometimes downloads one file or another, but never all of them.

Could you tell me what I'm doing wrong?

I fixed and improved it a little bit. I will make a pull request later.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...