LeonardFiedrowicz / galaxy-integration-yuzu

Yuzu integration plugin for GOG Galaxy 2.0
Apache License 2.0
23 stars 3 forks source link

Game detection #2

Closed Brummos closed 2 years ago

Brummos commented 4 years ago

Hi,

I cannot get game detection working. Plugin is running, location to roms is set. But games are not showing.

Anything i should check?

LeonardFiedrowicz commented 4 years ago

Hm, I don't currectly have logs implemented to check where it went wrong but maybe send me the log file anyway. It's located at C:\ProgramData\GOG.com\Galaxy\logs\plugin-nswitch-b627be67-44e5-40f5-a482-6e52bf967ea1.log

Autodecting yuzu only works if you have yuzu at the default location by the way. I require the prod.keys file from yuzu so if I can't find those I can't decrypt the games.

LeonardFiedrowicz commented 4 years ago

I added some more debug stuff for the log in the latest version (not in the releases yet, just replace the plugin.py file).

Brummos commented 4 years ago

Alright, I replaced the plugin.py. This is the logging.

edit* updated logging as the paths were empty by replacing the file also setting the emulator path to the default yuzu location doesn't help

2020-01-04 18:01:44,088 - root - DEBUG - Using proactor: IocpProactor
2020-01-04 18:01:44,089 - galaxy.api.plugin - INFO - Using local address: 127.0.0.1:51250
2020-01-04 18:01:44,089 - galaxy.api.plugin - INFO - Creating plugin for platform nswitch, version 0.2
2020-01-04 18:01:44,857 - galaxy.api.jsonrpc - DEBUG - Received 66 bytes of data
2020-01-04 18:01:44,857 - galaxy.api.jsonrpc - INFO - Handling request: id=0, method=get_capabilities, params={}
2020-01-04 18:01:44,858 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "0", "result": {"platform_name": "nswitch", "features": ["LaunchGame", "ImportInstalledGames", "ImportOwnedGames"], "token": "eddc9011-463d-4a14-90e8-db233a1d7083"}}
2020-01-04 18:01:44,931 - galaxy.api.jsonrpc - DEBUG - Received 75 bytes of data
2020-01-04 18:01:44,931 - galaxy.api.jsonrpc - INFO - Handling request: id=1, method=initialize_cache, params={'data': '****'}
2020-01-04 18:01:44,931 - galaxy.task_manager - DEBUG - Task manager plugin internal: creating task 0 (tick)
2020-01-04 18:01:44,931 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "1", "result": null}
2020-01-04 18:01:45,083 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-04 18:01:45,083 - galaxy.api.jsonrpc - INFO - Handling request: id=2, method=ping, params={}
2020-01-04 18:01:45,083 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "2", "result": null}
2020-01-04 18:01:45,238 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-04 18:01:45,238 - galaxy.api.jsonrpc - INFO - Handling request: id=3, method=import_local_games, params={}
2020-01-04 18:01:45,238 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 0 (import_local_games)
2020-01-04 18:01:45,238 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 0 (import_local_games)
2020-01-04 18:01:45,238 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 0 (import_local_games)
2020-01-04 18:01:45,238 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "3", "result": {"local_games": []}}
2020-01-04 18:01:45,239 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 0 (import_local_games)
2020-01-04 18:01:45,347 - galaxy.api.jsonrpc - DEBUG - Received 169 bytes of data
2020-01-04 18:01:45,347 - galaxy.api.jsonrpc - INFO - Handling request: id=4, method=init_authentication, params={'stored_credentials': '****'}
2020-01-04 18:01:45,348 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 1 (init_authentication)
2020-01-04 18:01:45,348 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 1 (init_authentication)
2020-01-04 18:01:45,348 - root - DEBUG - ROMs Path: E:\Games Console\Switch
2020-01-04 18:01:45,348 - root - DEBUG - Yuzu Path: E:\Emulators\Yuzu
2020-01-04 18:01:45,348 - galaxy.api.jsonrpc - INFO - Sending notification: method=store_credentials, params={'roms_path': '****', 'emulator_path': '****'}
2020-01-04 18:01:45,348 - galaxy.api.jsonrpc - DEBUG - Sending 144 bytes of data
2020-01-04 18:01:45,349 - root - DEBUG - Keys Path: E:\Emulators\Yuzu\user\keys\
2020-01-04 18:01:45,351 - root - DEBUG - NX_Game_Info.exe Path: C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\nxgameinfo\nxgameinfo_cli.exe
2020-01-04 18:01:45,452 - root - DEBUG - Decoding NX_Game_Info Output...
2020-01-04 18:01:45,452 - root - DEBUG - Decoded NX_Game_Info Output.
2020-01-04 18:01:45,452 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 1 (init_authentication)
2020-01-04 18:01:45,453 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "4", "result": {"user_id": "a_high_quality_Yuzu_user", "user_name": "E:\\Games Console\\Switch"}}
2020-01-04 18:01:45,453 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 1 (init_authentication)
2020-01-04 18:01:46,111 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-04 18:01:46,111 - galaxy.api.jsonrpc - INFO - Handling request: id=5, method=import_owned_games, params={}
2020-01-04 18:01:46,111 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 2 (import_owned_games)
2020-01-04 18:01:46,111 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 2 (import_owned_games)
2020-01-04 18:01:46,111 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-04 18:01:46,111 - galaxy.api.jsonrpc - INFO - Handling request: id=6, method=import_local_games, params={}
2020-01-04 18:01:46,111 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 3 (import_local_games)
2020-01-04 18:01:46,111 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 2 (import_owned_games)
2020-01-04 18:01:46,111 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 3 (import_local_games)
2020-01-04 18:01:46,112 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "5", "result": {"owned_games": []}}
2020-01-04 18:01:46,112 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 2 (import_owned_games)
2020-01-04 18:01:46,112 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 3 (import_local_games)
2020-01-04 18:01:46,112 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "6", "result": {"local_games": []}}
2020-01-04 18:01:46,112 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 3 (import_local_games)
2020-01-04 18:01:50,099 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-04 18:01:50,099 - galaxy.api.jsonrpc - INFO - Handling request: id=7, method=ping, params={}
2020-01-04 18:01:50,099 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "7", "result": null}
2020-01-04 18:01:55,113 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-04 18:01:55,113 - galaxy.api.jsonrpc - INFO - Handling request: id=8, method=ping, params={}
2020-01-04 18:01:55,113 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "8", "result": null}
2020-01-04 18:02:00,177 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-04 18:02:00,177 - galaxy.api.jsonrpc - INFO - Handling request: id=9, method=ping, params={}
2020-01-04 18:02:00,177 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "9", "result": null}
LeonardFiedrowicz commented 4 years ago

