-
Notifications
You must be signed in to change notification settings - Fork 3
Investigate Overlay #8
Comments
Even if its just to learn something from the both of them, compare how the mac one works vs windows |
Could possibly look into running command line and run the overlay exe within the wine prefix. |
May be able to use /proc/%processid%/environ to find what to run the process with to get it running in the same environment |
px aux | grep "C:/Riot Games/League of Legends/LeagueClient.exe" |
The overlay injector process seems to be able to spawn in wine just fine using the below code const child_process = require('child_process');
const test = child_process.spawn('mobalytics_overlay.exe');
const {stdout, stderr} = test;
if (stdout) {
stdout.on('data', (data) => {
console.log(`stout data, data: ${data}`);
});
stdout.on('close', (code, signal) => {
console.log(`stout was closed, code: ${code}, signal: ${signal}`);
});
stdout.on('error', (err) => {
console.log(`stout error: ${err}`);
});
stdout.on('exit', (code, signal) => {
console.log(`stout exit, code: ${code}, signal: ${signal}`);
});
stdout.on('message', (message) => {
console.log(`stout, message: ${message}`);
});
}
if (stderr) {
stderr.on('data', (data) => {
console.log(`stderr, data: ${data}`);
});
stderr.on('close', (code, signal) => {
console.log(`stderr was closed, code: ${code}, signal: ${signal}`);
});
stderr.on('error', (err) => {
console.log(`stderr error: ${err}`);
});
stderr.on('exit', (code, signal) => {
console.log(`stderr exit, code: ${code}, signal: ${signal}`);
});
stderr.on('message', (message) => {
console.log(`stderr, message: ${message}`);
});
}
test.on('close', (code, signal) => {
console.log(`was closed, code: ${code}, signal: ${signal}`);
});
test.on('error', (err) => {
console.log(`error: ${err}`);
});
test.on('exit', (code, signal) => {
console.log(`exit, code: ${code}, signal: ${signal}`);
});
test.on('message', (message) => {
console.log(`exit, message: ${message}`);
});
test.on('spawn', (message) => {
console.log(`overlay injector spawned`, {message});
});
|
At least the spawn events are triggered, need to look to create a connection layer and possibly create a new process spawner exe file using https://www.npmjs.com/package/pkg with |
Look for the best way to spawn and pipe the data back into the other side. |
To test it you must use |
Easiest way to test rapidly. Create a node script which you run directly trying to test the exe. Just raw everything. |
You can spawn processes fine inside if you have console.log outputs. However you lose access to stdout and stderr, you didn't have access anyway because of wine. Look to make a socket pipe for any that are needed and just look for the spawn other events. |
More of it is now running, possibly try moving the files within the file system first and see if it fixes wine: Read access denied for device L"\??\Z:\", FS volume label and serial are not available |
https://forum.winehq.org/viewtopic.php?f=8&t=33574 may be similar error |
In the most recent edits league stutters (I assume its while its injecting) just need to connect the sdout and other parts now hopefully :D Seems the error was it was trying to run from the wrong directory |
The next part is trying to figure out what electron_overlay provides |
Look into https://nodejs.org/api/net.html#netcreateconnectionpath-connectlistener and using it to connect info back to the other side. Possibly try to create an IPC module restructurer. |
The module is creatable when the module is enabled in windows. The main reason the overlay app can't just be run in windows is the fact that the visuals are entirely fucked for electron. Take a look to see if it may be easier to wrap a larger part of the program in this rather than small parts. Though from now on it doesn't seem like processes but ipc messages and function calls. Though this module at least has to be in league otherwise it cant read the league memory. |
For now instead of IPC use sockets on specific ports then try to connect in and out of wine |
possibly try connecting everything through one socket for now and add an identifier at the start. Or use env args to state the ports to connect through. |
Seems |
Error with nexe instead is `Processes utils | stderr, data: node:internal/modules/cjs/loader:1183 Error: /home/sekwah/.config/mobalytics-desktop/moba-extra-resources/overlay-module/1.0.0/win/electron_overlay.node: invalid ELF header |
When switching to node windows x64-14 it seems to get Error: EINVAL: invalid argument, lstat 'Z:' |
Using a lower version of node with pkg seems to remove the issues of pkg (though havent checked importing yet) |
Seems the issue may be because its on the wrong drive C:\ -> Z:\ in wine |
Copying files to a temp folder seems to do the trick |
Problem is uv_pipe_open issue is back, using pkg helped and seems to be better when not using wine and this specific use case |
the problem is with nexe that it seems to detect that its linux and fuck everything up |
Looking at all the events being send its getting ALL of the data. I just need to force spawn the overlay and recode any parts which are being dodgy. |
Seems to be something in lol-overlay-window or base-overlay-window. |
game-overlay-manager createOverlayWindow isnt even called |
ensureOverlayWindow in game-overlay-manager does get called |
so does createOverlayWindow making a lol overlay window |
The overlay window is deffo made using ensureOverlayWindow |
The overlay window controller is being made but not the this.window 🤔 |
Need to find why the overlay window objects exist but not the window variable inside |
If its found that the windows one wont work try looking at the mac overlay as it may not need the injection |
The problems may not lie in the lol overlay as the .create function is not called. It may be to do with the base overlay or something else not being able to get size data or process id's. |
There seems to be an error with the overlay server path. Going to try sockets too. |
May need to convert the overlay-server to connect to a port and then pipe the data from
to the ports |
Look to make a proxy on two unused ports for each of these files then rewrite how the base-overlay-server connects so that the injector written by mobalytics properly is connected. |
Probably best to not rewrite the logic but to connect our own logic to where it is expecting the data. That way it can be handled solely in our connector classes. |
Finally found why all the logs were not going to console, now can debug a lot more :D |
Proxy is now working one way. Need to now pipe the data and dynamically create the connections going the other way. |
May need to seperate the process injector to another process. Or you may be able to just keep the process around and running. |
now the errors are trying to get the tmp files for specific processes. 2021-11-15T03:26:52.880Z error: Overlay server | connection to injector error, app name: league of legends.exe pid: 1604 {"error":{"errno":-2,"code":"ENOENT","syscall":"connect","address":"/tmp/MOBA-OVERLAY-CLIENT-1604"}} |
An econnreset is happening likely due to this |
Need to look into why translateInputEvent is returning empty data, though for now no input is better so fixed the crash error. Looking into making it interact after rendering is working. |
The client constantly keeps trying to recreate the connections, so making it lazily is no issue, just need to use the connector to set it up on a free port and presto we should be good :D |
For some reason, 'get-port' is suddenly messing up.
|
Need to look into whats causing the new promise issues. |
Looks like most things are now connected, however there is a problem with the frame buffers being serialised. Data exists however the logic in sendFrameBuffer in base-overlay-provider errors on the OverlayIPC.Event.createEvent line. Need to check the data being passed in and possibly try to preview one of the bitmap buffers. |
For now it is not a priority though it seems pretty close to possibly working. I will have to focus on my other projects for now but ill still try to tinker with this :D |
Hi @sekwah41 , are you still working on this issue? It would be a great thing if you manage to have the in-game overlay working as it would be the first overlay for LoL working in Linux. |
I can re-try the steps I made to see if I can get further. Last time I got pretty and managed to inject processes within the wine process to get data back, though I would need to still push the overlay data back or find another way of rendering it on top hopefully not going back within wine to avoid as much fps loss. Ill add some tasks onto my organiser and see when i get around to it or have a weekend to experiment :) |
Amazing. I think that also a wine version could be fine because at least we would have a working overlay even if there will be less FPS (I think this is also negligible, I hope in 2023 almost everyone should be capable to run League of Legends without FPS problems) |
Not sure how dodgy the stuff I was doing was so thats why I was trying to figure out. |
See what other features e.g. the overlay and how they work.
May not be able to get it working though may be able to add info on how to get it working directly in wine?
The text was updated successfully, but these errors were encountered: