1. I love you
2. I love your project.
keep it up!
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.
The below fixed it:Code:string_builder += str(self.door_z)
Thanks for the kind wordsCode:string_builder += str(int(self.door_z))![]()
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
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.
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
- - - Updated - - -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
I already said I have no plans to use any other system right now.
Love the project keep up the good work.
Good luck, I hope this project won't end up like Sierra.
Cheers!![]()
Good luck.
Nice project man, good luck !![]()
Goodluck on your project Alexis!
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)