openspy / openspy-core

132 stars 21 forks source link

Room filtering works incorrectly in FlatOut 2 #7

Closed NicknineTheEagle closed 1 year ago

NicknineTheEagle commented 1 year ago

Room filtering in FlatOut 2 doesn't seem to work as it should, when I try to specify a filtering criteria (e.g. setting game mode to Stunt), it filters out rooms seemingly at random without obeying the actual filters specified. Affects both PC and PS2 versions.

NicknineTheEagle commented 1 year ago

Based on my research, it looks like the issue is that brackets aren't handled properly in rules strings. Any:

numplayers < maxplayers and gamever='FO14' and datachecksum='3546d58093237eb33b2a96bb813370d846ffcec8' and password=0 and (gamemode='openwaiting' or gamemode='openplaying')

Stunt (returns broken results):

numplayers < maxplayers and gamever='FO14' and datachecksum='3546d58093237eb33b2a96bb813370d846ffcec8' and password=0 and (gamemode='openwaiting' or gamemode='openplaying') and gametype='stunt'

I've established the logic to the bug, when I apply a filter, it only filters out openplaying rooms while openwaiting rooms are left in as is. So that means gamemode='openplaying') and gametype='stunt' is treated as gamemode='openplaying' and gametype='stunt'.