[NodeJS, PostgreSQL] Habbo Emulator

Status
Not open for further replies.

Jaden

not so active
Aug 24, 2014
886
263
Oh look, another development which you'll automatically stop once you finish the authentication/login.
You know me so well!
 
Need an opinion on whether or not this should be re-written using ES6 or continued using ES5
 

Raymund

what it is
Sep 30, 2011
6
0
You know me so well!
 
Need an opinion on whether or not this should be re-written using ES6 or continued using ES5
I think it's worth changing now that you don't have much done yet (from what I've seen on your Github). ES6 is pretty sweet.
 

Quackster

a devbest user says what
Aug 22, 2010
1,763
1,234
Started on v2, uploaded it to the GitHub Repo:


It's ES5 because idrk doesn't matter to me.

Frameworks, Libraries, etc I'll be using for v2:
node-stopwatch - Profiling
winston - Logging
LINQ - querying
MySQL, PostgresSQL - database handling
pathfinding - A*, BestFirst, Jump-Point Search Grid Algorithm
redis - caching, IPC, etc (Will get into that more)
seqeulize - database ORM
rxJS / async - handling request asynchronously
nodemon - code editing without reloading the server

This might honestly be my favorite (and hopefully your favorite) emulator, if ever completed.

This emulator will follow the microservices architecture replicated from Habbo.com's Java server (Developer Insider), this means that it'll communicate across processes strictly for load-balancing, speed, and stability.

If the navigator ran on a separate process and crashed, the whole hotel wouldn't go down, just the navigator, and the users online would be alerted that the navigator is being worked on or whatever.

Even though you could technically work on the server without rebooting using nodemon, this is kind-of like a +1.

Feedback is appreciated, let me know your suggestions/opinions!
How is adding a random pathfinding class without even using it a feature?
 

Jaden

not so active
Aug 24, 2014
886
263
How is adding a random pathfinding class without even using it a feature?
What random pathfinding class?
Take a look at the new source, in the old one that was added out of boredum, I got a head start on it. And I've listed the frameworks I'm going to be using, if they're not already implemented, because not all of them are implemented yet.

I want your opinion on using Redis rather than a simple IPC library, think thats overkill?
 

Jaden

not so active
Aug 24, 2014
886
263


If you're still following the development/like looking at nice JavaScript code.

Working on the ByteBuf class at this time.

Preview:


Packet initialization and caching using reflections/meta-programming is currently done but will port over to C++ in the future for performance reasons.

Started on Habbo Encryption and currently generated and encrypted DH keys, have yet to test if it's a working implementation due to that fact that I'm still writing the schema for outgoing packet classes and everything before that.

Preview:


Disregard everything in the /models folder as it has yet to be refactored.

After basic client functionality is working, I'll go back into the server to make it follow more asynchronous patterns by implementing more callbacks, and all that good stuff.

A lot of code has been rewritten and refactored to ES6 (basically everything).

TCP Server is functional and basic but will be improved at a lower level using C++ in the future.
ByteBuf may be moved to it's own module due to how much I've worked on it, and how useful it may be in other projects unrelated to Habbo.
 
GOTTA REFACTOR BYTEBUF WRITE STREAM (_WRITE FUNCTION) SO IT DOESN'T JUST CONCATENATE THE BUFFER SO I CAN USE THE WRITER OFFSET EVEN THO IT WORKS SO LOL

MIGHT JUST END UP MANUALLY SHIFTING THE BYTES IN THE BUFFER USING OPERATORS.
 

Jaden

not so active
Aug 24, 2014
886
263
What happened to the development of this emulator?
Working on a CMS to run alongside it and due to certain circumstances the CMS is main priority right now before I can start working on the emulator again.

It's almost finished however. I'll post a git for it later if people are interested in taking a look at it.
 

Jaden

not so active
Aug 24, 2014
886
263
Update log (2/11/2017)

seems as if some of you guys are eager to see more work and won't take "almost" or "soon" for an answer.


I realize that this is a development that has been going on for quite a while... however, if you expect an emulator to be done in a month, yet never wrote one before yourself you're spewing ignorance. Be a lil considerate to the developer :D. I would never release trash, or something that wasn't up to my standards.




d0dda5a0a01c4da181f217b1e148de0b.png


I can't emphasize enough how the CMS for this emulator is literally almost done (a few pages left). I'm going to release a version for Plus Emulator but the version compatible to this emulator (only version will be maintained) will not be standalone, it will rely on the emulator's database capabilities and communicate with it frequently through net protocol or memory (most likely Redis since the CMS already uses it for server-side caching).

94de6f86a8a44f66aecce8e84c6312f7.png

af99669d776240d8850d0445e451af9b.png


@Sledmore
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Looks good keep up the good work. Btw, I never expect you to finish it within 1 month. the thread was basically in-active. If you messaged me asking for it to be re-opened with this, then I would of re-opened it. But instead you posted an "abuse" thread. But yeah, Like i said. project looks good, don't know if this has been answered before, but is the DB Structure going to be similar to others to allow people to switch without hassle? or your own? :p
 

Jaden

not so active
Aug 24, 2014
886
263
Looks good keep up the good work. Btw, I never expect you to finish it within 1 month. the thread was basically in-active. If you messaged me asking for it to be re-opened with this, then I would of re-opened it. But instead you posted an "abuse" thread. But yeah, Like i said. project looks good, don't know if this has been answered before, but is the DB Structure going to be similar to others to allow people to switch without hassle? or your own? :p
mb man I was a lil ticked off because of others on the thread (you know who). And to your answer about the database structure... yes and no. The structure is inspired by Plus but it probably won't be too similar and too simple to convert without some type of tool.
 
If you're into the back-end, fixed buffer concatenation with offset/writer index.




working with buffers in node is not so easy due to the lack of resourceful documentation available on some common features in other languages which we take for granted.
 
_size is a variable that is provided when a buffer is zero-filled (pre-allocated for memory writes).

in my _write function i coded this if-statement to check if there were any zero-fills to write the data to but now im getting confused. See if it's too many bytes then it'll only fill what it can, what i'm trying to do is take that data and write it to the buffer if it overflows. And now that I think about it... it'll have to work with the writer offset as well, writing the data behind the already existing buffer if there is one.

If anyone could assist me with this logic, that'd be great!

Code:
if (this._size > 0) {
    this._source.fill(chunk);

    if (this._size < chunk.length) {
        this._offset = this._size; // equivalent to this.incrementIndex(this._size);
        await _write(chunk.slice(this._size, chunk.length),
            null,
            () => {
                this.resetIndex();
            });
    }

    this._size -= chunk.length;
    return;
}
 

Liam

trust nobody
Staff member
FindRetros Moderator
Apr 10, 2013
1,184
713
Good luck, hopefully you can finish and release it.
 

Jaden

not so active
Aug 24, 2014
886
263



Buffer offset-writes logic fixed, yet buffer allocation doesn't write over zero-buffers.

One error fixed, another error appears. Zero-buffers aren't replaced by bytes written which i guess makes sense since the write functions don't use .fill() but use .alloc()

ByteBuf no longer contains 2 offsets for concurrent read/write operations, the way you'll have to write to a buffer would be by calling ByteBuf.writer() function before anything else.

Downgraded to a 2012-2013 client release version since I don't feel like fixing up the encryption just yet.
 
b6a64369c71e457a8427b8236fba2fc1.png

97fe639217e44d0abe50f1ad78ccf453.png

Daddy's home.

Fixed all occurring byte parsing errors as well as implementing the RC4 and RSA encryption (beta) although neither are being used on this client version (patched).

The current agenda is structuring the users table for the database and writing the outgoing packet handlers for the login / hotelview. If anyone has any ideas on how I should design the MySQL database (foreign keys, auto-inc, etc) then feel free to express your ideas on this thread.

I plan on refactoring a lot of the bits and pieces of the source code throughout the development because writing a functional Node app requires extensive logic and sacrifice.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683



Buffer offset-writes logic fixed, yet buffer allocation doesn't write over zero-buffers.

One error fixed, another error appears. Zero-buffers aren't replaced by bytes written which i guess makes sense since the write functions don't use .fill() but use .alloc()

ByteBuf no longer contains 2 offsets for concurrent read/write operations, the way you'll have to write to a buffer would be by calling ByteBuf.writer() function before anything else.

Downgraded to a 2012-2013 client release version since I don't feel like fixing up the encryption just yet.
 
b6a64369c71e457a8427b8236fba2fc1.png

97fe639217e44d0abe50f1ad78ccf453.png

Daddy's home.

Fixed all occurring byte parsing errors as well as implementing the RC4 and RSA encryption (beta) although neither are being used on this client version (patched).

The current agenda is structuring the users table for the database and writing the outgoing packet handlers for the login / hotelview. If anyone has any ideas on how I should design the MySQL database (foreign keys, auto-inc, etc) then feel free to express your ideas on this thread.

I plan on refactoring a lot of the bits and pieces of the source code throughout the development because writing a functional Node app requires extensive logic and sacrifice.
Bruh please make this NoSQL/MongoDB and not MySQL :p

- looking good!
 
Status
Not open for further replies.

Users who are viewing this thread

Top