champ 168 Report post Posted March 16, 2022 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 4 3 Quote Share this post Link to post Share on other sites
Ropedann 45 Report post Posted March 17, 2022 Классаная идея!) 1 Quote Share this post Link to post Share on other sites
champ 168 Report post Posted March 17, 2022 32 minutes ago, Ropedann said: Классаная идея!) Согласен с Вами. Не знаю, почему мне данная идея не пришла в голову, когда был свой сервер В любом случае, надеюсь, что кому-то пригодится. Quote Share this post Link to post Share on other sites
Ropedann 45 Report post Posted March 18, 2022 Да блин это гениально! =D Я писал лаунчер на основе идеии что клиент лежит на фтп сервере и есть софт который гененрирует хэш суммы для каждого файла и измененые файлы заносит в отдельный список после игрок уже получает список этих файлов и качает. а используя гит это все можно опустить) 19 часов назад, champ сказал: Согласен с Вами. Не знаю, почему мне данная идея не пришла в голову, когда был свой сервер В любом случае, надеюсь, что кому-то пригодится. Quote Share this post Link to post Share on other sites
farofa0 3 Report post Posted August 2, 2022 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? Quote Share this post Link to post Share on other sites
farofa0 3 Report post Posted August 5, 2022 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. 1 Quote Share this post Link to post Share on other sites
champ 168 Report post Posted August 17, 2022 On 8/5/2022 at 4:01 PM, farofa0 said: I fixed and improved it a little bit. I will make a pull request later. Thank you, what was the issue? Quote Share this post Link to post Share on other sites
farofa0 3 Report post Posted August 17, 2022 Sorry, I forgot about that. I just made the pull request. It's all explained there. 1 1 Quote Share this post Link to post Share on other sites
dragontechi 70 Report post Posted September 5, 2022 On 3/16/2022 at 5:05 PM, champ said: 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 { "Title": "Tales of Pirates Game Updater by PkoDev", "RepositoryName": "TechiGG", "ApiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Owner": "lastpirates", "ProductHeader": "pkodev-updater", "ClientCommitAt": "" } Operación Recompilar iniciada... 1>------ Operación Recompilar todo iniciada: proyecto: UpdaterLibrary, configuración: Release Any CPU ------ Se ha restaurado C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\UpdaterLibrary.csproj (en 10 ms). Se ha restaurado C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\PkodevUpdater\PkodevUpdater.csproj (en 60 ms). 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\OctokitGithubClientFactory.cs(17,30,17,48): warning CS8766: La nulabilidad de los tipos de referencia del tipo de valor devuelto de "GitHubClient? OctokitGithubClientFactory.CreateGitHubClient()" no coincide con el miembro "GitHubClient IOctokitGithubClientFactory.CreateGitHubClient()" implementado de forma implícita (posiblemente debido a los atributos de nulabilidad). 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\CommitFile.cs(5,23,5,27): warning CS8618: El elemento propiedad "Name" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\CommitFile.cs(7,23,7,26): warning CS8618: El elemento propiedad "Url" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\CommitFile.cs(9,23,9,29): warning CS8618: El elemento propiedad "Status" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(5,23,5,37): warning CS8618: El elemento propiedad "RepositoryName" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(7,23,7,29): warning CS8618: El elemento propiedad "ApiKey" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(9,23,9,28): warning CS8618: El elemento propiedad "Owner" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(11,23,11,28): warning CS8618: El elemento propiedad "Title" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(13,23,13,36): warning CS8618: El elemento propiedad "ProductHeader" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\Models\AppSettings.cs(15,23,15,37): warning CS8618: El elemento propiedad "ClientCommitAt" que no acepta valores NULL debe contener un valor distinto de NULL al salir del constructor. Considere la posibilidad de declarar el elemento propiedad como que admite un valor NULL. 1>UpdaterLibrary -> C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\UpdaterLibrary\bin\Release\netcoreapp3.1\UpdaterLibrary.dll 1>Compilación del proyecto "UpdaterLibrary.csproj" terminada. 2>------ Operación Recompilar todo iniciada: proyecto: PkodevUpdater, configuración: Release Any CPU ------ 2>C:\Users\el_me\OneDrive\Desktop\PkodevUpdater-main\PkodevUpdater-main\PkodevUpdater\forms\UpdaterWindow.xaml(62,108,62,140): error CS1061: "UpdaterWindow" no contiene una definición para "StartGameBtn_MouseLeftButtonDown" ni un método de extensión accesible "StartGameBtn_MouseLeftButtonDown" que acepte un primer argumento del tipo "UpdaterWindow" (¿falta alguna directiva using o una referencia de ensamblado?) 2>Compilación del proyecto "PkodevUpdater.csproj" terminada -- ERROR. ========== Recompilar todo: 1 correctos, 1 incorrectos, 0 omitidos ========== I get this error when compiling Quote Share this post Link to post Share on other sites
Graf 217 Report post Posted February 18, 2023 @dragontechi Hi. Add method for button StartGame. Example: private void StartGameBtn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MessageBox.Show("Start Game!"); } Quote Share this post Link to post Share on other sites
dragontechi 70 Report post Posted February 28, 2023 On 2/18/2023 at 1:52 PM, Graf said: @dragontechi Hi. Add method for button StartGame. Example: private void StartGameBtn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { MessageBox.Show("Start Game!"); } ok ty Quote Share this post Link to post Share on other sites
SolidusZA 3 Report post Posted June 29, 2023 @champ sorry to bother would you be able to walk me through this if possible? I have downloaded your files but am not sure where to edit or put them into my client files. I appreciate the assistance and such an amazing tool. Good Work! Quote Share this post Link to post Share on other sites
champ 168 Report post Posted June 29, 2023 Hi, if you’re unsure how to compile and/ or have no experience with C#, then I suggest you use a different launcher. There’s plenty available on the forum 1 Quote Share this post Link to post Share on other sites
SolidusZA 3 Report post Posted June 29, 2023 42 minutes ago, champ said: Hi, if you’re unsure how to compile and/ or have no experience with C#, then I suggest you use a different launcher. There’s plenty available on the forum Oh I have compiled it sir just not sure where to put the compiled file. Just into the client? Otherwise if you have any recommendations for a good launcher / updater I would appreciate it as I see you know this topic well. Quote Share this post Link to post Share on other sites
SolidusZA 3 Report post Posted June 29, 2023 After compiling there are alot of files in my debug folder. I see the launcher there and it runs fine. Just not sure what files I need to move across. If your available on discord for 5mins. I am more then happy to pay for your time. @champ Quote Share this post Link to post Share on other sites
Blanquitoh 50 Report post Posted July 28, 2023 (edited) Hello there. I am getting back to work with Tales of Pirates (as a hobby from now on). I am trying to collect the latest stuff related to Client & Server (but I want to work on them from the source code) since I lost the HD from my days. So, I was thinking on creating a client updater and website with clean architecture but let me tell you yours is fabulously coded with the quick view I took from it. I'll probably end up using yours, since as a plus your idea of using GitHub as the Client host is a great idea and better idea than most I have had back in my days and nowadays. Lowering the usage of any PVS resources. Edited* Didn't take a look at the PKO-Launcher (which has more appealing UI) yet since it clearly says, "Use at your own risk." and it'll take longer to understand that quote lol. Probably is just something related to ownership but i could use code in it. Thanks for it. I'll let you know if I can contribute to it or have any doubt. Edited July 28, 2023 by Blanquitoh Quote Share this post Link to post Share on other sites
champ 168 Report post Posted July 31, 2023 Hey @Blanquitoh, thank you. "Use at your own risk" referred to improper token configuration/ exposure. Code is clean. 1 Quote Share this post Link to post Share on other sites