debug stuff

This commit is contained in:
Alberto Xamin 2020-12-20 23:10:44 +01:00
parent 48f4605b0b
commit 174d037d8c
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -220,6 +220,7 @@ def chat_message(sid, msg):
else: else:
sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} bad format'}) sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} bad format'})
elif '/setcharacter' in msg: elif '/setcharacter' in msg:
sio.emit('chat_message', room=ses.game.name, data={'color': f'red','text':f'🚨 {ses.name} is in debug mode and changed character'})
import bang.characters as characters import bang.characters as characters
cmd = msg.split() cmd = msg.split()
if len(cmd) >= 2: if len(cmd) >= 2:
@ -227,6 +228,20 @@ def chat_message(sid, msg):
ses.character = [c for c in chs if c.name == ' '.join(cmd[1:])][0] ses.character = [c for c in chs if c.name == ' '.join(cmd[1:])][0]
ses.real_character = ses.character ses.real_character = ses.character
ses.notify_self() ses.notify_self()
elif '/removecard' in msg:
sio.emit('chat_message', room=ses.game.name, data={'color': f'red','text':f'🚨 {ses.name} is in debug mode and removed a card'})
cmd = msg.split()
if len(cmd) == 2:
ses.hand.pop(int(cmd[1]))
ses.notify_self()
elif '/getcard' in msg:
sio.emit('chat_message', room=ses.game.name, data={'color': f'red','text':f'🚨 {ses.name} is in debug mode and got a card'})
import bang.cards as cs
cmd = msg.split()
if len(cmd) >= 2:
cards = cs.get_starting_deck(ses.game.expansions)
ses.hand.append = [c for c in cards if c.name == ' '.join(cmd[1:])][0]
ses.notify_self()
elif '/gameinfo' in msg: elif '/gameinfo' in msg:
sio.emit('chat_message', room=sid, data={'color': f'','text':f'info: {ses.game.__dict__}'}) sio.emit('chat_message', room=sid, data={'color': f'','text':f'info: {ses.game.__dict__}'})
elif '/meinfo' in msg: elif '/meinfo' in msg: