Don't send command messages publicly

This commit is contained in:
Ben 2019-08-19 02:29:05 +01:00
parent 337c2048cd
commit 8c8fe6320c

View File

@ -1,6 +1,6 @@
from houdini import handlers from houdini import handlers
from houdini.handlers import XTPacket from houdini.handlers import XTPacket
from houdini.commands import invoke_command_string from houdini.commands import invoke_command_string, has_command_prefix
@handlers.handler(XTPacket('m', 'sm')) @handlers.handler(XTPacket('m', 'sm'))
@ -15,5 +15,7 @@ async def handle_send_message(p, penguin_id: int, message):
await room_player.sendXt("mm", message, penguin_id) await room_player.sendXt("mm", message, penguin_id)
return return
await p.room.send_xt('sm', p.data.id, message) if has_command_prefix(message):
await invoke_command_string(p.server.commands, p, message) await invoke_command_string(p.server.commands, p, message)
else:
await p.room.send_xt('sm', p.data.id, message)