djhackersdev / bemanitools

Runs recent Konami arcade games and emulates various arcade hardware.
The Unlicense
84 stars 16 forks source link

Missing URL Path of Request When Launching Legacy bemanitools #95

Closed icex2 closed 1 year ago

icex2 commented 2 years ago

In GitLab by @Kizuna on Apr 29, 2022, 15:01

Summary

I am trying to use a self-build eamuse server for previous IIDX versions (9-17). But seems bemanitools missed the URL path and only called with hostname and port.

Expected behavior

(e.g. I set eamuse.server=http://localhost:8888/somepath)

Expecting tools will call http://localhost:8888/somepath

Current behavior

Actually it called http://localhost:8888, which resulted in response code 404. (The server did no routing for default path)

Context (Environment)

Bemanitools version(s) affected

Game(s) and version(s) affected

Log output

See attachment. log.txt

Seems to be the root cause -> [2022/04/29 20:51:42] I:eamuse-hook: Target eamuse server http://localhost:8888/somepath resolved to 127.0.0.1:8888

icex2 commented 2 years ago

Hey, thank you for reporting this. I had to dig into the code for a moment to understand why we don't have this working. Unfortunately, it is not something we can make work with the older IIDX titles due to how the game's networking code is handling remote server addresses, see also the comment here. It is not explicit about the issue, but we cannot resolve more than a URL without path to a IP (v4) address. We always lose the path part, e.g. http://localhost:8888/somepath -> /somepath as there is no way for us to tell the game this when we exit the hook (to my knowledge).

The path part is on the HTTP protocol layer which would require us to hook into the game's netcode that deals with the XRPC related stuff (or some common foundation to that, since this is just XML payload on top of more or less standard HTTP).

For your server, I see the following options to be able to handle the current situation:

icex2 commented 2 years ago

In GitLab by @Kizuna on May 25, 2022, 16:21

Many thanks for your explanation! I can turn to use root endpoint if it is a known issue.