aitoiaita / linux-jagex-launcher

A native Linux Jagex account launcher for Oldschool Runescape
12 stars 5 forks source link

Several issues regarding compilation, redirect_uri and mimetype #3

Open FMudanyali opened 3 months ago

FMudanyali commented 3 months ago

OS: Arch Linux 32 Compiler: Rust 1.80 stable Machine: Thinkpad z60m

Hi, I came across several issues trying to run this application and managed to fix them.

The first one is compilation error due to the package time v0.3.29, I removed this package from Cargo.lock, which caused cargo to pull the latest version 0.3.36 which compiled successfully.

The second issue is related to #2 caused by missing redirect_uri parameter in the auth URL. Even with the latest commit, this parameter is absent from the URL, so I appended &redirect_uri=https://secure.runescape.com/m=weblogin/launcher-redirect to the URL and it worked. However, when the authorization was done, it did not redirect to the application because there were no programs registered to open the URL jagex:code=XXXX,state=XXXX.

In order to fix this, I created the file ~/.local/share/applications/osrs-launcher.desktop with following contents:

[Desktop Entry]
Version=1.0
Name=OSRS Launcher
Exec=/home/USERNAME/.local/bin/osrs-launcher %u
Terminal=true
Type=Application
MimeType=x-scheme-handler/jagex

And then I updated the MIME database with following command:

update-desktop-database ~/.local/share/applications

Finally, I set the newly created .desktop file as the default for x-scheme-handler/jagex type with following command:

xdg-mime default osrs-launcher.desktop x-scheme-handler/jagex

Now, when I open the program from osrs-launcher.desktop and append redirect_uri parameter to the URL, the authorization works as expected and I am able to play with my desired character.

pulsemod commented 1 month ago

I was able to get this working on FreeBSD 14.1 after creating the desktop file and registering the MIME type as shown above.

Since binding to ports < 1024 is naturally not permitted for an unprivileged process on most UNIX systems, I built with a much higher default port number. The page opened to choose a character still points to port 80 regardless in the current code.

Seems like there's nothing Linux specific about this software otherwise? :smile: Thanks for writing something allowing people who can't use the Jagex Launcher to play.