Hm, looks alright besides it not finding any games... Can you check if in the nxgameinfo folder is the prod.keys file? It looks like you created a user folder in the yuzu folder where the keys folder should be, is that correct or do you have the keys folder elsewhere? Also, I uploaded another update to the plugin.py where it should add what nxgameinfi_cli.exe returns to the log (the program I use to gather the game meta data).

You could also try to open a console, change the directory and call the nxgameinfo_cli.exe with parameter -z followed by your rom folder path if you are familier with that. Should return the same thing as the newer plugin.py would so its not really needed.

Brummos commented 4 years ago

Ok so, there is a prod.keys in the nxgameinfo folder. That is correct i did create that folder. I couldn't get the cmd to work, but when i open the application and browse to the rom folder it shows my 2 games.

i used the new plugin.py to generate a new log

2020-01-11 00:02:30,872 - root - DEBUG - Using proactor: IocpProactor
2020-01-11 00:02:30,873 - galaxy.api.plugin - INFO - Using local address: 127.0.0.1:61708
2020-01-11 00:02:30,873 - galaxy.api.plugin - INFO - Creating plugin for platform nswitch, version 0.2
2020-01-11 00:02:30,919 - galaxy.api.jsonrpc - DEBUG - Received 66 bytes of data
2020-01-11 00:02:30,920 - galaxy.api.jsonrpc - INFO - Handling request: id=0, method=get_capabilities, params={}
2020-01-11 00:02:30,920 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "0", "result": {"platform_name": "nswitch", "features": ["ImportOwnedGames", "ImportInstalledGames", "LaunchGame"], "token": "de984998-d92a-4594-887d-1fde32658758"}}
2020-01-11 00:02:31,126 - galaxy.api.jsonrpc - DEBUG - Received 75 bytes of data
2020-01-11 00:02:31,126 - galaxy.api.jsonrpc - INFO - Handling request: id=1, method=initialize_cache, params={'data': '****'}
2020-01-11 00:02:31,126 - galaxy.task_manager - DEBUG - Task manager plugin internal: creating task 0 (tick)
2020-01-11 00:02:31,126 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "1", "result": null}
2020-01-11 00:02:31,143 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-11 00:02:31,143 - galaxy.api.jsonrpc - INFO - Handling request: id=2, method=ping, params={}
2020-01-11 00:02:31,143 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "2", "result": null}
2020-01-11 00:02:32,457 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-11 00:02:32,457 - galaxy.api.jsonrpc - INFO - Handling request: id=3, method=import_local_games, params={}
2020-01-11 00:02:32,457 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 0 (import_local_games)
2020-01-11 00:02:32,457 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 0 (import_local_games)
2020-01-11 00:02:32,457 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 0 (import_local_games)
2020-01-11 00:02:32,457 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "3", "result": {"local_games": []}}
2020-01-11 00:02:32,457 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 0 (import_local_games)
2020-01-11 00:02:32,566 - galaxy.api.jsonrpc - DEBUG - Received 69 bytes of data
2020-01-11 00:02:32,566 - galaxy.api.jsonrpc - INFO - Handling request: id=4, method=init_authentication, params={}
2020-01-11 00:02:32,566 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 1 (init_authentication)
2020-01-11 00:02:32,567 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 1 (init_authentication)
2020-01-11 00:02:32,567 - root - DEBUG - ROMs Path: E:/Games Console/Switch
2020-01-11 00:02:32,567 - root - DEBUG - Yuzu Path: C:/Users/Brummos/AppData/Local/yuzu/yuzu-windows-msvc
2020-01-11 00:02:32,567 - galaxy.api.jsonrpc - INFO - Sending notification: method=store_credentials, params={'roms_path': '****', 'emulator_path': '****'}
2020-01-11 00:02:32,567 - galaxy.api.jsonrpc - DEBUG - Sending 176 bytes of data
2020-01-11 00:02:32,567 - root - DEBUG - Keys Path: C:\Users\Brummos\AppData\Roaming\yuzu\keys\
2020-01-11 00:02:32,569 - root - DEBUG - NX_Game_Info.exe Path: C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\nxgameinfo\nxgameinfo_cli.exe
2020-01-11 00:02:32,661 - root - DEBUG - Decoding NX_Game_Info Output...
2020-01-11 00:02:32,661 - root - DEBUG - Decoded NX_Game_Info Output.
2020-01-11 00:02:32,661 - root - DEBUG - The screen cannot be set to the number of lines and columns specified.
2020-01-11 00:02:32,661 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 1 (init_authentication)
2020-01-11 00:02:32,661 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "4", "result": {"user_id": "a_high_quality_Yuzu_user", "user_name": "E:/Games Console/Switch"}}
2020-01-11 00:02:32,662 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 1 (init_authentication)
2020-01-11 00:02:33,224 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-11 00:02:33,224 - galaxy.api.jsonrpc - INFO - Handling request: id=5, method=import_owned_games, params={}
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 2 (import_owned_games)
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 2 (import_owned_games)
2020-01-11 00:02:33,225 - galaxy.api.jsonrpc - DEBUG - Received 68 bytes of data
2020-01-11 00:02:33,225 - galaxy.api.jsonrpc - INFO - Handling request: id=6, method=import_local_games, params={}
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 3 (import_local_games)
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 2 (import_owned_games)
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 3 (import_local_games)
2020-01-11 00:02:33,225 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "5", "result": {"owned_games": []}}
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 2 (import_owned_games)
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager plugin external: finished task 3 (import_local_games)
2020-01-11 00:02:33,225 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "6", "result": {"local_games": []}}
2020-01-11 00:02:33,225 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: finished task 3 (import_local_games)
2020-01-11 00:02:36,198 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-11 00:02:36,198 - galaxy.api.jsonrpc - INFO - Handling request: id=7, method=ping, params={}
2020-01-11 00:02:36,199 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "7", "result": null}
2020-01-11 00:02:41,281 - galaxy.api.jsonrpc - DEBUG - Received 54 bytes of data
2020-01-11 00:02:41,281 - galaxy.api.jsonrpc - INFO - Handling request: id=8, method=ping, params={}
2020-01-11 00:02:41,281 - root - DEBUG - Sending data: {"jsonrpc": "2.0", "id": "8", "result": null}
LeonardFiedrowicz commented 4 years ago

