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!

[LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera]

Status
Not open for further replies.
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Updated main thread.

Consider writing unit tests. I know, its a lot of work for such a small project but you get benefits from it because you can automatically test components like these.

Yeah, unit testing is important and I do it often, but this error was just an oversight which I missed.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Development closed.

*drops mic*

Comet is now released, and it's literally the best emulator that's ever been released within the Habbo section, the only reason Comet wasn't released is what drove me to create this emulator, but now there's absolutely no point.

I'm sorry it had to end like this, but no one loses because:

  • Everyone still gets a fuckin' awesome emulator (Comet)
  • I don't have to waste time on this copyright-infringing server

And before anyone asks, did Sulake contact me? No.
Hoshiko, I'm sorry, but thank you for offering to host my sources when you did.

Download (including source):
(Compiled release is in Icarus-data.zip)

There's no license or anything on these releases, so it's up for grabs for anyone else to work on it. Personally I think this is a really good base to start from and learn to expand your knowledge.

Not sure how long Hoshiko will keep my account up but the sources can also be found at:

If anyone here has a decent rig and likes to play ArmA 3, I've been developing a mod for it, for the past year (first comment was April 28th, 2015).

Some of you guys may be interested.
 
Last edited:
Joined
Oct 11, 2012
Messages
544
Reaction score
143
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Development closed.

*drops mic*

Comet is now released, and it's literally the best emulator that's ever been released within the Habbo section, the only reason Comet wasn't released is what drove me to create this emulator, but now there's absolutely no point.

I'm sorry it had to end like this, but no one loses because:

  • Everyone still gets a fuckin' awesome emulator (Comet)
  • I don't have to waste time on this copyright-infringing server

And before anyone asks, did Sulake contact me? No.
@Hoshiko, I'm sorry, but thank you for offering to host my sources when you did.

Download (including source):
(Compiled release is in Icarus-data.zip)

There's no license or anything on these releases, so it's up for grabs for anyone else to work on it. Personally I think this is a really good base to start from and learn to expand your knowledge.

Not sure how long Hoshiko will keep my account up but the sources can also be found at:

If anyone here has a decent rig and likes to play ArmA 3, I've been developing a mod for it, for the past year (first comment was April 28th, 2015).

Some of you guys may be interested.
I sense sarcasm in this post lol, Comet handles alot of players but it's missing things and bugs. We thank you for even continuing Icarus as you did for your last Habbo Project, could you state what needs to be finished etc and bugs (If any)? and also I play Arma 3, i'll check out the mod!
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

I sense sarcasm in this post lol, Comet handles alot of players but it's missing things and bugs. We thank you for even continuing Icarus as you did for your last Habbo Project, could you state what needs to be finished etc and bugs (If any)? and also I play Arma 3, i'll check out the mod!

Leon told me that the things missing were ultimately useless for a Habbo retro, two things missing I know are marketplace and Habbo club, useless for a retro :):

My mod is still in development, but you can keep up to date by following it if ya wish.

could you state what needs to be finished etc and bugs (If any)? and also I play Arma 3, i'll check out the mod!

Main page has all the features I've done.


There's no sarcasm intended either :D:
 
Joined
Feb 26, 2007
Messages
570
Reaction score
617
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Development closed.

*drops mic*

Comet is now released, and it's literally the best emulator that's ever been released within the Habbo section, the only reason Comet wasn't released is what drove me to create this emulator, but now there's absolutely no point.

I'm sorry it had to end like this, but no one loses because:

  • Everyone still gets a fuckin' awesome emulator (Comet)
  • I don't have to waste time on this copyright-infringing server

And before anyone asks, did Sulake contact me? No.
@Hoshiko, I'm sorry, but thank you for offering to host my sources when you did.

Download (including source):
(Compiled release is in Icarus-data.zip)

There's no license or anything on these releases, so it's up for grabs for anyone else to work on it. Personally I think this is a really good base to start from and learn to expand your knowledge.

Not sure how long Hoshiko will keep my account up but the sources can also be found at:

If anyone here has a decent rig and likes to play ArmA 3, I've been developing a mod for it, for the past year (first comment was April 28th, 2015).

Some of you guys may be interested.

