Skip to content

Custom Client

Djgaven588 edited this page Feb 17, 2019 · 3 revisions

Note: This is incomplete and missing things which are important, for instance: The header which indicates how long of a message (in bytes) that you should be looking for. Reading over the examples will help you in figuring this out.

Want to make your own custom client? You have come to the right place. Here you will find what you need to do to make a client that works with all servers. Let's get started!

First, you will need to be able to create a TCP connection in order to make a client. Almost any programming language will have the ability to do so, so pick whichever one supports it that you are comfortable with.

Now that you have picked your programming language, here is what happens, and how you need to handle it. It is highly recommended that all data is treated as UTF8 text, as this is what servers send data as.

  1. Connecting - The first thing your client should do, is connect to the server.

  2. Password Status - The server will send you a message after you connect which will tell you if you need to send a blank message, or a password. If the response has a length greater than 0 (or is "passwordProtected"), you will need to send a message containing the password. Otherwise, you will need to send a message that is empty ("").

  3. Password Valid - You will only do this if the server has a password enabled. If the message is "V", your password was valid, and you can continue. Otherwise, the message is from the server and will contain some information. You can try again.

  4. Nickname - After you get passed password validation, you will be requested to send a nickname. The server will send you a message prompting you to do this after your password is validated which can contain some information. You will need to supply a nickname according to the servers rules which will be provided in the nickname request.

  5. Nickname Valid - After sending a nickname, it will be checked by the server for specific conditions, and if valid, will be set and will send you a message. If the message is "V", your nickname was accepted. Otherwise, you will receive information regarding why it may be invalid. You can try again.

  6. Connection Established - Your client is now connected, and will now receive messages that other clients are sending.

That is it! Now you have your own custom client. As the maintainer of your client, you should make sure to check back here often for changes. Future changes include RSA and AES encrpytion for more secure communication.

Clone this wiki locally