client: accept rom names smaller than 21b
This commit is contained in:
		
							parent
							
								
									0dcb5ba73b
								
							
						
					
					
						commit
						1a60d263ff
					
				| 
						 | 
					@ -621,11 +621,12 @@ async def process_server_cmd(ctx : Context, cmd, args):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if cmd == 'Connected':
 | 
					    if cmd == 'Connected':
 | 
				
			||||||
        ctx.expected_rom = args
 | 
					        ctx.expected_rom = args
 | 
				
			||||||
        if ctx.last_rom == ctx.expected_rom:
 | 
					        if ctx.last_rom is not None:
 | 
				
			||||||
 | 
					            if ctx.last_rom[:len(args)] == ctx.expected_rom:
 | 
				
			||||||
                rom_confirmed(ctx)
 | 
					                rom_confirmed(ctx)
 | 
				
			||||||
                if ctx.locations_checked:
 | 
					                if ctx.locations_checked:
 | 
				
			||||||
                    await send_msgs(ctx.socket, [['LocationChecks', [Regions.location_table[loc][0] for loc in ctx.locations_checked]]])
 | 
					                    await send_msgs(ctx.socket, [['LocationChecks', [Regions.location_table[loc][0] for loc in ctx.locations_checked]]])
 | 
				
			||||||
        elif ctx.last_rom is not None:
 | 
					            else:
 | 
				
			||||||
                raise Exception('Different ROM expected from server')
 | 
					                raise Exception('Different ROM expected from server')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if cmd == 'ReceivedItems':
 | 
					    if cmd == 'ReceivedItems':
 | 
				
			||||||
| 
						 | 
					@ -829,7 +830,7 @@ async def game_watcher(ctx : Context):
 | 
				
			||||||
                ctx.last_rom = list(rom)
 | 
					                ctx.last_rom = list(rom)
 | 
				
			||||||
                ctx.locations_checked = set()
 | 
					                ctx.locations_checked = set()
 | 
				
			||||||
            if ctx.expected_rom is not None:
 | 
					            if ctx.expected_rom is not None:
 | 
				
			||||||
                if ctx.last_rom != ctx.expected_rom:
 | 
					                if ctx.last_rom[:len(ctx.expected_rom)] != ctx.expected_rom:
 | 
				
			||||||
                    print("Wrong ROM detected")
 | 
					                    print("Wrong ROM detected")
 | 
				
			||||||
                    await ctx.snes_socket.close()
 | 
					                    await ctx.snes_socket.close()
 | 
				
			||||||
                    continue
 | 
					                    continue
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue