possible fix
This commit is contained in:
		
							parent
							
								
									acbcb0b2b0
								
							
						
					
					
						commit
						2b94517df6
					
				| @ -6,7 +6,7 @@ import eventlet | |||||||
| import socketio | import socketio | ||||||
| 
 | 
 | ||||||
| from bang.game import Game | from bang.game import Game | ||||||
| from bang.players import Player | from bang.players import Player, PendingAction | ||||||
| 
 | 
 | ||||||
| import sys  | import sys  | ||||||
| sys.setrecursionlimit(10**6) # this should prevents bots from stopping | sys.setrecursionlimit(10**6) # this should prevents bots from stopping | ||||||
| @ -121,6 +121,7 @@ def disconnect(sid): | |||||||
| 
 | 
 | ||||||
| @sio.event | @sio.event | ||||||
| def create_room(sid, room_name): | def create_room(sid, room_name): | ||||||
|  |     if sio.get_session(sid).game == None: | ||||||
|         while len([g for g in games if g.name == room_name]): |         while len([g for g in games if g.name == room_name]): | ||||||
|             room_name += f'_{random.randint(0,100)}' |             room_name += f'_{random.randint(0,100)}' | ||||||
|         sio.leave_room(sid, 'lobby') |         sio.leave_room(sid, 'lobby') | ||||||
| @ -270,6 +271,10 @@ def chat_message(sid, msg): | |||||||
|             elif '/mebot' in msg: |             elif '/mebot' in msg: | ||||||
|                 ses.is_bot = not ses.is_bot |                 ses.is_bot = not ses.is_bot | ||||||
|                 ses.bot_spin() |                 ses.bot_spin() | ||||||
|  |             elif '/arcadekick' in msg and ses.game.started: | ||||||
|  |                 if len([p for p in ses.game.players if p.pending_action != PendingAction.WAIT]) == 0: | ||||||
|  |                     sio.emit('chat_message', room=ses.game.name, data={'color': f'','text':f'KICKING THE ARCADE CABINET'}) | ||||||
|  |                     ses.game.play_turn() | ||||||
|             else: |             else: | ||||||
|                 sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} COMMAND NOT FOUND'}) |                 sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} COMMAND NOT FOUND'}) | ||||||
|         else: |         else: | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Alberto Xamin
						Alberto Xamin