Kepler - v13 Emulator [C11, SQLite3, libuv]

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Kepler - v13 Emulator [C11, SQLite3, libuv]


    RaGEZONE Recommends

    RaGEZONE Recommends

    Kepler


    What is this?
    Kepler is a Habbo Hotel emulator that is designed to fully emulate the v13 version from 2006-ish era. The server is written in pure C11 and it's using the POSIX library, this means it cannot run naively on Windows, but through the Linux Subsystem for Windows, it's possible to run Kepler through the interface on Windows.

    The server is using an asynchronous networking library called libuv and it's using a database library called SQLite3, meaning there's no MySQL required.

    Features
    • Login
    • Register
    • Show public rooms
    • Enter public rooms
    • Show the amount of users inside rooms through the navigator, works for categories too
    • Load public room items
    • Show privately owned rooms
    • Enter private rooms
    • Support for multiple users inside rooms


    Libraries Used

    - SQLite3 (https://www.sqlite.org/capi3ref.html)

    - libuv (https://github.com/libuv/libuv)

    - Collections-C (https://github.com/srdja/Collections-C)

    Screenshots






    Code Snippets

    NAVIGATE.c (building the navigator public/private rooms and categories)

    PHP Code:
    void NAVIGATE(player *playerincoming_message *message) {
        
    int hide_full im_read_vl64(message);
        
    int category_id im_read_vl64(message);

        
    room_category *parent_category category_manager_get_by_id(category_id);
        
    outgoing_message *navigator om_create(220); // "C\"

        
    if (parent_category != NULL) {
            
    om_write_int(navigatorhide_full);
            
    om_write_int(navigatorcategory_id);

            if (
    parent_category->category_type == PUBLIC) {
                
    om_write_int(navigator0);
            } else {
                
    om_write_int(navigator2);
            }
            
    om_write_str(navigatorparent_category->name);
            
    om_write_int(navigatorcategory_manager_get_current_vistors(category_id)); // current visitors
            
    om_write_int(navigatorcategory_manager_get_max_vistors(category_id)); // max visitorss
            
    om_write_int(navigatorparent_category->parent_id); 

            List *
    rooms category_manager_get_rooms(parent_category->id);

            if (
    parent_category->category_type == PRIVATE) {
                
    om_write_int(navigatorlist_size(rooms));  // room count
            
    }

            for (
    int i 0list_size(rooms); i++) {
                
    room *instance;
                
    list_get_at(roomsi, (void*)&instance);

                
    category_manager_serialise(navigatorinstanceparent_category->category_type);
            }

            List *
    child_categories category_manager_get_by_parent_id(parent_category->id);

            for (
    int i 0list_size(child_categories); i++) {
                
    room_category *category;
                
    list_get_at(child_categoriesi, (void*)&category);

                
    om_write_int(navigatorcategory->id);
                
    om_write_int(navigator0);//category->category_type); // current visitors
                
    om_write_str(navigatorcategory->name);
                
    om_write_int(navigatorcategory_manager_get_current_vistors(category->id)); // current visitors
                
    om_write_int(navigatorcategory_manager_get_max_vistors(category->id)); // max visitorss
                
    om_write_int(navigatorparent_category->id); 
            }

            
    list_destroy(rooms);
            
    list_destroy(child_categories);
        }
            
        
    player_send(playernavigator);
        
    om_cleanup(navigator);

    room_manager.c snippets

    PHP Code:
    void room_enter(room *roomplayer *player) {
        if (
    list_contains(room->usersplayer)) {
            return;
        }

        if (
    player->room_user->room != NULL) {
            
    room_leave(player->room_user->roomplayer);
        }

        if (
    room->room_data->model_data == NULL) {
            
    printf("Room %i has invalid model data.\n"room->room_data->id);
            return;
        }

        
    player->room_user->room room;
        
    player->room_user->room_id room->room_id;

        
    player->room_user->room->room_data->model_data->door_x;
        
    player->room_user->room->room_data->model_data->door_y;
        
    player->room_user->room->room_data->model_data->door_z;
        
    player->room_user->head_rotation room->room_data->model_data->door_dir;
        
    player->room_user->body_rotation room->room_data->model_data->door_dir;

        
    list_add(room->usersplayer);
        
    room->room_data->visitors_now++;
    }

    void room_leave(room *roomplayer *player) {
        if (!
    list_contains(room->usersplayer)) {
            return;
        }

        
    player->room_user->room NULL;
        
    player->room_user->room_id 0;

        
    list_remove(room->usersplayerNULL);
        
    room->room_data->visitors_now--;

        
    outgoing_message *om om_create(29); // "@]"
        
    sb_add_int(om->sbplayer->player_data->id);
        
    room_send(roomom);
        
    om_cleanup(om);

    Last edited by Quackster; 3 Weeks Ago at 06:07 AM.


  2. #2
    Member Amariconao is offline
    MemberRank
    Nov 2011 Join Date
    64Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    SQLite worth? It's slower and mono-user(no concurrency)...

    Wathever, good luck with the project! If you want to test Go i can publish a little emu with handshake in Go. (You did one with python, java, now C11, etc...)

  3. #3
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by Amariconao View Post
    SQLite worth? It's slower and mono-user(no concurrency)...

    Wathever, good luck with the project! If you want to test Go i can publish a little emu with handshake in Go. (You did one with python, java, now C11, etc...)
    SQLite isn't slow, lol, it's much faster than MySQL. It's actually not a disadvantage, this section is just so used to MySQL it treats anything remotely foreign as being inferior, when it's actually just a nice alternative.

    The MySQL C API is horrendous anyways. I had encountered so many unique bugs to do with prepared statements in the API that I resorted to SQLite instead. Overall the code for preparing and selecting with SQLite is smaller than MySQL, and I've not any issues with it since I implemented it.

    I had some unique bugs where selecting a row based on username and password, the user and pass had to be the same length and more than 3 characters long, or the fact that the API only allowed me to select 6 rows.
    Last edited by Quackster; 4 Weeks Ago at 10:47 AM.

  4. #4
    Member PH11 is offline
    MemberRank
    Jun 2003 Join Date
    66Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Good luck with your development.

    I have missed the 2006-ish era time because there are no Habbo v13 retro's around anymore.

    I'll be glad to test it out on a server once it comes out.

  5. #5
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    ModeratorRank
    May 2007 Join Date
    InternetLocation
    2,520Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by Amariconao View Post
    SQLite worth? It's slower and mono-user(no concurrency)...

    Wathever, good luck with the project! If you want to test Go i can publish a little emu with handshake in Go. (You did one with python, java, now C11, etc...)
    I think it's worth it if the project isn't going to have a huge user base since it's compact and easy to use.


    Moderator & Developer
    I CAN NOT HELP YOU WITH YOUR SERVER, USE THE CORRECT HELP SECTION INSTEAD.
    I AM ONLY TAIGA ON RAGEZONE!
    BE CAREFUL WITH IMPOSTORS!


    DO NOT PM ME FOR GAME RELATED QUESTIONS, THESE MESSAGES WILL BE IGNORED!

    The Rules | Discord | MMORPG Extra | Contact Me


  6. #6
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by Taiga View Post
    I think it's worth it if the project isn't going to have a huge user base since it's compact and easy to use.
    It doesn't matter if it has a large user base or not if all the queries are executed in the same thread.

  7. #7
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Pathfinder has finally been added with a thread pool system, supports multiple users, collision still needs to be further improved to detect public room furniture and other players, but so far it will stop you from walking outside the bounds of the map and stops the player from going up and down steep heights.

    Short video for the interested: https://www.youtube.com/watch?v=Sm_z...ature=youtu.be


  8. #8
    Member Amariconao is offline
    MemberRank
    Nov 2011 Join Date
    64Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Hey Alex! Are tour project un github? It will be interesting! I will check that and start a little project in Go based on your server just for improve muy Go.

    Thanks!

  9. #9
    Member PH11 is offline
    MemberRank
    Jun 2003 Join Date
    66Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    I really like the development it definately brings back the old roots that I have missed

    I'd definatly buy a server to run this on if you are ever planning on releasing it that would be nice

    Probably have said this before in a previous reply but I'm just so thrilled to finally see the old roots come back to the place where it belongs to



    Good luck my friend

  10. #10
    C# / Java Programmer scottstamp851 is offline
    True MemberRank
    Jan 2007 Join Date
    EverywhereLocation
    534Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by Quackster View Post
    stops the player from going up and down steep heights.
    Retail v13 only prevents going *up* steep heights. You can drop from any height. Pretty much so you don't get stuck somewhere high.
    hayhay.

  11. #11
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by scottstamp851 View Post
    Retail v13 only prevents going *up* steep heights. You can drop from any height. Pretty much so you don't get stuck somewhere high.
    I worded the post quickly...

    Right now the max height the player can go up is 1.5 squares and the max height to go down is 4 squares.

    Quote Originally Posted by PH11 View Post
    I really like the development it definately brings back the old roots that I have missed

    I'd definatly buy a server to run this on if you are ever planning on releasing it that would be nice

    Probably have said this before in a previous reply but I'm just so thrilled to finally see the old roots come back to the place where it belongs to

    Good luck my friend
    The server will be released, otherwise I wouldn't post a development thread about this.

    Quote Originally Posted by Amariconao View Post
    Hey Alex! Are tour project un github? It will be interesting! I will check that and start a little project in Go based on your server just for improve muy Go.

    Thanks!
    The project is on GitHub, but right now the source is private because there's too much changing for me to consider making it public yet. This is an open-source project however, and it will be open to the public once I feel there's enough features added.

  12. #12
    Member m.tiago is offline
    MemberRank
    Dec 2008 Join Date
    33Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Hey Quack , you will enable SSO Login for PHP ? , because i'm making a CMS like zabboweb with PHP...

    A picutre:




    - - - Updated - - -

    I almost forgot , can you enable the Habbo Welcome Tutorial with the Maid:

    http://www.habborator.org/archive/ch...rs/woman_1.gif


    i Remember she give to new users the Welcome Green Mat... Sorry my english i from brazil...
    Last edited by m.tiago; 4 Weeks Ago at 04:12 AM.

  13. #13
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    9,041Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by Quackster View Post
    It doesn't matter if it has a large user base or not if all the queries are executed in the same thread.
    No thats bad. You don't want to rely your SQL on just one thread. Then your whole server will be throttled to that single thread.

    Also why are you using a C collections library when C++ has stl....
    Last edited by The General; 4 Weeks Ago at 09:20 PM.
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#0063

  14. #14
    Moderator Quackster is offline
    ModeratorRank
    Dec 2010 Join Date
    AustraliaLocation
    3,080Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Quote Originally Posted by The General View Post
    Also why are you using a C collections library when C++ has stl....
    Because I'm using pure C, not C++.

  15. #15
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    9,041Posts

    Re: Kepler - v13 Emulator [C11, SQLite3, libuv]

    Im blind and didnt read properly and thought you had given up on life already. :p
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#0063




Page 1 of 2 12 LastLast

Advertisement