mirror of
https://github.com/solero/houdini.git
synced 2024-11-24 22:47:22 +00:00
Move waddle handler check into houdini.handlers
This commit is contained in:
parent
657ee1d063
commit
1d7ef65d44
@ -258,3 +258,19 @@ def player_in_room(*room_ids):
|
|||||||
def check_room_id(_, p):
|
def check_room_id(_, p):
|
||||||
return p.room is not None and p.room.id in room_ids
|
return p.room is not None and p.room.id in room_ids
|
||||||
return check(check_room_id)
|
return check(check_room_id)
|
||||||
|
|
||||||
|
|
||||||
|
def table(*logic):
|
||||||
|
def check_table_game(_, p):
|
||||||
|
if p.table is not None and type(p.table.logic) in logic:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
return check(check_table_game)
|
||||||
|
|
||||||
|
|
||||||
|
def waddle(*waddle):
|
||||||
|
def check_waddle_game(_, p):
|
||||||
|
if p.waddle is not None and type(p.waddle) in waddle:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
return check(check_waddle_game)
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
from houdini import handlers
|
from houdini import handlers
|
||||||
from houdini.handlers import XTPacket, check
|
from houdini.handlers import XTPacket
|
||||||
from houdini.handlers.play.navigation import handle_join_room, handle_join_player_room
|
from houdini.handlers.play.navigation import handle_join_player_room, handle_join_room
|
||||||
|
|
||||||
|
|
||||||
def table_handler(logic):
|
|
||||||
def check_table_game(_, p):
|
|
||||||
if p.table is not None and type(p.table.logic) == logic:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
return check(check_table_game)
|
|
||||||
|
|
||||||
|
|
||||||
@handlers.handler(XTPacket('a', 'gt'))
|
@handlers.handler(XTPacket('a', 'gt'))
|
||||||
|
@ -1,14 +1,7 @@
|
|||||||
from houdini import handlers
|
from houdini import handlers
|
||||||
from houdini.handlers import XTPacket, check
|
from houdini.data.room import Room
|
||||||
from houdini.handlers.play.navigation import handle_join_room, handle_join_player_room
|
from houdini.handlers import XTPacket
|
||||||
|
from houdini.handlers.play.navigation import handle_join_player_room, handle_join_room
|
||||||
|
|
||||||
def waddle_handler(waddle):
|
|
||||||
def check_waddle_game(_, p):
|
|
||||||
if p.waddle is not None and type(p.waddle) == waddle:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
return check(check_waddle_game)
|
|
||||||
|
|
||||||
|
|
||||||
@handlers.handler(XTPacket('gw', ext='z'))
|
@handlers.handler(XTPacket('gw', ext='z'))
|
||||||
|
Loading…
Reference in New Issue
Block a user