A crate to extract info from Guild Wars 2 MumbleLink and also allow to copy it to /dev/shm in linux
it will also get the x11 window id of the gw2 window and paste it at the end of the mumblelink data in /dev/shm. the format is simply 1193 bytes of useful mumblelink data AND an isize (for x11 window id of gw2). will sleep for 5 ms every frame (configurable), so will copy upto 200 times per second.
supports the following options in commandline arguments: * termlog: short: t help: max logging level to terminal stdout/stderr possiblevalues: [error, warn, info, debug, trace] takesvalue: true
* filelog:
short: l
help: max logging level to logfile
possible_values: [error, warn, info, debug, trace]
takes_value: true
* logfile:
short: f
help: the filepath to logfile.
takes_value: true
* mumble:
short: m
help: the mumble link name that gw2 uses
takes_value: true
* interval:
short: i
help: how often jokolink copies mumble data to /dev/shm in milliseconds
takes_value: true
* gwcheck:
short: g
help: how often jokolink checks if gw2 is alive (and quits if gw2 is not alive) in seconds
takes_value: true
sample script provided as run_jokolink.sh
```
link_name=MumbleLink
jl_tlog=debug
jl_flog=debug
jl_logfile=./jokolink.log
mumble_interval=5
gw2checkalive=5
$WINE "./jokolink.exe" -t $jltlog -l $jlflog -m $linkname -f $jllogfile -i $mumbleinterval -g $gw2check_alive & ```
jokolink.exe
and run_jokolink.sh
to that folder. you can change the variables as you need in the script. Show Advanced Options
is checked at the bottom of the window.Pre-launch script
, click on browse and select the run_jokolink.sh
file that we pasted in prefix folder./dev/shm/{link_name}
file with link_name replaced by the mumble link name (usually "MumbleLink" if you didn't change the variables).jokolink.log
(unless you changed the variable) file.the Jokolink.exe will keep on running in the background until gw2 is closed or crashed. then, all the prelaunch scripts and their child process will be killed by lutris with SIGTERM signal.
Jokolink needs to run with the same runner, prefix, env
as guild-wars-2. the most important ones are basically
1. runner. this is the wine executable that you will use to run gw2.
2. prefix. this is the wine prefix folder of gw2, and if you use a same prefix but different runner for jokolink while gw2 is already running, it will crash.
3. environment. primarily, the variables like WINE_FSYNC. these must also match or jokolink crash when used in the same prefix.
For best results, just use extract command like lutris guild-wars-2 --output-script ./gw2env.sh
which will output the script to a file named gw2env.sh
I posted mine here for completion. username is puppy. I was able to delete most stuff except the WINE, WINEPREFIX, WINEFSYNC
variables and it worked fine.
use a similar script to replace the last line for jokolink.exe and you should be good.
```
export SDLVIDEOFULLSCREENDISPLAY="off" export VKICDFILENAMES="/usr/share/vulkan/icd.d/nvidiaicd.json" export STEAMRUNTIME="/home/puppy/.local/share/lutris/runtime/steam" export LDLIBRARYPATH="/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/lib:/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/lib64:/usr/lib/libfakeroot:/usr/lib/opencollada:/usr/lib/openmpi:/usr/lib32:/usr/lib:/usr/lib64:/home/puppy/.local/share/lutris/runtime/lib32:/home/puppy/.local/share/lutris/runtime/steam/i386/lib/i386-linux-gnu:/home/puppy/.local/share/lutris/runtime/steam/i386/lib:/home/puppy/.local/share/lutris/runtime/steam/i386/usr/lib/i386-linux-gnu:/home/puppy/.local/share/lutris/runtime/steam/i386/usr/lib:/home/puppy/.local/share/lutris/runtime/lib64:/home/puppy/.local/share/lutris/runtime/steam/amd64/lib/x8664-linux-gnu:/home/puppy/.local/share/lutris/runtime/steam/amd64/lib:/home/puppy/.local/share/lutris/runtime/steam/amd64/usr/lib/x8664-linux-gnu:/home/puppy/.local/share/lutris/runtime/steam/amd64/usr/lib:$LDLIBRARYPATH" export DXVKHUD="0" export DXVKLOGLEVEL="none" export STAGINGSHAREDMEMORY="1" export _GLSHADERDISKCACHEPATH="/home/puppy/game/guild-wars-2" export _NVPRIMERENDEROFFLOAD="1" export WINEDEBUG="-all" export WINEARCH="win64" export WINE="/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/bin/wine" export GSTPLUGINSYSTEMPATH10="/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/lib64/gstreamer-1.0/:/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/lib/gstreamer-1.0/" export WINEPREFIX="/home/puppy/game/guild-wars-2" export WINEESYNC="1" export WINEFSYNC="1" export WINEDLLOVERRIDES="winemenubuilder.exe=d" export WINELARGEADDRESSAWARE="1" export TERM="xterm"
/home/puppy/.local/share/lutris/runners/wine/lutris-gw2-6.14-3-x8664/bin/wine '/home/puppy/game/guild-wars-2/drivec/Program Files/Guild Wars 2/GW2-64.exe' -autologin -Windowed%
```
the following only needs to be considered IF you are not running on lutris:
the gw2checkalive variable in script is provided to check if gw2 process is still alive and exit if gw2 is not running. but this only works IF the mumblelink is initialized, so if player never reaches it will keep on running forever. this is a feature, as we don't know how long the user will keep on being afk at the character select screen. i myself often start gw2 and go make snacks etc.. and i don't want to restart gw2 when i am back because jokolink killed itself waiting for me to login. but i will expose a timeout feature IF someone asks for it :) with a default of no timeout. I suggest removing the trailing
&
, then the script will block until you close it yourself, which will kill jokolink too.
As this crate contains both linux specific and windows specific stuff, I recommend keeping the linux stuff in linux.rs and windows stuff in win.rs .
Also, remember to make sure to run cargo check --target=x86_64-pc-windows-gnu
to check if windows stuff is working well and cargo check --target=x86_64-unknown-linux-gnu
to check if linux stuff is good.
goes without saying, but you need rustup.rs
to install both of the above target's support on linux.
I set the default target to x86_64-pc-windows-gnu
in the .cargo/config.toml
along with options for linkers to mingw toolchain. in case, you use another distro and find any compile issues, that's where you need to check for issues.
you will need to install the mingw toolchain to crosscompile the jokolink.exe . I already set the options in .cargo/config.toml
and usually should be good as long as you installed mingw packages. edit the run_jokolink.sh pre-launch script in lutris so that it points to the ./target/x86_64-pc-windows-gnu/release/jokolink.exe
or the debug one, so that you an just do cargo build --release
to compile it fast and launch gw2 to test if it works. try to log everything so that you can check the logs, instead of bothering with getting logs from lutris.
you will need to edit the .cargo/config.toml
and comment out everything. you will probably want to use the msvc toolchain instead of the gnu one.
x86_64-pc-windows-msvc
is the default target usually if you commented out the stuff as mentioned above. you will probably not run the binary part of crate as that's for wine usage, you will mostly be interested in the library part, so don't touch main.rs
. if you want to develop for wine, use linux as its faster to check for errors live rather than dual booting back and forth to REPL.
please make an issue BEFORE you start work on anything. Most of the work remaining is just getting it more type safe with wrapper types like for example ```
pub struct MapID(u32) ``` We will need such wrapper types for fields of MumbleLink, also Units based wrapper types for continent coords or pixels or radians etc.. All of this is blocked on my JokoApi crate where i plan to introduce all the API exposed types.