Habbo Emulator in golang

TheRealMoonman

I eat babies
Sep 30, 2014
360
74
This is probably the first time I've asked for help, but because I have stuff irl to deal with, it kind of conflicts with projects and stuff i wanna do, I recently talked a bit of shit about golang, which is a language developed by google, and while looking more into it, its actually a pretty fucking awesome language. I just wanna know if anybody is interested in helping me with this current project, that I'm writing in go, my biggest problem is caching the data taken from the database, and caching it, I have looked into some of the binaries for golang, but I'm not a go developer, I've just been reading a few pdfs to understand the basics, and since I use python alot, its pretty easy.
The use of semi-colons is pretty must gone, functions are called without them e.g Initate(), and they have no circular dependencies which is a bit of a mind fuck for me.
But other than the code which is fairly good to use, the speed is almost akin to C++ which blows C#, Node.js and Java out of the water.. if you write the code good enough.

So if anybody knows basics of caching in golang or something helpful for it and you wanna make a unique emulator, hit me up, because its a learning experience for me, and I haven't made a development thread for it yet because I want to see it working in action, before i post anything about it.

bit of an example how you'd open a mysql connection in it.
Code:
func Connect() {
    var err error
    DB, err = gorm.Open("mysql", config.MYSQL_USER+":"+config.MYSQL_PASS+"@/"+config.MYSQL_DB+"?charset=utf8&parseTime=True&loc=Local")
    if err != nil {
        panic(err)
        DB.Close()
    }
    fmt.Println(">Connection Succesful")
    fmt.Println(">Test Query Starting")
    TestQ()
}
 

LeChris

github.com/habbo-hotel
Sep 30, 2013
2,735
1,319
Go is a fairly complex language with even more complex ways of doing things.

PS while it as speeds similar sometimes faster than C++, this doesn't mean it's more reliable than C++ nor Node (which compiles to C++).

I love your ideology and that you're willing to try new things, however I don't believe Go is designed for beginners to the scene as it has a lot of dumb things going on with it. One problem in particular I had was folder structure as it just loves to make separating your code a pain.

No other developer in the scene can handle Go, besides possibly Alex even then who knows. Good luck man
 

TheRealMoonman

I eat babies
Sep 30, 2014
360
74
Go is a fairly complex language with even more complex ways of doing things.

PS while it as speeds similar sometimes faster than C++, this doesn't mean it's more reliable than C++ nor Node (which compiles to C++).

I love your ideology and that you're willing to try new things, however I don't believe Go is designed for beginners to the scene as it has a lot of dumb things going on with it. One problem in particular I had was folder structure as it just loves to make separating your code a pain.

No other developer in the scene can handle Go, besides possibly Alex even then who knows. Good luck man
Yeah the way it imports packages is a pain,anyways thanks for that man, I will just try in stack overflow chat
 

Jaden

not so active
Aug 24, 2014
886
263
I was thinking of doing this, yet never had the time to start on it.

EDIT:
Indeed dependency management in Go is poor but If you're having a bit of trouble with it then this might be too big of a leap for you. I'd consider writing a few basic applications in Golang before attempting a Habbo server.
 
Last edited:

ZealousOtter

New Member
Feb 17, 2017
16
11
I'd consider writing a few basic applications in Golang before attempting a Habbo server.

+1 to this. I've worked with Go a good amount and it's part of the stack we use at my job, but I still feel somewhat uneasy when I have to use it. It's definitely a little strange and takes some time to get used to, and it's also a young language relative to others so you won't find as much in terms of libraries, support, etc. I've thought about starting an emulator in Go too, but just haven't had the time or energy to deal with what I think would be a pretty frustrating build.
If you have your heart set on using Go and want to at least attempt it, don't let this discourage you. Go is a great language and I think would work really well coded correctly into an emulator. It's fast, handles concurrency wonderfully, and has great GC/memory management. It really is a cool language.
 

B10N1C

New Member
Jan 2, 2015
1
1
I've code a golang srv, with some features like:
- ConsoleCommands.
- MySQL.
- Queue requests system with X go-routines for executing them.
- Client and Server Messages (obviously)
Contiue the dev bro, go is a nice language. I come from Java and i will state in Go all my life. I can login into the hotel now. ClientOK and userHome are sended and i see the Hotel View, so all is OK.

2ijl21j.png

In this image surely the naming convention of the variables is not well made, however it is an old photo and I have changed many things. Now I follow this convention: /go/wiki/CodeReviewComments on the github

I don't know what do you want to say with "caching" (I'm spanish) but i think u say Lists, Maps and arrays/slices. You can search info at google.
When i started dev in go, i hate pointers too, but them let you a total controll of your code. If you dont need anything only nil the pointer and bye. It's a little strange, i know, but try it ;).

Pd: Welcome to our Gopher family!
images



PD2: Don't care if you see the permormance of Go sockets and Go routines. I will say it to you. Go is a monster, or better, Go is THE MONSTER.

PS3: Const "header" was remaded, i say, it's a old pic. I use Byte.Buffer for concat string
 
Go is a fairly complex language with even more complex ways of doing things.

PS while it as speeds similar sometimes faster than C++, this doesn't mean it's more reliable than C++ nor Node (which compiles to C++).

I love your ideology and that you're willing to try new things, however I don't believe Go is designed for beginners to the scene as it has a lot of dumb things going on with it. One problem in particular I had was folder structure as it just loves to make separating your code a pain.

No other developer in the scene can handle Go, besides possibly Alex even then who knows. Good luck man
Not really complex. For a Java base of an emulator i need to code a lot of things. For an Go emu base i need less code. The unique things will cause problems are the pointers and the circular dependences, but with a 3rd package it's fixed. Project structure? I think it's better for sort the files.
 
i44v42.png
 

Users who are viewing this thread

Top