Add more converter aliases for better syntax and IDE support

This commit is contained in:
Ben 2019-06-21 01:42:25 +01:00
parent 1a5cf4868c
commit 59a26f6028
2 changed files with 13 additions and 2 deletions

View File

@ -8,6 +8,11 @@ import collections
from houdini.cooldown import CooldownError
from houdini.data.room import Room
from houdini.data.item import Item
from houdini.data.igloo import Igloo, Furniture, Flooring, Location
from houdini.data.stamp import Stamp
class ChecklistError(Exception):
"""Raised when a checklist fails"""
@ -384,7 +389,13 @@ class _ConverterContext:
ConverterTypes = {
Credentials: CredentialsConverter,
WorldCredentials: WorldCredentialsConverter
WorldCredentials: WorldCredentialsConverter,
Room: RoomConverter,
Item: ItemConverter,
Furniture: FurnitureConverter,
Igloo: IglooConverter,
Flooring: FlooringConverter
}

View File

@ -42,6 +42,6 @@ async def handle_join_server(p, penguin_id: int, login_key: str, lang: str):
@handlers.handler(XTPacket('j', 'jr'))
@handlers.cooldown(1)
async def handle_join_room(p, room: RoomConverter, x: int, y: int):
async def handle_join_room(p, room: Room, x: int, y: int):
p.x, p.y = x, y
await p.join_room(room)