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!

Creating a Server Emulator from Scratch

Initiate Mage
Joined
Nov 20, 2022
Messages
1
Reaction score
0
Dear members, have a nice day. What programming languages should be learned to create a server emulator? Besides that, how to create a server emulator from scratch? Is there anyone who can describe this in detail? Or is there a guide that has been prepared on this topic before? I would be very grateful if knowledgeable people write answers about this. In addition, what sources can a person who has no knowledge of reverse engineering learn about this in the simplest way? In short, is there anyone who can tell me everything I need to know about the server emulator without getting bored?
 
Shh, quiet, you might piss somebody off
Developer
Joined
Dec 23, 2011
Messages
1,797
Reaction score
2,162
Most emulators i have seen around ragezone was done with Java, C# or python, i know there's c++ emulators but they are less common.

i start a java emulator of piercing blow years ago based in an another Java source code of point blank, rewriting from scratch adding my knowledge into, in the end i learn what i need to make it work properly.

i was really close from function ingame with the emulator but zepetto decided to change the entire game logic to works more like point blank and not like a new game, so i stop and shared code here in ragezone in point blank area.



i think a good start is writing from zero, a chat app, with a client and server, with packets to authenticate, send messages, receive messages from other people, change name on chat and logout, is a very simple app but a good start writing softwares with sockets, packets etc...
 
Last edited:
Banned
Banned
Joined
Sep 19, 2022
Messages
8
Reaction score
0
Most emulators i have seen around ragezone was done with Java, C# or python, i know there's c++ emulators but they are less common.

i start a java emulator of piercing blow years ago based in an another Java source code of point blank, rewriting from scratch adding my knowledge into, in the end i learn what i need to make it work properly.

i was really close from function ingame with the emulator but zepetto decided to change the entire game logic to works more like point blank and not like a new game, so i stop and shared code here in ragezone in point blank area.



The question of how to define philosophy is indeed a challenging one, and it is one that has been debated by philosophers for centuries. If there are problems with displaying their worldview, then you can contact. They tell you philosophy essay writing service the sketch by John Cleese and Jonathan Miller suggests, philosophers engage in a wide-ranging and often abstract discussion of topics that can seem obscure or even nonsensical to outsiders

But the C+ ones are better than the ones I found!
 
Last edited:
Joined
Oct 8, 2006
Messages
740
Reaction score
289
Dear members, have a nice day. What programming languages should be learned to create a server emulator? Besides that, how to create a server emulator from scratch? Is there anyone who can describe this in detail? Or is there a guide that has been prepared on this topic before? I would be very grateful if knowledgeable people write answers about this. In addition, what sources can a person who has no knowledge of reverse engineering learn about this in the simplest way? In short, is there anyone who can tell me everything I need to know about the server emulator without getting bored?
If there was a simpler way to make a server emulator without any knowledge of this, it would have been posted long time ago.

The answer for the question "Is there an easier way to do an emulator from scratch?": No, it isn't. You can't make a server emulator without understanding how the client works and what the client needs (internally) in order to send the correct data which the client is requesting from the server.
There is no guide to do that because everything you are trying to emulate is totally different from game to game, from application to application, like different encryption methods, different packet forms, unique things which are required by the client.

The first big step is to study the client files. If you can connect the client to an existing server, then you can sniff out packets sent back and forth and study them, document and puzzle everything up to get small parts which you will use later in your emulator.
The programming language doesn't really matter. There's no "best programming language" for an emulator. You can do that in Python, C++, Java, C#, Rust, NodeJS, etc. What matters is understanding how the client is working. Use debuggers to check the internal functions. (IDA Pro). The best way to do this is by trial and error. You need to think at this like if you are having a car and you wanna disassemble it and built it again using the same parts. In this case, the debugger would do that, but you have to document where each part will be and how it's working.
 
Newbie Spellweaver
Joined
Nov 7, 2021
Messages
8
Reaction score
4
For example, I have already disassembled the client a little, I can already make a switch using the opcode. but I still don’t understand the structure of the project itself. how to lay out a large amount of data, classes, structures. what should I read on this topic? I can’t wrap my head around examples with notebooks))
 
Joined
Oct 8, 2006
Messages
740
Reaction score
289
There's a reason why there's a HUGE team behind any game project or reverse engineering project xD

A huge amount of data is always stored in a database, and it doesn't really matter what kind of database it is as long you are making the correct relationship between them. (RDBMS - MySQL, SQL Server, etc). When you are thinking about getting and setting the data, you must think of how the relation between object is (what objects are related and constraint by other object).

Data => Database, as always (MySQL, SQL Server, etc.).
Classes, structures: Objects like Account, Character, Guild, Party.
What you need in those classes and structures? Answer is attributes, like specific things associated with that class. (Car => wheels, brand, model, color, engine, etc).

