Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] [C#] MapleLauncher - Custom Launcher

Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
MapleLauncher

Fraysa - [Release] [C#] MapleLauncher - Custom Launcher - RaGEZONE Forums



So after looking at this thread by @PerfectEnding, I decided to make this little application. It's a custom launcher (you can design it however you want) that connects to your server and once connected, sends a custom packet that contains the hash checksum of the users' .WZ files, so custom-edited .WZ server owners can check if the users have the required files before logging into the game. If they do not, you can simply disconnect the client!

How To Setup

1. Clone the Git repository to a local folder on your machine.
2. Open the project using Visual Studio 2013 or 2015.
3. Add a reference to .
4. Edit Program.cs to your liking. Here's a list of the values to know about:

  • Name: The name of your server. This will show up in some places
  • IP: The IP Address of your server to connect to.
  • Port: The Port of your server to connect to.
  • ServerIP: The operation code of the ServerIP packet. That's usualy 0x000B, so you don't have to modify this.
  • MaskIP: Should the program mask the IP Address? In case you have a localhost that connects to 127.0.0.1, you can leave this disabled.
  • MaskedIP: The IP Address to mask. That's mostly for higher-version servers, where the client connects to Neckson's servers.
  • ClientName: The name of the client (localhost.exe, MapleStory.exe, etcetera).
  • Website: The link to your website (used for the tray icon).
  • Forums: The link to your forums (used for the tray icon).
  • ConfigName: The path to the configuration file (config.json as default).
  • UseMapleEncryption: Should the launcher encrypt data with the MapleStory custom encryption? (False for higher versions, true for lower).
5. Edit the frmMain's design to your liking.
6. Build the application.
7. ???
8. PROFIT!

How To Calculate Hash?

Included in the solution is an application called "CalculateHash" which will return the calculated hash checksum of a file. Simply drag the .wz file on it and it will display it's hash checksum!

Handling The Packet

Handling the custom packet is quite easy. Here's a small example to help you get started!
(Sorry for my rusty Java skills):

Code:
case WZ_CHECKSUM:
    Map<String, String> wzFiles = new Map<String, String>();
    wzFiles.put("Base", "1");
    wzFiles.put("Character", "2");
    wzFiles.put("Effect", "3");
    wzFiles.put("Etc", "4");
    wzFiles.put("Item", "5");
    wzFiles.put("Map", "6");
    wzFiles.put("Mob", "7");
    wzFiles.put("Morph", "8");
    wzFiles.put("Npc", "9");
    wzFiles.put("Quest", "10");
    wzFiles.put("Reactor", "11");
    wzFiles.put("Skill", "12");
    wzFiles.put("Sound", "13");
    wzFiles.put("String", "14");
    wzFiles.put("TamingMob", "15");
    wzFiles.put("UI", "16");
    };


    while (slea.Available() >= 0) {
        String name = slea.readMapleString();
        String hash = slea.readMapleString();


        String computedHash = map.get(name);


        if (hash != computedHash) {
            c.disconnect();


            break;
        }
    }
    
    break;

Thanks to @Diamondo25 for MapleKeys & Session class.
 
Last edited:
Junior Spellweaver
Joined
Apr 20, 2013
Messages
103
Reaction score
24
Everything good and all, but why didnt you use NuGet for Newtonsoft.Json ?
And I assume you had your reasons not to use the default ?
 
Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Everything good and all, but why didnt you use NuGet for Newtonsoft.Json ?
And I assume you had your reasons not to use the default ?

I did use NuGet, but the .gitignore file ignores it for some reason. If you know how to mess with it, create a pull request and I'll gladly merge it.

As for the Json serialization, my emulator uses this class (JsonUtilities) with several more methods in it, but I only included these two. I was too lazy and just imported the file.
 
Junior Spellweaver
Joined
Apr 20, 2013
Messages
103
Reaction score
24
I did use NuGet, but the .gitignore file ignores it for some reason. If you know how to mess with it, create a pull request and I'll gladly merge it.



I enabled NuGet auto-restore for you.
You can do this by right clicking the solution btw.

And I think something went wrong with your gitignore? there were quite a lot of junk files.
 
Junior Spellweaver
Joined
Apr 20, 2013
Messages
103
Reaction score
24
This .gitignore is automatically generated by GitHub.

Normally I let my Visual Studio create the repo, this also creates a proper gitignore.
Though I do sync everything with Github for Windows / Mac.
 
Experienced Elementalist
Joined
Nov 21, 2008
Messages
297
Reaction score
38
Hello Fraysa,
Firstly I would like to personally thank you for releasing this launcher to Ragezone.
I tried to create a similar project myself behind the scene some time ago by modifying another launcher's source, and as I am simply not experienced enough in writing .net applications, I scrapped it.. Your launcher could help me out greatly, I really appreciate the efford and this thread.. :adore:


Where should one reference this case?
Thank you in advance.
PHP:
WZ_CHECKSUM
 
Last edited:
Junior Spellweaver
Joined
Apr 18, 2008
Messages
108
Reaction score
46
Where should one reference this case? PlayerLoggedinHandler.java? Does this belong in it's own class?
Thank you in advance.

You should make a new handler in net.channel.handler (or your similar package). Don't forget to register the handler in PacketProcessor when you receive the appropriate Op Code.

Also, in Fraya's example, note that the 1, 2, 3, 4, etc. (for the wzFiles.put argument) should be the hash for that wz file.
 
Experienced Elementalist
Joined
Sep 8, 2012
Messages
260
Reaction score
6
I've installed Visual Studio 2015 so I could play around with your launcher,
as soon as I tried building it VS crashed and now it just keeps on restarting itself everytime I try building it.
Are you familiar with this issue? Do you know how to fix it?

I have another small question I hope you don't mind, incase I can get the launcher to work, how do I make sure that the players actually enter the game from the launcher that checks their WZs and not from the original client?
Would I need to check it from the source, something like -> if the WZ_CHECKSUM packet wasn't sent then close the connection with the session?

Thank you for your time!
 
Junior Spellweaver
Joined
Apr 18, 2008
Messages
108
Reaction score
46
I've installed Visual Studio 2015 so I could play around with your launcher,
as soon as I tried building it VS crashed and now it just keeps on restarting itself everytime I try building it.
Are you familiar with this issue? Do you know how to fix it?

I have another small question I hope you don't mind, incase I can get the launcher to work, how do I make sure that the players actually enter the game from the launcher that checks their WZs and not from the original client?
Would I need to check it from the source, something like -> if the WZ_CHECKSUM packet wasn't sent then close the connection with the session?

Thank you for your time!
Pretty much, yeah. You could have MapleClient store a variable such as "bool authenticated = false", and when the instance is created start a timer for a certain amount of time. When you handle the packet, set authenticated to true... If the packet is never received and the timer goes off, disconnect the client.

However, note that a new client connection is created when connecting to the channelserver as well as the loginserver, so you have to add some kind of check to make sure this only happens when you first launch. It's up to you to figure that out. :)
 
Experienced Elementalist
Joined
Sep 8, 2012
Messages
260
Reaction score
6
Pretty much, yeah. You could have MapleClient store a variable such as "bool authenticated = false", and when the instance is created start a timer for a certain amount of time. When you handle the packet, set authenticated to true... If the packet is never received and the timer goes off, disconnect the client.

However, note that a new client connection is created when connecting to the channelserver as well as the loginserver, so you have to add some kind of check to make sure this only happens when you first launch. It's up to you to figure that out. :)

Alright thanks, do you happen to know what's that "config.json" file the launcher is creating? All it contains is "null".
 
Experienced Elementalist
Joined
Sep 8, 2012
Messages
260
Reaction score
6
Thanks I set up the configuration file!

I'm assuming it was not meant to be running from the maplestory folder since it only runs fine when outside of the maplestory folder.
If it's in im getting this:
Fraysa - [Release] [C#] MapleLauncher - Custom Launcher - RaGEZONE Forums
 
Elite Diviner
Joined
Mar 24, 2015
Messages
426
Reaction score
416
First off, thanks for this great release! Unfortunately I also have to spam this thread with my problems: When I try to run the launcher, it get an error message (roughly translated from german) "Could not access the socket because of the socket's access privileges.". Does anyone know why this happens? Did I mess up the configuration? I tried to follow the guide exactly.
 
Junior Spellweaver
Joined
Apr 20, 2013
Messages
103
Reaction score
24
First off, thanks for this great release! Unfortunately I also have to spam this thread with my problems: When I try to run the launcher, it get an error message (roughly translated from german) "Could not access the socket because of the socket's access privileges.". Does anyone know why this happens? Did I mess up the configuration? I tried to follow the guide exactly.

Do you happen to run your server on the same machine? that might be a problem.
 
Junior Spellweaver
Joined
Apr 20, 2013
Messages
103
Reaction score
24
Thanks for the answer, I do. If that causes problems then I guess its why it didn't work.

Your server will reserve localhost:8484, the redirector will also try to use port 8484.
You simply cannot listen on the same port twice, thats just how it works.
 
Experienced Elementalist
Joined
Sep 8, 2012
Messages
260
Reaction score
6
How would one read the packet the launcher sends?
Does it have a header?
When is it being sent, where could I make it show up on the bat so I could analyze it?
 
Elite Diviner
Joined
Mar 24, 2015
Messages
426
Reaction score
416
How would one read the packet the launcher sends?
Does it have a header?
When is it being sent, where could I make it show up on the bat so I could analyze it?

It's all explained in the github description, that's why minike linked it in his reply earlier.
 
Back
Top