Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adhoc] Gran Turismo is stuck at "waiting for other players" after race start #13366

Closed
ghost opened this issue Aug 31, 2020 · 17 comments · Fixed by #13375
Closed

[Adhoc] Gran Turismo is stuck at "waiting for other players" after race start #13366

ghost opened this issue Aug 31, 2020 · 17 comments · Fixed by #13375

Comments

@ghost
Copy link

ghost commented Aug 31, 2020

What happens?

The game is stuck at "waiting for other players" even though all players are ready.

What should happen?

The race should start normally.

Note: tried over multiple instances and not over the internet.

Pictures of the game and logs:

image

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Looks like the target peer member is no longer in the member list, i'll check that out.

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Hmm.. this is a strange bug indeed.
Based on this logs:
image
The correct MAC address is 93:3a:0f:23:61:a2 but the one passed as argument is 92:3a:0f:23:61:a2 not sure how the first byte got corrupted like this, this never happened on other games

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Hmm.. it's also possible that the API is only checking for the last 4 bytes (for optimization reason) instead of the full 6 bytes of MAC address, since the 1st 3 bytes (OUI) of MAC address is used to identifies the manufacturer, they're most-likely the same on each PSP (assuming Sony is using the same manufacturer for their wireless adapter)
https://www.geeksforgeeks.org/introduction-of-mac-address-in-computer-network/
6 of known OUI on PSP's mac address are 00:1c:26, 00:1d:d9, 00:1F:E2, 00:26:5C, 00:25:56 and 00:19:7e which are manufactured by Hon Hai Precision Ind. Co.,Ltd. when i checked them at https://www.wireshark.org/tools/oui-lookup.html
There is also 00:01:4a which is Sony Corporation, also 00:16:fe, 00:07:04, 00:26:43 and 00:06:F5 which are Alps Electric Co., Ltd.

May be the game is tampering with the MAC address as some kind of protection if it was used on an unofficial emulator.

@ghost
Copy link
Author

ghost commented Sep 1, 2020

Ah well when i use multiple instances I dont care about the MAC address part so it stays the same on both instances.
I need to check if it works on JPCSP as more games work there over adhoc.

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Ah well when i use multiple instances I dont care about the MAC address part so it stays the same on both instances.
I need to check if it works on JPCSP as more games work there over adhoc.

it should probably works if you use prx files, since it's an official module

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Also it's only an emulator issue it wont work if you try to play it over Xlink Kai and real PSPs.
Strange thing.
(Its Mojo i have another acc lol)

Well it's probably some kind of protection if the game is tampering with the MAC content returned from GetMembers.
The only solution i can think of to fix this is by ignoring the 1st byte.

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Hmm.. looks like the bug isn't as simple as ignoring the 1st byte :( i did managed to progress from that stage, but when i try again, i'm getting this kind of logs O.o it replaces all the bytes to 00
image
It should be 02:02:02:02:02:02 but the game is using 00:00:00:00:00:00 instead :(
Or may be it's allowed to use target mac with all 00 like that? as some kind of broadcast may be? or may be it will default to parent mac address? (this zeroes mac seems to occurred on Joining side)

@anr2me
Copy link
Collaborator

anr2me commented Sep 1, 2020

Okay i findout why the 1st byte was always 1 number below the original one, it was because of the opcode at:

08B306DC  ins v0,zero,0x0,0x1

It's replacing the 1st bit with 0 not sure for what reason...
Now it makes me wondering whether the 2nd argument is actually a mac address or not...

@anr2me
Copy link
Collaborator

anr2me commented Sep 2, 2020

Ah well when i use multiple instances I dont care about the MAC address part so it stays the same on both instances.
I need to check if it works on JPCSP as more games work there over adhoc.

Btw did you managed to get it to works on JPCSP? i tried to use prx files but after both players ready and the race started, it stuck with the loading screen (the one with GT logo), since it took a long time without any progress i closed it down LOL may be because my laptop is too slow to run 2x JPCSP :(

I also noticed something different, with prx files the Host is always located on top of the list while with PPSSPP whenever a player joined the Host pushed to bottom LOL
May be that weird MAC address have something to do with the sorting, because with prx files both mac addresses are used unmodified.

well i've made some changes to sort the member list last month but stashed it since i wasn't able to confirm how the list supposed to look like back then.

@ghost
Copy link
Author

ghost commented Sep 2, 2020

Well I couldn't get it to work over JPCSP - The client cant see the host for some reason.
I tried with the latest JPCSP build so maybe I need another one ? Tried with an earlier build and I couldn't even start the game properly lol.
Well at least the race starts on JPCSP..

@anr2me
Copy link
Collaborator

anr2me commented Sep 2, 2020

I managed to get this game to work on PPSSPP
image
But it's kinda hackish because of the modified MAC address, while it wasn't modified when using prx files, so i don't really like this fix.

@ghost
Copy link
Author

ghost commented Sep 2, 2020

Damn I will like to try it out and play it.
Well if does not break any game its not that bad right? so close lol.

@anr2me
Copy link
Collaborator

anr2me commented Sep 2, 2020

Hmm.. after reading some more of MAC format, the 1st bit of the 1st byte the game was changing, seems to be the unicast/multicast type, so i guess this fix is already correct by ignoring the 1st byte when comparing.
image
The 2nd bit also have a meaning, which is why the game is replacing all the bytes to 00(invalid mac) if the 1st byte was 02

@anr2me
Copy link
Collaborator

anr2me commented Sep 3, 2020

Wow because of this game i find so many bugs, and some of them are general bug and not specific to this game.
Anyway, i've fixed them by now.

Currently i'm still stuck trying to sort the member list to a satisfying order (all players to show the same order with the Host), but it's difficult to "predict" where to insert the local MAC among all the children, since the local MAC never get added to the peerlist :(
image
As you can see only the Host and the 1st Joining player are showing the correct order.
But this is just visual issue it have no impacts on the multiplayer it self, i'm just trying to make it to show a consistent list on all players (not really sure how it should be on a real PSP with 4 players tho)

@ghost
Copy link
Author

ghost commented Sep 3, 2020

Glad I helped and keep up the good work.

@hrydgard
Copy link
Owner

hrydgard commented Sep 3, 2020

@anr2me Does the order displayed even matter? Is the order always the same on all the devices on the real PSP?

Oh I see you asked that question yourself, never mind :)

@anr2me
Copy link
Collaborator

anr2me commented Sep 3, 2020

I've made the PR to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants