[Emulator/C++] Emulating Darkorbit Classic [WIP]

10/06/2019 19:22 Exenu#1
Hi everyone,

I've been developing an emulator the classic version of DarkOrbit (before the new client) for around a month.

I won't bore you with the details on why I decided to emulate the classic version; so I will skip straight to the technical details of the emulator.

Note; Thread is still in progress and emulator is not released yet till main core gameplay is coded.

Source code:
[Only registered and activated users can see links. Click Here To Register...]
---------------------------------------------------------------

Technical Details

The Daemon Emulator is coded in C++17. Using the following libraries:
  • MYSQL C v5.6
  • Boost v6.6
  • OpenSSL v1.1
  • SFMT v1 (Customised)

Networking
- Using Boost ASIO with the capability of asynchronous operations.

Database
- Using MYSQL C - Using own wrapper class which supports synchronous/asynchronous queries.

Logger
- Using own Logger class which supports the standard logging configurations: INFO, WARNING, ERROR, VERBOSE, ASSERT.
- Logs to terminal console or/and file.
- Thread Safe.

Configuration File
- Using own configuration.
- Thread Safe

Thread Pooling
- Using own Thread Pooling class.
- Optimises existing running threads and their tasks; pushes/pops tasks to other threads depending on performance on said thread.
- Thread Pooling launches x amount of threads as default depending on your machine specifications (can be changed through configuration).
- Threads are split into types:
*Inclusive: Runs multiple tasks.
*Exclusive: Only runs one task.
*Critical: Launch new task on new thread ignoring hardware concurrency.

Design Flow
  • Maps:- Maps are separated into zones handled by a zone manager; zones can be multi-threaded for example; running 3 threads will designate 9 maps per zone - You can set this in the configuration option. Also maps are split into grids, each grid is independent and is dynamic (does not update if no there is no activity).
  • Packets:- Packets are split into three different stages: Player Thread, World Thread and Map Thread. This ensures thread safety, and off-loading the balance between the threads; for example a non-handled packet would be processed on player thread (first thread which comes in contact with the packet).
  • TOOD; More.
---------------------------------------------------------------

Progress

Strike = Completed.

Login into world
Movement System
Attacking System
Kill Credit
Surrounding Objects System
Interactive Events (Stations/Portals)
NPCS spawned in world
Cargo
Drones
Galaxy Gates
Team Death Match
SpaceBall

and more which will be added soon.

---------------------------------------------------------------

ScreenShots

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Any questions do not hesitate to ask!
10/07/2019 18:50 Destiny#2
Hey nice to see someone work on old client server i have one too in c++ not mine mybe u want work together i did old site 2009 i think u will like it xd

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
10/07/2019 21:19 notEmpty#3
[Only registered and activated users can see links. Click Here To Register...]
10/08/2019 13:53 MuffinMario#4
Nice work! Though developing a server in <current year> in C++ is making things pretty much more difficult than they should be.
Can I ask what you need OpenSSL for? This version does not use any encryption to transfer packets, etc..

If you want to compare your work to mind, feel free to check [Only registered and activated users can see links. Click Here To Register...] which I've been spending some time on for 2 years now :)
10/08/2019 16:42 gyula359#5
Quote:
Originally Posted by MuffinMario View Post
Nice work! Though developing a server in <current year> in C++ is making things pretty much more difficult than they should be.
Can I ask what you need OpenSSL for? This version does not use any encryption to transfer packets, etc..

If you want to compare your work to mind, feel free to check [Only registered and activated users can see links. Click Here To Register...] which I've been spending some time on for 2 years now :)
[Only registered and activated users can see links. Click Here To Register...] is requesting your username and password. The site says: “Your authorization required message.”
username/password???????????
10/08/2019 20:12 Exenu#6
Quote:
Originally Posted by MuffinMario View Post
Nice work! Though developing a server in <current year> in C++ is making things pretty much more difficult than they should be.
Can I ask what you need OpenSSL for? This version does not use any encryption to transfer packets, etc..

If you want to compare your work to mind, feel free to check [Only registered and activated users can see links. Click Here To Register...] which I've been spending some time on for 2 years now :)
I will take a look at your source, thank you for sharing!

I work with C++ on a daily-basis; it feels more natural for me to code in other than C# etc...

OpenSSL is apart of my server-side core by default - I also emulate other games using the same core.
10/11/2019 15:38 gyula359#7
Quote:
Originally Posted by Exenu View Post
I will take a look at your source, thank you for sharing!

I work with C++ on a daily-basis; it feels more natural for me to code in other than C# etc...

OpenSSL is apart of my server-side core by default - I also emulate other games using the same core.
A(z) [Only registered and activated users can see links. Click Here To Register...] felhasználónevet és jelszót kér. A webhely üzenete: „Your authorization required message.”
You are prompted to [Only registered and activated users can see links. Click Here To Register...] for username and password. This site's message is: "Your authorization required message."
what is your username and password?
10/15/2019 18:06 Requi#8
[Only registered and activated users can see links. Click Here To Register...]

Isn't this a fat memory leak or am I missing something? Please do everyone a favor and use smart pointers.

[Only registered and activated users can see links. Click Here To Register...]
Why not just use an std::mutex + std::unique_lock?
10/16/2019 08:32 Exenu#9
Quote:
Originally Posted by Requi View Post
[Only registered and activated users can see links. Click Here To Register...]

Isn't this a fat memory leak or am I missing something? Please do everyone a favor and use smart pointers.

[Only registered and activated users can see links. Click Here To Register...]
Why not just use an std::mutex + std::unique_lock?
Hi, the pointer is deleted at:
[Only registered and activated users can see links. Click Here To Register...]

There's no reason to use smart pointers in this case, as I know where I want it to be deleted. Using smart pointers would be using extra overhead for nothing, and performance is important when the function is the main entry point.

EDIT; I've misread your question. Yes that is a memory leak. Feel free to make a pull request.

The lockable class is preference, although I do not use it in most cases.
10/16/2019 14:38 Requi#10
Quote:
Originally Posted by Exenu View Post
Hi, the pointer is deleted at:
[Only registered and activated users can see links. Click Here To Register...]

There's no reason to use smart pointers in this case, as I know where I want it to be deleted. Using smart pointers would be using extra overhead for nothing, and performance is important when the function is the main entry point.

EDIT; I've misread your question. Yes that is a memory leak. Feel free to make a pull request.

The lockable class is preference, although I do not use it in most cases.
Using an std::unique_ptr and moving it through the functions would be basically no overhead or am I wrong?
10/16/2019 18:19 Exenu#11
Quote:
Originally Posted by Requi View Post
Using an std::unique_ptr and moving it through the functions would be basically no overhead or am I wrong?
There is no overhead when you're moving the ptr. How-ever there is overhead at allocation. In my opinion, if you're using unique_ptr and then just moving it across function to function - you're using it wrong.

I only use smart pointers when I don't care when the pointer will be deleted.

I think it's better to use malloc when it comes down to packet handling, as performance is crucial to ensure smooth gameplay.
10/23/2019 23:17 ThisSoniyo#12
If there were a few developers who would be willing to code everything necessary to get this into a working server to be released(Good example is linkpads old server he used to have) then i would be willing to put forth the money and hosting to actually get it up. I am a diehard fan of this classic version.
10/24/2019 00:51 Destiny#13
Dont forget contact me when u need 2009 cms header is no longer flash one xd:P
10/24/2019 11:41 Requi#14
Quote:
Originally Posted by ThisSoniyo View Post
If there were a few developers who would be willing to code everything necessary to get this into a working server to be released(Good example is linkpads old server he used to have) then i would be willing to put forth the money and hosting to actually get it up. I am a diehard fan of this classic version.
Get me some motivation and I'll put up a server. You wouldn't even need to pay, because I already have multiple servers.
10/24/2019 20:44 Exenu#15
Quote:
Originally Posted by ThisSoniyo View Post
If there were a few developers who would be willing to code everything necessary to get this into a working server to be released(Good example is linkpads old server he used to have) then i would be willing to put forth the money and hosting to actually get it up. I am a diehard fan of this classic version.
It would help me a lot if we can get someone to build a CMS for the server. There are a few parts which prevents me from implementing without a cms.