jtieri / habbgo Goto Github PK
View Code? Open in Web Editor NEWHabbo Hotel emulation implemented in Go.
Habbo Hotel emulation implemented in Go.
Currently the DB connection pool is only accessibly via a Players underlying Session, however, this is a bad design choice and needs to be addressed sooner than later because there will be places where DB calls need to happen that have no Player context.
Make the packet handlers/composers have naming that is more aligned with the Habbo client source code
May work on this casually again but everything needs a refresh. In the end most of the code/design may change but I figured it would be easier to refactor the hell out of this versus starting from scratch,
Most of the code needs to be documented, it would be wise to get a good chunk of this done before it becomes a daunting task.
Creating a getting started guide in the README would be nice as well
Creating this to serve as a checklist for myself as I wrap up some pieces of code that I've left unfinished in a local branch.
Right now register/login works minus a few packets at login related to unsupported features e.g. habbo club, recycler, messenger, etc. Public rooms are loading with heightmaps and players are initialized so the next steps are getting the pathfinder implemented. Once that is complete the goal will likely be some hardcore cleanup and solidifying of designs before moving deep into the core of the games functionality. Better testing coverage would be nice as well so I may spend some time on that before moving on to other things.
Specific revision? r14?
Also, as I go through this on my fork and get to understand where you were going with it, I'll see if I can give back by helping you with some of your issues on a clean branch of your original repo.
Currently when a user registers/signs in we do not keep their IP as persistent data in the DB. We will need this information in the future though for managing users (i.e. gonna need IPs to manage bans so need to log this to DB)
Best Idea is probably to store up to x IP addresses associated with a user in a table that keeps track of recent connection addresses per user.
Or simply lowercase habb, to avoid stuttering imports.
Please it's a convention in the Go community. Don't trigger me.
See this post that goes into detail on the how and why.
Recommended git extension here. (should be available in brew, winget/scoop, AUR, etc)
Fast-forward rebase instead of merging avoids redundant commits to be created, there's also a toggle in the GitHub web UI somewhere to enforce this on PRs.
~/.gitrc
required addition (avoids local Git creating merge commits during conflict auto-merging):
[pull]
ff = only
The Wiki rn is a mere outline, in time it needs to be filled out.
When triggering commands that generate the same data each time, cache the packet response to not waste CPU and I/O resources. For some packets the database gets hit every time * N users, and this leads to excessive database load. All emulators currently available experience this design flaw.
Meth0d and/or matty13 built a novel (for the retro community) way of caching packets by key-value. An example of it's usage can be found here.
Data was cached on the protocol level, similar to how reverse http proxies like Varnish (L1 tier) and Apache Traffic Server (L2, L3 tier) used by Wikimedia and New York Times cache content to achieve high throughput and low latency responses.
Caching on the protocol level bypasses most if not all game logic on second (or first, depending on implementation, stale-while-revalidate is a well suited pattern that could be adopted for e.g. navigator; initializing cache on constructor/loading data, scheduling a refresh decoupled from response when client asks for it, limited per X time) packet received, this lowers database load and considerably (just ask popular retro's on their specced VPSes) during peak traffic and/or when dealing with scriptkiddies.
In this age of 1TB RAM servers and 2TB PMEM devices with ridiculous throughput and nanosecond latencies; what is being taught in computer science classes (memory being expensive, CPU re-calculation being cheap) no longer applies. It now makes more sense to calculate once and store in memory and to recalculate only when absolutely necessary. Such application architecture allows the CPU to spend most of it's time towards expensive game logic like pathfinding, instead of shuffling data around.
Implementing this would take a concurrent (being N thread R/W access safe) key-value store implementation like ristretto or a remote one like Redis.
Response packets could then be accessed by each game service, allowing each to implement custom behavior. (e.g. item inventory being cached per user by attaching user ID to the key).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.