The NXGameInfo tool returns the error The screen cannot be set to the number of lines and columns specified. it seems. Seems to be an error related to the windows command interface. Googled the error and found some solution https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb491037(v=technet.10)?redirectedfrom=MSDN

Brummos commented 4 years ago

Things is I don't use cmd but powershell as default with windows 10. when i try to run cmd, nothing even happens. So maybe this is why?

LeonardFiedrowicz commented 4 years ago

Probably. I don't use the cmd either but I guess the python subprocess library does. Maybe I can change that, would need to look into that later. Did you try that fix, maybe that makes your cmd work again.

Brummos commented 4 years ago

I think i fixed the problem with cmd. I now get a problem with Nx game,

2020-01-12 15:25:45,891 - root - DEBUG - Decoding NX_Game_Info Output...
2020-01-12 15:25:45,892 - galaxy.api.jsonrpc - ERROR - Unexpected exception raised in plugin handler
Traceback (most recent call last):
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\galaxy\api\jsonrpc.py", line 271, in handle
    result = await callback(*bound_args.args, **bound_args.kwargs)
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\galaxy\api\plugin.py", line 283, in method
    result = await handler_(*args, **kwargs)
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\galaxy\api\plugin.py", line 295, in wrapper
    return await self._external_task_manager.create_task(handler(*args, **kwargs), name, False)
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\galaxy\task_manager.py", line 21, in task_wrapper
    result = await coro
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\plugin.py", line 254, in pass_login_credentials
    return self.finish_login()
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\plugin.py", line 226, in finish_login
    self.parse_games()
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\plugin.py", line 203, in parse_games
    self.games = get_games()
  File "C:\Users\Brummos\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\plugin.py", line 306, in get_games
    game_list_lines = game_list_unstructured.decode().splitlines()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 120: invalid continuation byte
Brummos commented 4 years ago

ok so i may have fixed it by changing

game_list_lines = game_list_unstructured.decode().splitlines()

to

game_list_lines = game_list_unstructured.decode("ISO-8859-1").splitlines()

but only 1 out of 2 games is showing up, both show up using nx game info

.xci and .nsp both supported?

LeonardFiedrowicz commented 4 years ago

I've had that error before where restarting the plugin fixed it for some reason. The output from nxgameinfo should be utf8 and .decode() uses utf8 so I'm not sure whats wrong there. .xci and .nsp should both be supported. I don't have a .xci to try but nxgameinfo should handle it.

BluePlasticCup commented 4 years ago

Game detection is still wonky. NSP games show up but XCI ones do not.

LeonardFiedrowicz commented 4 years ago

Would you mind opening a powershell and write cd "C:\Users\[your windows user name]\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu\nxgameinfo" (change the username there though) and then .\nxgameinfo_cli.exe -z "[your switch rom path]" and check if .xci show up there? If not try -nsz instead of -z and check again, I think that parameter enables both types but I'm not sure.

BluePlasticCup commented 4 years ago

XCI files show up though they appear to be marked as updates. Probably why they're not listed in galaxy. image

LeonardFiedrowicz commented 4 years ago

Most likely, maybe asked on this repository https://github.com/garoxas/NX_Game_Info That's the software I'm using to decrypt and gather the meta data, using the command line interface.

BluePlasticCup commented 4 years ago

Got it. Thank you.

SupremeTitan48 commented 3 years ago

Hello I've been having the same issue where an XCI file is shown as an update, have there been any fixes or am I out of luck (Yes I've seen the other repository, I don't understand all that stuff).

jasjeetsuri commented 3 years ago

Just change this line in "C:\Users\USERNAME\AppData\Local\GOG.com\Galaxy\plugins\installed\galaxy-integration-yuzu-master\plugin.py"

if "Base" in game_list_lines[i+16] and len(game_list_lines[i+21]) < 11: # Check if its a base game and if error line is empty

to if len(game_list_lines[i+21]) < 11: # Check if its a base game and if error line is empty

SupremeTitan48 commented 3 years ago

It worked!! Thank you so much!!!

Cid-Lothbrock commented 3 years ago

Hi. I can't get any game detected by the plugin. Is this still being developed?

PandaJoueur commented 3 years ago

For me, It doesn't want to detect my Animal Crossing New Horizons game on Yuzu.

hyoretsu commented 2 years ago

I once got a single game to be detected, but now no games get detected. Is there maybe an incompatibility with multicontent NSP?