TheHunterManX / GBA-PK-multiplayer

Other
177 stars 38 forks source link

[BUG]: Client Shows as Connected then Repeatedly Timed out on Server #39

Closed Oraceon closed 1 year ago

Oraceon commented 1 year ago

Is there an existing issue for this?

Description of the bug

I have tried both Port-forwarding and Hamachi. I have a lot of experience port-forwarding, so I know that is not the issue. When the client connects to my server using my public IP, it shows on my script menu that the client has connection, but then has timed out. It will do this numerous times and the connection will never actually be stable. On the client side, it shows that no connection has taken place whatsoever. It gives them a random username even after entering the Client's own. And on top of that, it says "Connected to server: no" even though on the Server side it shows that the connection was attempted and then timed out.

At no point are we able to see or communicate with each other in game. We are playing across the country, so this is not a LAN issue. Furthermore, its not a firewall issue as I host Minecraft and DayZ servers with minimal connection problems. We have checked both script files repeatedly for misspellings or wrong information, and that is not the case. I have found zero information online about this - only people complaining about the issue in YouTube comments, but no answers or responses.

This issue is repeatably and makes it impossible for us to play at all.

Steps To Reproduce

1) Run mGBA and launch your ROM 2) Run the script 3) Nothing works

televisionia commented 1 year ago

There must be some kind of script bug here, since with the way you described it, you seem to know what you're doing. I recommend checking out my comment at https://github.com/TheHunterManX/GBA-PK-multiplayer/issues/35#issuecomment-1426992867 I have a helpful guide on how to use a alternative to Hamachi called ZeroTier. While it's not exactly the same as Hamachi, it has its own uses. There might be something related to your mGBA version or you and your friend not having the same version of the script. You probably already know this but just to point it out: only 4 players can connect to a server and battling is not a feature yet. The repo maintainer seems to be pretty inactive at the moment, so if it is a bug, it is probably not going to be fixed anytime soon. Good luck with ZeroTier and tell me if it works!

tl;dr, Not your problem, might be the script or the internet, try ZeroTier (try guide at https://github.com/TheHunterManX/GBA-PK-multiplayer/issues/35#issuecomment-1426992867)
P.S, since this is more of a 'workaround' than a 'fix' please keep the issue open until you've found a solution to the port forwarding issue, though I don't recommend using and sharing your public ip unless you know what you're doing.

https://www.zerotier.com/

televisionia commented 1 year ago

Oh one thing I forgot to mention about the nicknames, nicknames are pretty broken. Try leaving the nickname blank in the script for all clients ("") when hosting (try this with port forwarding). I think this may be due to the amount of data sent through being limited, causing the script to halt. though I can't be too sure.

(Edit: just realized after further thinking, the nicknames should be the issue! The server must have been processing the data the client SENT to the server then the process of sending the nickname must have broke, therefore the server never sending anything back to the client, which is why the client didn't get any notification of a connection being made... I think we found out the bug, tell me if using no nicknames work please! They will be randomized into random letters.)

Oraceon commented 1 year ago

Thanks for the quick response. I'll give it another shot later, but this time with both nicknames blank. I'll update you as soon as its done.

Oraceon commented 1 year ago

I can now confirm that leaving the nickname fields blank in both Server and Client did fix the timing out and Client connection issue. Been working for over an hour now with little issues except for some minor desync. Thanks for your help, @televisionia

televisionia commented 1 year ago

Awesome! @Oraceon I might go post an issue (might even do a pull request to fix the issue too!) regarding the nickname bug/glitch problem.

televisionia commented 1 year ago

Just made one at #41 , it seems you were definitely not alone