A fast example of classes in C++ that I've made:

C++:
class Account
{
    string username;
    string password; // Hashed/encrypted
    std::list<Character*> character_list; // List of characters associated with this accounts
    ...
    // Everything related to account can go in here.
}

class Items
{
    int item_unique_id;
    string item_name;
    int inv_posX;
    int inv_posY;
    int sizeX;
    int sizeY;
    bool accountBound;
    bool characterBound;
    int damage;
    int defence;
    int magic_damage;
    int magic_defense;
    int critical_dmg;
    int magic_critical_dmg;
    int accuracy;
    int reqStr;
    int reqDex;
    int reqVit;
    int reqInt;
    ...
    // The list can go on.
}

class Inventory
{
    std::list<Items*> inventory_items;
    ...
    //Other methods to get the items, search for them, add, delete, etc.
}

class Character
{
    int character_id;
    string character_name;
    Inventory * character_inventory;
    ...
    //Everything related to character is here.
}

Now, related to Opcodes and packets:
First, you need to receive the packets and make sure you are decrypting them correctly, also make sure you are encrypting them correctly before sending them to the client.
Most of the things can be solved using OOP (Object Oriented Programming - my suggestion is to learn it if you don't know it - learning while doing the project is the best learning method which is gonna give you faster results) which is making the life much much much more easier when developing a server emulator.

C++:
struct Packet
{
    byte    *head; // opcode
    byte    *data; // packet data
    u16        size; // the size of packet sent by client (not the one received in the socket)
    ...
    // Any packet related methods in this structure
}

The game logic is based on what you know about the game + your findings in your reverse engineering process + intuitive actions in the client.
You need to make a function for each one of the opcode (the game logic), then you upgrade them as you go with what you need to complete the game logic functionality.

The first opcodes probably are for login:
Recv login packet -> Decrypt it -> Get the opcode and handle it -> Pass the Packet object as parameter for the login function (Login(&Packet)) -> Retrieve from the DB the username and password or the data necessarily to be checked on login -> Check the data retrieved from DB with the data from the packet to be correct -> If the data is correct send a new packet to the client telling that the login was successful and the client can continue, then the next packet will be send from the client, and this process repeats.

This is just a small portion of what I can actually write about this subject, but I will stop here cause I think you can get the idea from these examples.

My advice is to learn OOP. It's gonna be helpful. Don't hurry with anything. Take your time and make your best architecture and design by observing what you find in the reversed client. Just write down how things should follow one another in the game logic and document anything you find.
 
Newbie Spellweaver
Joined
Nov 7, 2021
Messages
8
Reaction score
4
1697917791960 - Creating a Server Emulator from Scratch - RaGEZONE Forums
1697917815120 - Creating a Server Emulator from Scratch - RaGEZONE Forums

I’m not sure about the correctness of what’s happening, there’s still a lot to learn))
 

Attachments

You must be registered for see attachments list
Joined
Oct 8, 2006
Messages
740
Reaction score
289
Yeah, there's a lot to do and it's a huge amount of work, but don't hurry, just take it step by step, packet by packet. Try to think as what you need to code to get the correct game logic, what the client needs and what the client sends. Most of the work is to interpret what the client wants from the server. You can disassemble the client's functions to understand the data flow and what is doing with your data sent by the server, and probably this is the correct way to understand what's happening and the correctness of what you are coding.
 
Initiate Mage
Joined
Nov 30, 2023
Messages
3
Reaction score
1
I always wanted to understand how this kind of reverse network engineering works, and this post gave me a lot of good advice. Thank you all.

I will get some kind of simple server, like a Transformice server, to get its internal process and things like that.
 
Initiate Mage
Joined
Dec 6, 2023
Messages
2
Reaction score
0
Most emulators i have seen around ragezone was done with Java, C# or python, i know there's c++ emulators but they are less common.

i start a java emulator of piercing blow years ago based in an another Java source code of point blank, rewriting from scratch adding my knowledge into, in the end i learn what i need to make it work properly.

i was really close from function ingame with the emulator but zepetto decided to change the entire game logic to works more like point blank and not like a new game, so i stop and shared code here in ragezone in point blank area.



i think a good start is writing from zero, a chat app, with a client and server, with packets to authenticate, send messages, receive messages from other people, change name on chat and logout, is a very simple app but a good start writing softwares with sockets, packets etc...Exploring resources like might provide additional insights into the expanding world of NFTs and their potential applications within the realm of software development.

Adapting to such changes in game logic, especially when it aligns more with another game like Point Blank, can be a significant setback.
 
Last edited:
Back
Top