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

Page 11 of 23 FirstFirst ... 34567891011121314151617181921 ... LastLast
Results 151 to 165 of 333
  1. #151
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Boraida View Post
    What version of Python are you using atm?
    Python 3.5

    Quote Originally Posted by Francis Joseph View Post
    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

    - - - Updated - - -

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


  2. #152
    Valued Member Kylon is offline
    MemberRank
    Dec 2015 Join Date
    Berlin, GermanyLocation
    112Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

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

    keep it up!

  3. #153
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    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))
    Quote Originally Posted by Kylon View Post
    1. I love you
    2. I love your project.

    keep it up!
    Thanks for the kind words

  4. #154
    Alpha Member Moogly is offline
    MemberRank
    Feb 2008 Join Date
    Pool LidoLocation
    2,322Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Quackster View Post
    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
    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.

  5. #155
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Moogly View Post
    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.

    http://git.alex-dev.org/Alex/Icarus/...access_objects

  6. #156
    Alpha Member Moogly is offline
    MemberRank
    Feb 2008 Join Date
    Pool LidoLocation
    2,322Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Quackster View Post
    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.

    http://git.alex-dev.org/Alex/Icarus/...access_objects
    No objections, but one more question: have you tested your DAO approach with more than just one library?

  7. #157
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Moogly View Post
    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

  8. #158
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    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 by Caustik; 03-07-16 at 03:39 PM.

  9. #159
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    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] Asynchronous room tasks, like walking
    [NEW] Ported Comet Java's pathfinder to Python
    [NEW] Pathfinder successfully implemented, users can now walk around the room
    [NEW] Display multiple users inside room
    [NEW] Collision map generation

    [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



    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
    - - - Updated - - -

    Quote Originally Posted by Caustik View Post
    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.

  10. #160
    Account Upgraded | Title Enabled! Jamal7 is offline
    MemberRank
    Dec 2013 Join Date
    547Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Love the project keep up the good work.

  11. #161
    Don't mind me, i'm nobody Jambokill is offline
    MemberRank
    Dec 2010 Join Date
    PhilippinesLocation
    264Posts

    happy Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good luck, I hope this project won't end up like Sierra.
    Cheers!

  12. #162
    Apprentice telli is offline
    MemberRank
    Jul 2016 Join Date
    CanadaLocation
    12Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good luck.

  13. #163

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Nice project man, good luck !

  14. #164
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Goodluck on your project Alexis!

  15. #165
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

    Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Oh, also, if you're gonna build a CMS, check out Flask. It's probably the most pleasant web framework I've used (very flexible and pluggable)



Advertisement