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!

Kepler - v21 Emulator [Java, MariaDB, Netty]

Status
Not open for further replies.
Skilled Illusionist
Joined
Feb 25, 2009
Messages
343
Reaction score
114
Re: Kepler - v21 Emulator [C11, SQLite, libuv]

Moved to Java a few days ago, got extremely tired debugging undefined behaviour just for a Habbo server, and the slightest issue could cause the server to crash, it's not worth it in my opinion when I want to spend time adding features instead. The problems were to do with concurrency, where tasks would just stop and GDB/Valgrind would show an error but these errors were not easy to track to their original cause.

And I moved to MariaDB (same compability as MySQL) because this is more suited for this type of projects. I should've listened to the earlier posts complaining about me using SQLite, but I also chose it because the MySQL C library was atrocious and I couldn't get it to work. I was originally intending to use MySQL at the time.

I vastly underestimated the task on C, especially when it came to concurrency which is my biggest weakness. The Kepler C version was my first biggest attempt which I wasn't prepared for, but in the long run I believe the Java version will pay off.

The good news is that I'm more than half way towards being feature on-par with the Kepler C version, packet registers vs on the C version. I was able to add far more features in a shorter about of time in the Java version than the C version :p:

You can view the C code in the 'legacy' branch, here:
Hey ! This is the best choice :)

You make à great work and in few Day, i will show you a project (Who can help you !) :D
 
Last edited by a moderator:
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: Kepler - v21 Emulator [C11, SQLite, libuv]

I still wish you goodluck with it even though my excitement died a bit. Besides the oldskool part it's just going to be another standard Java server (at least, that's how it'd feel to me), only difference is the oldskool part.

Don't blame you for your choice, but it's just sad. Still, I wish you goodluck and hope you can make something nice!
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: Kepler - v21 Emulator [C11, SQLite, libuv]

I still wish you goodluck with it even though my excitement died a bit. Besides the oldskool part it's just going to be another standard Java server (at least, that's how it'd feel to me), only difference is the oldskool part.

Don't blame you for your choice, but it's just sad. Still, I wish you goodluck and hope you can make something nice!

I understand how you feel and that's completely fine. It just got incredibly tedious with debugging all the time and that's not something I'd like to be doing (unless I get paid for it :p: ). I definitely underestimated the amount of work required to get Kepler in a crash-free state when I initially chose C.



Idk use CLion, how Can I add a lib in CMake?

The project is in Java now, you should be able to import it into IntelliJ or the IDE of your choice as a Gradle project and it will automatically find the libraries required.
 
Last edited:
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: Kepler - v21 Emulator [C11, SQLite, libuv]

I understand how you feel and that's completely fine. It just got incredibly tedious with debugging all the time and that's not something I'd like to be doing (unless I get paid for it :p: ). I definitely underestimated the amount of work required to get Kepler in a crash-free state when I initially chose C.

It's okay. I'm not blaming you and still it's oldskool and no good servers has been made for oldskool. Or at least no finished ones.
Cannot wait for the updates to come in waves :)
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Updates

The Java development is going along super nicely, it's like 2-3 features away from being on par with the C version, and it's a lot more bug-free!

- Added: :givedrink command.
- Added: :sit command.
- Added: Roller animation (you know, when the conveyor belt moves).
- Added: AFK/idle timer like how Habbo does it, after 5 minutes idle, your character sleeps, and after the next 10 minutes your character will be kicked from the room (15 minutes total).
- Added: Walkways between public rooms, Habbo Lido to the diving deck, Lower Hallways, etc.
- Added: Furniture interaction, toggle items on/off, etc.
- Added: Post-It/Sticky handling.
- Added: Vending machine support in both public rooms and user flats (private rooms).
- Added: When writing "o/" your character will wave.

- Modified: LOOKTO so it supports head rotation when users are sitting.
- Modified: Room manager caching system so it only caches rooms that have users inside.

- Fixed: Slide-rollback bug where a user would walk off the roller, but the next cycle would slide you back.
- Fixed: Users with rank 1 couldn't create rooms due to a broken fuseright check.

Pictures

Here's a little gif demonstrating the sitting and giving drink, etc!

Quackster - Kepler - v21 Emulator [Java, MariaDB, Netty] - RaGEZONE Forums
 
Initiate Mage
Joined
Jul 2, 2016
Messages
98
Reaction score
40
Updates

The Java development is going along super nicely, it's like 2-3 features away from being on par with the C version, and it's a lot more bug-free!

- Added: :givedrink command.
- Added: :sit command.
- Added: Roller animation (you know, when the conveyor belt moves).
- Added: AFK/idle timer like how Habbo does it, after 5 minutes idle, your character sleeps, and after the next 10 minutes your character will be kicked from the room (15 minutes total).
- Added: Walkways between public rooms, Habbo Lido to the diving deck, Lower Hallways, etc.
- Added: Furniture interaction, toggle items on/off, etc.
- Added: Post-It/Sticky handling.
- Added: Vending machine support in both public rooms and user flats (private rooms).
- Added: When writing "o/" your character will wave.

- Modified: LOOKTO so it supports head rotation when users are sitting.
- Modified: Room manager caching system so it only caches rooms that have users inside.

- Fixed: Slide-rollback bug where a user would walk off the roller, but the next cycle would slide you back.
- Fixed: Users with rank 1 couldn't create rooms due to a broken fuseright check.

Pictures

Here's a little gif demonstrating the sitting and giving drink, etc!

Quackster - Kepler - v21 Emulator [Java, MariaDB, Netty] - RaGEZONE Forums

This is super :):, I hope see more updates like this! The rollers have always been a missing complement working in retros like so many things from the v23-34 and walkways or known as room_magictiles also was rarely fixed, I like your v21 and your project although for me I hope in the future, someday also someone would like to fix v31-32 or 33, v31 and 32 was my favorite and I think that the more complete but at the same time more complex versions
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
This is super :):, I hope see more updates like this! The rollers have always been a missing complement working in retros like so many things from the v23-34 and walkways or known as room_magictiles also was rarely fixed, I like your v21 and your project although for me I hope in the future, someday also someone would like to fix v31-32 or 33, v31 and 32 was my favorite and I think that the more complete but at the same time more complex versions

Ah, I didn't know they were called room_magictiles. Is that something that's called in the later Habbo versions?

Also yeah since I use composers, or one packet class for every unique packet it will be easy in future to make it compatible with multiple versions. Not sure about the v30+ versions though, a lot changed. Maybe with some magic... :p:
 
Initiate Mage
Joined
Jul 2, 2016
Messages
98
Reaction score
40
Ah, I didn't know they were called room_magictiles. Is that something that's called in the later Habbo versions?

Also yeah since I use composers, or one packet class for every unique packet it will be easy in future to make it compatible with multiple versions. Not sure about the v30+ versions though, a lot changed. Maybe with some magic... :p:

Well room_magictiles is a column in the database with the coordinates to move from one public room to another when you arrive at a specific area such as from X to Z for example, I found it on some databases for v26 and later, I do not think it worked for later because in theory the packets changed from the v28 but maybe I'm wrong
 
Retired
Member
Joined
May 5, 2007
Messages
497
Reaction score
665
Hi qwek, this looks very good. It is very nice to see you have picked up on proper project management by using Gradle and handling your dependencies nicely. I even see a Dockerfile in your repo which makes marit proud.
I just browsed through your code, and there is something I want you to be aware of. It is sort of an anti-pattern related to exception-hiding, one example of this is in the DAO class for storing items:

The problem here is if I call newItem, I get an exception because my database is down, is full, corrupt, or whatever, there is no way for me as a caller to see that the database operation has failed and why it has failed. You log the exception, and this is fine. But there is no way for your code to understand that the database operation has failed otherwise. A good practice to do then is just to rethrow the exception, something like this:

Code:
catch (SQLException e) {    Storage.logError(e);    throw e;}

This way, it gets much easier for my code to understand that the database operation has failed and the user doesn't for example get the item in their hand. I have been struggling with this anti-pattern for the past few weeks where I have been writing integration tests for some legacy code. Just wanted to make you aware of this issue. Keep up the good werk qwek <3
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Hi qwek, this looks very good. It is very nice to see you have picked up on proper project management by using Gradle and handling your dependencies nicely. I even see a Dockerfile in your repo which makes marit proud.
I just browsed through your code, and there is something I want you to be aware of. It is sort of an anti-pattern related to exception-hiding, one example of this is in the DAO class for storing items:

The problem here is if I call newItem, I get an exception because my database is down, is full, corrupt, or whatever, there is no way for me as a caller to see that the database operation has failed and why it has failed. You log the exception, and this is fine. But there is no way for your code to understand that the database operation has failed otherwise. A good practice to do then is just to rethrow the exception, something like this:

Code:
catch (SQLException e) {    Storage.logError(e);    throw e;}

This way, it gets much easier for my code to understand that the database operation has failed and the user doesn't for example get the item in their hand. I have been struggling with this anti-pattern for the past few weeks where I have been writing integration tests for some legacy code. Just wanted to make you aware of this issue. Keep up the good werk qwek <3

Ah yes, I understand what you mean, this is very helpful advice, thank you.

If you have the time, then by all means please contribute to the git repository as I don't bite. :love:
 
Skilled Illusionist
Joined
Dec 27, 2008
Messages
311
Reaction score
205
Good News , i finally started to work on a CMS for Kepler ... For now i make the Login/Logout System works , was hard make the System works with Argon2 because i never used before... I'm using PHP + PDO...

Next step is get all data from the database like Credits , Habbo Club... Alex i have a doubt , how i can get the online users count ? u save that on database ?

Updates:
- Get Club Days (I Dont understand how works but i can get)
- Get Credits
- Get Motto
- Get Badge ( Only if is visible)
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Good News , i finally started to work on a CMS for Kepler ... For now i make the Login/Logout System works , was hard make the System works with Argon2 because i never used before... I'm using PHP + PDO...

Next step is get all data from the database like Credits , Habbo Club... Alex i have a doubt , how i can get the online users count ? u save that on database ?

Updates:
- Get Club Days (I Dont understand how works but i can get)
- Get Credits
- Get Motto
- Get Badge ( Only if is visible)

I could do it two ways, have a site_settings SQL table or something with a key value table where the key would be something like users_online and the value is the amount of users online which gets automatically updated. I could also add it through RCON too where you could send a request to the server to retrieve the amount of users online.

Code:
CREATE TABLE `site_settings` (
  `setting` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `site_settings` (`setting`, `value`) VALUES
('users_online', '0');

ALTER TABLE `site_settings`
  ADD UNIQUE KEY `setting` (`setting`);
COMMIT;
 
Status
Not open for further replies.
Back
Top