Closed vtcifer closed 5 months ago
I believe you can? Look for the --without-frontend
type options. If you tell me a bit more about what you are looking for, I'll see if it's a gap.
If I understand what you mean, this is the subject of PR #285.
I'll take a look, pull that into my local repo and give it a test. Thanks for the heads up!
Finally got a chance to test this, and that looks almost certainly to be what I'd be looking for. Since genie can now accept command line arguments for login, looks like we might be able to use lich to launch genie seamlessly. I'll do some more testing later but looks super promising. Thanks!
So testing PR #285 in windows, and I get odd behavior trying to integrate genie with this.
If I fetch all the settings, launch genie manually using these commands, it connects succesfully to the game.
Genie.exe G:DR C:<character> H:storm.dr.game.play.net P:11024 K:<key>
If I launch lich in detached mode with no FE, I can connect successfully with genie using:
Genie.exe G:DR C:<character> H:localhost P:<port>
But if I try to have lich launch genie with the following custom details it fails.
2023-02-10 06:42:29: info: using custom launch command: Genie.exe G:DRT C:
Genie actually launches, but essentially looks like it loses the connection or never actually connects?
It almost looks like lich isn't actually listening for the incoming connection, or establishing the connection to the game. I'll try to get a packet capture later to get more details under the hood of what's happening network wise.
I guess also, what's the actual flow for those? I'd think it would be lich connects to game, but sends nothing, starts listening for the incoming FE connection, then launches the custom command.
That gameport looks suspicious. 11024, not sure where that 6 came from?
You can even see it in the success line earlier.
On Fri, Feb 10, 2023 at 7:00 AM Derek Hoffmann @.***> wrote:
So testing PR #285 https://github.com/elanthia-online/lich-5/pull/285 in windows, and I get odd behavior trying to integrate genie with this.
If I fetch all the settings, launch genie manually using these commands, it connects succesfully to the game.
Genie.exe G:DR C:
H:storm.dr.game.play.net P:11024 K: If I launch lich in detached mode with no FE, I can connect successfully with genie using:
Genie.exe G:DR C:
H:localhost P: But if I try to have lich launch genie with the following custom details it fails.
2023-02-10 06:42:29: info: using custom launch command: Genie.exe G:DRT C: H:localhost P:%port% K:%key% 2023-02-10 06:42:29: info: using working directory for custom launch command: G:\My Drive\G4 2023-02-10 06:42:29: info: gamehost: dr.simutronics.net 2023-02-10 06:42:29: info: gameport: 11624 2023-02-10 06:42:29: info: game: STORM 2023-02-10 06:42:29: info: launcher_cmd: Genie.exe G:DRT C: H:localhost P:50440 K:[scrubbed key]
Genie actually launches, but essentially looks like it loses the connection or never actually connects?
It almost looks like lich isn't actually listening for the incoming connection, or establishing the connection to the game. I'll try to get a packet capture later to get more details under the hood of what's happening network wise.
I guess also, what's the actual flow for those? I'd think it would be lich connects to game, but sends nothing, starts listening for the incoming FE connection, then launches the custom command.
— Reply to this email directly, view it on GitHub https://github.com/elanthia-online/lich-5/issues/279#issuecomment-1425713830, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEG5B4ZNOQNFEHBWAIUI2YDWWYUW3ANCNFSM6AAAAAAT7G7YSU . You are receiving this because you commented.Message ID: @.***>
Just an FYI, you need to make sure to pick Stormfront / Wrayth in the radio selection above, because that's how it decides which protocol to connect with and which port to use. It's not super obvious that that is still important when specifying a custom command. Stormfront / Wrayth should probably be the default because I think it's the protocol supported by the majority of third part clients.
That gameport looks suspicious. 11024, not sure where that 6 came from? You can even see it in the success line earlier.
That's DR Test (vs Prime / Plat / TF)
edit: screenshot of .sal file fetched from the play.net website
Just an FYI, you need to make sure to pick Stormfront / Wrayth in the radio selection above, because that's how it decides which protocol to connect with and which port to use. It's not super obvious that that is still important when specifying a custom command. Stormfront / Wrayth should probably be the default because I think it's the protocol supported by the majority of third part clients.
Yeah, STORM/Wrayth was selected, as you get a different port for non-xml connections even to the same game + instance.
Long term, I think a third option might be good for genie users that defaults similar to wizard/wrayth, but it would require knowledge of the exe path, since that's not fetchable from registry like wizard/wrayth are. I'm trying to dig into this to better understand but gtk is oof.jpg for me.
You shouldn't need to look at the GTK part at all. You probably want to look somewhere around here: https://github.com/sproctor/lich-5/blob/enable_custom_commands/lich.rbw#L4691
From what you wrote, I think your command might be wrong. It should be something like Genie.exe G:DR C:<character> H:localhost P:%port%
. I don't know Genie, the character thing looks specific to there, but the %port%
part should be entered exactly like that. Lich will replace it with the proper port. It's not the same as the server port.
From what you wrote, I think your command might be wrong. It should be something like
Genie.exe G:DR C:<character> H:localhost P:%port%
. I don't know Genie, the character thing looks specific to there, but the%port%
part should be entered exactly like that. Lich will replace it with the proper port. It's not the same as the server port.
That (port part at least) is what I put.
2023-02-10 06:42:29: info: using custom launch command: Genie.exe G:DRT C: H:localhost P:%port% K:%key%
My understanding of the custom commands there is it's more or less telling lich not to 'login' to the game (that is send the key) but relying on the FE to do so. It matches the templates that Wizard / Wrayth use.
Genie needs the DR+T to know which profile to load (DR vs DRT vs DRF can be different profiles within the FE itself)
In this test, I was using test environment instead of prime, but everything else was the same.
Sorry, I got a bit distracted and forgot to mention they key. Yeah, what you have looks correct to me.
I think the code path between the custom command, and just specifying wrayth/wizard/avalon is almost the same. In the latter case, the command is created around here: https://github.com/sproctor/lich-5/blob/enable_custom_commands/lich.rbw#L4587 The port and key are still passed to the client.
When run in daemon mode, it's different, but when run as a GUI, it always has the client send the key, AFAIK.
Lich does a terrible job of handling bad commands. I'll do a bit of research into that. In the meantime, you could change line https://github.com/sproctor/lich-5/blob/enable_custom_commands/lich.rbw#L4717 to print the command. Replace system with puts. Then try running the command yourself and see the result.
Ah yeah, I cheated to get the command on my linux box. I had the commmand set to be
bash -c "echo G:DRT C:<character> H:localhost P:%port% K:%key%"
. That was the first tests I did. :-)
The method I said should have the port and key replaced. It's weird. I don't have access to Windows currently to test it.
Adding some additional logging messages, and it appears lich never gets beyond this line.
https://github.com/elanthia-online/lich-5/blob/staging/lich.rbw#L4717
I've wrapped that line in additional logging like this, and this is where nothing else gets written to the log.
Lich.log("debug: launching now")
system ("start #{launcher_cmd}")
Lich.log("debug: launched")
2023-02-10 12:55:00: info: game: STORM
2023-02-10 12:55:00: info: launcher_cmd: Genie.exe G:DR C:<scrubbed char> H:localhost P:57919 K:[scrubbed key]
2023-02-10 12:55:00: debug: launching now
Genie DOES launch, but it's almost like the ruby executable gets replaced by the genie one. Same behavior if I use Wrayth with just the defaults too btw,..
2023-02-10 13:00:09: info: Lich 5.6.2
2023-02-10 13:00:09: info: Ruby 3.2.1
2023-02-10 13:00:09: info: x64-mingw-ucrt
2023-02-10 13:00:10: info: no force-mode info given
2023-02-10 13:00:57: info: Working against a Windows Platform for FE Executable
2023-02-10 13:00:57: info: Working against a Windows Platform for FE Location
2023-02-10 13:00:57: info: Current Windows working directory is C:\Program Files (x86)\SIMU\Wrayth
2023-02-10 13:00:57: info: gamehost: dr.simutronics.net
2023-02-10 13:00:57: info: gameport: 11024
2023-02-10 13:00:57: info: game: STORM
2023-02-10 13:00:57: info: launcher_cmd: Wrayth.exe /GDR/Hlocalhost/P58168/K[scrubbed key]
2023-02-10 13:00:57: debug: launching now
Also, it looks like when saving custom commands, on windows at least, the custom working directory doesn't get saved when using fully qualified (dive + path).
this should almost certainly be using Open3, otherwise it will block the ruby process: https://stackoverflow.com/questions/6338908/ruby-difference-between-exec-system-and-x-or-backticks#18623297
On Fri, Feb 10, 2023, 11:04 Derek Hoffmann @.***> wrote:
Adding some additional logging messages, and it appears lich never gets beyond this line.
https://github.com/elanthia-online/lich-5/blob/staging/lich.rbw#L4717
I've wrapped that line in additional logging like this, and this is where nothing else gets written to the code.
Lich.log("debug: launching now") system ("start #{launcher_cmd}") Lich.log("debug: launched")
2023-02-10 12:55:00: info: game: STORM 2023-02-10 12:55:00: info: launcher_cmd: Genie.exe G:DR C:
H:localhost P:57919 K:[scrubbed key] 2023-02-10 12:55:00: debug: launching now Genie DOES launch, but it's almost like the ruby executable gets replaced by the genie one. Same behavior if I use Wrayth with just the defaults too btw,..
2023-02-10 13:00:09: info: Lich 5.6.2 2023-02-10 13:00:09: info: Ruby 3.2.1 2023-02-10 13:00:09: info: x64-mingw-ucrt 2023-02-10 13:00:10: info: no force-mode info given 2023-02-10 13:00:57: info: Working against a Windows Platform for FE Executable 2023-02-10 13:00:57: info: Working against a Windows Platform for FE Location 2023-02-10 13:00:57: info: Current Windows working directory is C:\Program Files (x86)\SIMU\Wrayth 2023-02-10 13:00:57: info: gamehost: dr.simutronics.net 2023-02-10 13:00:57: info: gameport: 11024 2023-02-10 13:00:57: info: game: STORM 2023-02-10 13:00:57: info: launcher_cmd: Wrayth.exe /GDR/Hlocalhost/P58168/K[scrubbed key] 2023-02-10 13:00:57: debug: launching now
Also, it looks like when saving custom commands, on windows at least, the custom working directory doesn't get saved when using fully qualified (dive
- path).
— Reply to this email directly, view it on GitHub https://github.com/elanthia-online/lich-5/issues/279#issuecomment-1426157414, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIKHATWVPHHPKK44E7GBZDWWZ7JNANCNFSM6AAAAAAT7G7YSU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Following that SO link, and checking out the flowchart someone used, it almost feels like we'd rather use fork()? Do we really care what output the spawned process generates?
Digging further, about using fork on windows w.ruby, and https://stackoverflow.com/questions/5998130/using-fork-in-windows-with-ruby indicates spawn is implemented for windows, and testing it, it seems to work, including getting custom command to launch, connect, and fully authenticate to the game.
Just an FYI, you need to make sure to pick Stormfront / Wrayth in the radio selection above, because that's how it decides which protocol to connect with and which port to use. It's not super obvious that that is still important when specifying a custom command. Stormfront / Wrayth should probably be the default because I think it's the protocol supported by the majority of third part clients.
Getting back to this point we may want to let people know those radio buttons (WIZARD and STORMFRONT|WRAYTH) are more what 'protocol' do you want to use, or even just assume WRAYTH like you said going forward, and only allow users to select wizard under some "advanced options, only touch if you know what you're doing" checkbox.
I don't know if genie cares which directory is launched from. You can try putting the path in the command line c:\program files\genie\genie.exe ...
. My goal was to get things working with Warlock which doesn't care at all about the working directory. https://github.com/sproctor/warlock3
I'll look into the directory issue tomorrow if i have time.
I don't know if genie cares which directory is launched from. You can try putting the path in the command line
c:\program files\genie\genie.exe ...
. My goal was to get things working with Warlock which doesn't care at all about the working directory. https://github.com/sproctor/warlock3I'll look into the directory issue tomorrow if i have time.
I actually just found it, now that I had spawn working, and will submit a separate PR for it.
The custom dir works fine on Linux. What was the issue?
The custom dir works fine on Linux. What was the issue?
The details are in #292, but given how it manifests, I suspect it wasn't really saving the custom command directory, and was relying on linux referencing $PATH.
No, the bug only is only in the path where you don't save the entry. I only tested with saving the entry.
Re-reading this, I'm not sure which paths are taken when. custom_launch_dir is written in lich.rbw:4604. I guess that line is executed for me, but not you. I don't understand why though.
It's launching from the proper directory, I don't have the client in my path. My command is "./warlock3", so it won't check the path regardless.
Are you sure that mistake was the issue? It looks like custom_launch_dir
should be overwritten on the aforementioned line. It would be nice to combine/remove some of this logic so it's easier to follow.
That's not the right scope. That's where it reads the prior saved custom_launch_dir.
If you already had your account info setup from prior to move to lich5, this would not impact you. It only occurs when setting up new accounts/characters from within lich5.
Merged the PR associated with issue.
Currently, saving launch options for quick entry, you only have wizard/wrath. For those running on non-windows environments, I'd be nice to have the ability to specify custom options.