Jump to content
Sign in to follow this  
Jonathan

[Guide] How to force users to update clients (using your launcher/patch)

Recommended Posts

[Guide] How to force users to update clients (using your launcher or patch)

 

Hey all. I have seen a number of servers simply change the startgame launch command in an effort to combat people simply using a startgame.bat file, but this is not an effective measure to ensure they will actually update their client. This is a very quick, simple guide on how to force users to update their clients using your launcher or patch.

 

The official method to check for a version difference happens courtesy of the GateServer upon login. If the version check fails, the user is given the following prompt to update their client:

 

OcVuUIJ.png

 

 

Configuring the launcher and patch link

1. Update the game's launcher

Spoiler

In order to change which launcher is used when the user clicks 'Confirm', we must modify what is set in Game.exe. In Game.exe the launcher to use is set at address 0x200F3C; the seven bytes at this address determine which launcher to use.

 

spacer.png

 

As you can see, the default value is kop.exe; you can also see that there is no space to use a launcher that is longer than 7 characters! Change this value to the name of your launcher; the launcher itself must be placed in the game's root directory. You can change the value using your favourite hex editor, or I have made a tool to help you change it simply available here (https://github.com/jmkimbs/pko-launcher-editor). To use the provided tool, just clone the repository and use make run (on a system with bash, g++, and gnu make) and then follow the instructions. e.g. to change the launcher to kop.bat:

 

spacer.png

 

This will mean that when the user presses 'Confirm' in the version mismatch dialogue above, the launcher 'kop.bat' will be run from within the game's root directory.

 

spacer.png

 

Although I have used the example 'kop.bat', you can set the launcher to any (up to 7 character) value you want to.

 

 

2. Update the game's patch link

Spoiler

Changing the launcher that opens when the user clicks 'Cancel' is very simple. You simply go into the client's root/scripts folder, and modify 'kop.cfg'. The 'HTTP' key in the '[Version]' section is what corresponds to the patch link. Important note: use backslashes (\) instead of forward slashes (/) in the URL you choose! Otherwise the game cannot determine which part is a comment and which part is not. e.g. if I were to change the patch link from the default to https://www.google.com/:

 

(before)

vyxTicv.png

 

(after)

O1rNoMS.png

 

This will mean that when the user presses 'Cancel' in the version mismatch dialogue above, the link https://www.google.com/ will open in the user's default browser.

 

 

Causing the version mismatch

3. Update the game's version

Spoiler

In order to change the game's version, we must modify what is set in Game.exe. In Game.exe the version is set at address 0x24DA50; the four bytes at this address determine the game's version.

 

TAiR86x.png

 

Note that there is no decimal point, and it is just a straight integer conversion; the value is currently 136 which typically corresponds to version 1.36. Change this value to your new version (without the decimal point). You can change the value using your favourite hex editor, by using V3ct0r's Game.exe Info tool, or I have made a tool to help you change it simply available here (https://github.com/jmkimbs/pko-launcher-editor).

 

To use V3ct0r's tool, refer to the relevant thread:

 

To use the tool I provided, just clone the repository and use make run (on a system with bash, g++, and gnu make) and then follow the instructions. e.g. to change the version to 1.46:

 

xJH7Ktt.png

 

This means that, as far as the client and server are now concerned, the client's version is 1.46, and the client will not be able to login to any server that is not version 1.46.

 

 

4. Update the server version

chanasdasd

Spoiler

Changing the server version is another very simply task. In the servers GateServer configuration file, the 'Version' key in the '[Main]' section corresponds to the game's version. e.g. if I were to change the server version from 1.36 to 1.46:

 

(before)

bCTIsWJ.png

 

(after)

IoFHVAy.png

 

This means that, as far as the server and any connecting clients are now concerned, the server's version is 1.46, and any client that is not version 1.46 will not be able to login.

 

Now, any time you release a new patch just add an updated Game.exe to the patch with the new server version. Then, before launching the server, update the server version. Any client that has not updated will not be able to log in, and will be redirected to the relevant location in order to update their client!

 

Feel free to ask any questions, or to add any notes you think might be useful. Thanks for reading!

  • Like 2
  • Thanks 1

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...