Im not the happiest with this code, its heavily hardcoded for LBPK, but sadly we dont have any more advanced heuristics here, due to LBPK storing the server as separate host and port fields.
Note the port detection code may seem prone to false-positives, but, in reality, its not likely to ever get hit outside of LBPK, since 0x00, 0x00, 0x27, 0x42, 0x00, 0x00, 0x27, 0x43 is not valid assembly in any ISA, and the particular sequence of byte is unlikely to ever occur unless its the numbers 10050, 10051, but i would still like to put this code behind an "LBPK" blocker somehow, although im unsure of how to go about it (maybe only run this code if we find an LBPK url?) Marking as draft to be able to discuss this, reviews still wanted though.
Closes #34
Tested working with the latest digital copy of the game (1.20)
Im not the happiest with this code, its heavily hardcoded for LBPK, but sadly we dont have any more advanced heuristics here, due to LBPK storing the server as separate host and port fields.
Note the port detection code may seem prone to false-positives, but, in reality, its not likely to ever get hit outside of LBPK, since
0x00, 0x00, 0x27, 0x42, 0x00, 0x00, 0x27, 0x43
is not valid assembly in any ISA, and the particular sequence of byte is unlikely to ever occur unless its the numbers10050
,10051
, but i would still like to put this code behind an "LBPK" blocker somehow, although im unsure of how to go about it (maybe only run this code if we find an LBPK url?) Marking as draft to be able to discuss this, reviews still wanted though.Closes #34
Tested working with the latest digital copy of the game (1.20)