Thread Closed, see above.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Thread is re-opened, it's going to be rewritten in Python instead :):

Everything has been redone from scratch, so it will take me a while to get back to the same level of completeness that I was at before.

Main thread updated.

Source is available at:
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

No hate or anything but:

PHP:
    self.response = Response(outgoing.SearchResultSetComposer)

Why use self.response? Can't you just make a local variable since you only use it in that context anyway? (I don't have python experience so if I say something dumb correct me)
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

No hate or anything but:

PHP:
    self.response = Response(outgoing.SearchResultSetComposer)

Why use self.response? Can't you just make a local variable since you only use it in that context anyway? (I don't have python experience so if I say something dumb correct me)

It's needed for the message encoder, when I send a composer back to the socket.

The last else statement from message_encoder.py gets the self.response variable, there's no need for interfaces/abstract classes in Python, because the language is completely dynamic :D:

Code:
def encode(message):
    """
    Return outcoming data from client
    :param response: the message to parse for client
    """

    # Convert string to bytes
    if type(message) is str:
        return message.encode()
    
    # Build message in bytes for client from response class
    elif type(message) is Response:
        return message.get_buffer()
    
    # Assume this is a composer class
    # Build message in bytes for clients from composer
    else:
        return message.response.get_buffer()
 
Experienced Elementalist
Joined
Mar 18, 2007
Messages
211
Reaction score
223
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Python... although I do not know the language well, this sounds very interesting so I'll be following!

Good luck. :):

--- EDIT ---

It looks incredibly clean.
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

What version of Python are you using atm?
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

What version of Python are you using atm?

Python 3.5

Python... although I do not know the language well, this sounds very interesting so I'll be following!

Good luck. :):

--- EDIT ---

It looks incredibly clean.


Thanks, I appreciate the kind words :):



Interesting stuff happens when you write model handling in Python for the first time :):

Quackster - [LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera] - RaGEZONE Forums
 
Junior Spellweaver
Joined
Dec 29, 2015
Messages
111
Reaction score
75
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

1. I love you
2. I love your project.

keep it up!
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

I figured out the problem, the code below would cause the weird error, basically when adding "door_z" to a string, it should have been an integer, but instead PyMySQL was fetching it as a float (as defined in the database) and would add a .0 to the end of the number and would screw up the client.

Code:
string_builder += str(self.door_z)

The below fixed it:

Code:
string_builder += str(int(self.door_z))

1. I love you
2. I love your project.

keep it up!

Thanks for the kind words :D:
 
Software Engineer
Loyal Member
Joined
Feb 19, 2008
Messages
1,055
Reaction score
492
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

I figured out the problem, the code below would cause the weird error, basically when adding "door_z" to a string, it should have been an integer, but instead PyMySQL was fetching it as a float (as defined in the database) and would add a .0 to the end of the number and would screw up the client.

Code:
string_builder += str(self.door_z)

The below fixed it:

Code:
string_builder += str(int(self.door_z))



Thanks for the kind words :D:

Curious not critiquing but why did you use PyMySQL? Why not something like SQLAlchemy or another ORM? Then people could use other databases as well.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

Curious not critiquing but why did you use PyMySQL? Why not something like SQLAlchemy or another ORM? Then people could use other databases as well.

I chose PyMySQL because MySQL is what the majority of what people use here, it's the easiest to implement and works on all operating systems.

All data is processed through data access objects, so it's easy to rip out one database system and replace it with another.

I have no plans to use any other system right now.

 
Software Engineer
Loyal Member
Joined
Feb 19, 2008
Messages
1,055
Reaction score
492
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

I chose PyMySQL because MySQL is what the majority of what people use here, it's the easiest to implement and works on all operating systems.

All data is processed through data access objects, so it's easy to rip out one database system and replace it with another.

I have no plans to use any other system right now.


No objections, but one more question: have you tested your DAO approach with more than just one library?
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

No objections, but one more question: have you tested your DAO approach with more than just one library?

No. I'll probably do it later to demonstrate proof of concept that there can be more than one type of database system used :):
 
Custom Title Activated
Loyal Member
Joined
May 23, 2011
Messages
1,607
Reaction score
588
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

You should have a look at using SQLAlchemy and asyncio rather than MySQLDB and the older asnyccore module.

It's refreshing to see someone tackle the problem of writing an emulator in a language like Python, good luck!
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

So I'm thinking from now on, I'll do changelogs with [NEW] [CHANGED] [FIX] and [REMOVED] tags, I think this would be the most readable when sharing updates.

Changelog as of 6-7-2016


[NEW] Show rooms with people inside at Navigator
[NEW] Load heightmap models on start up
[NEW] Room entry implementation
[NEW] Joining and leaving rooms affects user count
[NEW] Leave room upon disconnection
[NEW] Remove room avatar when user leaves room
[NEW]
[NEW]
[NEW] Pathfinder successfully implemented, users can now walk around the room
[NEW] Display multiple users inside room
[NEW]

[FIX] Show "Edit room" button for room owner
[FIX] Issue where kick/ban buttons wouldn't appear if a user had room ownership/rights and tried to kick someone
[FIX] Issue where pathfinder would return one value only
[FIX] After a user walks, their status would still repetitively send
[FIX] Issue where door ways would be glitched with missing tiles (datatype error, all too common in Python).
[FIX] User could enter the room they were already in, and freeze themselves up

Quackster - [LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera] - RaGEZONE Forums


If anyone's interested, here's the pathfinder ported to Python, I'm suprised works in a different language, as it was my first pathfinder port :):

Code:
"""
Pathfinder
Ported from Java by Alex (Quackster/TheAmazingAussie)
"""
from managers.pathfinder.point import Point
from managers.pathfinder.pathfinder_node import PathfinderNode


"""
All 8 compass points around a tile
"""
MOVE_POINTS = [
    Point(0, -1, 0),
    Point(0, 1, 0),
    Point(1, 0, 0),
    Point(-1, 0, 0),
    Point(1, -1, 0),
    Point(-1, 1, 0),
    Point(1, 1, 0),
    Point(-1, -1, 0)
]


def make_path(position, end, size_x, size_y, room):
    """
    Create programming path
    :param position:
    :param end:
    :param room:
    :return:
    """
    squares = []
    nodes = make_path_reversed(position, end, size_x, size_y, room)

    if nodes is not None:
        while nodes.next_node is not None:
            squares.append(Point(nodes.position.x, nodes.position.y, 0))
            nodes = nodes.next_node

    return squares[::-1] # Reverse list


def make_path_reversed(position, end, size_x, size_y, room):

    open_list = []
    map = [[None for y in range(0, size_y)] for x in range(0, size_x)]
    node = None
    tmp = None
    cost = 0
    diff = 0

    current = PathfinderNode(position)
    current.cost = 0

    finish = PathfinderNode(end)
    map[position.x][position.y] = current
    open_list.append(current)

    while len(open_list) > 0:
        current = poll_first(open_list)
        current.in_close = True

        for temp_point in MOVE_POINTS:
            tmp = current.position.add_point(temp_point)

            is_final_move = (tmp.x == end.x) and (tmp.y == end.y)

            if room.room_mapping.is_valid_step(Point(current.position.x, current.position.y, current.position.z), tmp, is_final_move):

                if map[tmp.x][tmp.y] is None:
                    node = PathfinderNode(tmp)
                    map[tmp.x][tmp.y] = node
                else:
                    node = map[tmp.x][tmp.y]

                if node.in_close is not True:
                    diff = 0

                    if current.position.x != node.position.x:
                        diff += 1

                    if current.position.y != node.position.y:
                        diff += 1

                    cost = current.cost + diff + node.position.get_distance_squared(end)

                    if cost < node.cost:
                        node.cost = cost
                        node.next_node = current

                    if node.in_open is not True:
                        if node.position.x == finish.position.x and node.position.y == finish.position.y:
                            node.next_node = current
                            return node

                        node.in_open = True
                        open_list.append(node)

    return None


def poll_first(list):

    first_item = None

    if len(list) > 0:
        first_item = list[0]
        list.pop(0)

    return first_item



You should have a look at using SQLAlchemy and asyncio rather than MySQLDB and the older asnyccore module.

It's refreshing to see someone tackle the problem of writing an emulator in a language like Python, good luck!

I already said I have no plans to use any other system right now.
 
Status
Not open for further replies.
Back
Top