TheHunterManX / GBA-PK-multiplayer

Other
172 stars 36 forks source link

[BUG]: Could someone please tell me how to use ZeroTier with this? #35

Closed sus12312 closed 1 year ago

sus12312 commented 1 year ago

Is there an existing issue for this?

Description of the bug

I have looked at other issues revolving around this and no one fully explains it. I cannot find any helpful Minecraft server videos that will help me. Could a kind soul please give me a step-by-step explanation of how to use it? I am hosting and I'm on a mac. My friend is on windows 10. I have already tried the installation guide and quite frankly, it's the vaguest thing ever. I'm overall just confused about the ip thing. I would prefer to use ZeroTier.

Steps To Reproduce

Download ZeroTier Setup ZeroTier server Both people connect to ZeroTier Client side person places the ip in the lua file Server side starts up game Nothing happens

sus12312 commented 1 year ago

please help

SWHSmash commented 1 year ago

#17

sus12312 commented 1 year ago

#17

bro i specifically said i cant find a bloody tutorial for minecraft tutorial

SWHSmash commented 1 year ago

#17

bro i specifically said i cant find a bloody tutorial for minecraft tutorial

first this is NOT about Minecraft. don't know why u posted this here for an GBA related things.. But setup is the same.. check your internal ZeroTier IPs twice ane be sure you're on the same subnet.

google not for Minecraft zerotier setup, else for basic setup, find each other etc.. 🙄🙄

sus12312 commented 1 year ago

#17

bro i specifically said i cant find a bloody tutorial for minecraft tutorial

first this is NOT about Minecraft. don't know why u posted this here for an GBA related things.. But setup is the same.. check your internal ZeroTier IPs twice ane be sure you're on the same subnet.

google not for Minecraft zerotier setup, else for basic setup, find each other etc.. 🙄🙄

I am not utilizing ZeroTier for Minecraft, as suggested; instead, I'm utilizing it for the multiplayer mod for FireRed. The issue you provided, "17," is related to a reply from a different user to locate a Minecraft tutorial for ZeroTier, which is essentially the same. Unfortunately, I was unable to find a satisfactory Minecraft tutorial and so I proceeded to the issues page. I would be immensely grateful if someone could provide me with a comprehensive guide for using ZeroTier with the mod, given your expertise in this particular mod. Appreciate your help in advance.

televisionia commented 1 year ago

@sus12312 Sorry about the lack of help for the past two days, I was inactive and I would have responded sooner. ZeroTier can be a bit confusing to understand especially if you've got zero idea how IP addresses work... I wish there was a convenient place that allowed people to post guides on how to do this stuff but unfortunately there's not.

Now, to the point. As you suggested, I will give a step by step guide on how to use ZeroTier. I, with a friend (who was on mac and I was on windows 10 as well), have successfully done this with ZeroTier before. Plus, ZeroTier is open source, more reliable than Hamachi.


  1. First of all one of you must make a ZeroTier network on the ZeroTier website(after logging in on the website, only one person needs to,)

  2. Both you and the friend download, install and open the ZeroTier app (On windows it shows as a little icon at the right of the taskbar, you have to right click it, im not sure about mac.)

  3. You and your friend join the network using Network ID found at the top of the page of your network (example shown below, where ive marked it out in red) through the ZeroTier app, make sure you allow it any network permissions if it asks. image

  4. Afterwards, you should see you and your friend both connected after refreshing the page, try not to randomly press any buttons, the existing settings should be fine. Make sure you know who is who. image How this works? What you just did is create a Virtual Private Network, well, literally a VPN, but not for the purpose they're most known for. This way, you can play any single LAN game with your friends without being connected to the same internet! Though, the network isn't that fast. You can add more friends with ZeroTier from any OS (Windows, Mac, Linux, etc.)

  5. In the screenshot from the previous step, you might see a checkbox that I have circled in red. Make those are checked for both you and your friend else you wont be able to connect to each other.

  6. Below Managed IPs label is your private IP address in the network, both you and your friend must have the private IP of the person who is hosting in the lua script (assuming that it's you who is hosting, BOTH you and your friend must have YOUR private IP (that is labelled under your Managed IPs on the list of connected people) entered in the script. With your script being the server script and your friend's script being the client script.) The port can be left the same, just make sure you and your friend have the same one (It cannot be 1024 or below for technical reasons.)

  7. And that should be it! Start up the server and then tell your friend to start their client script (after making sure you both have the right IP address entered)


A bit of insight into how the whole entire client-server connection works: The Server is the computer that is 'hosting' the game and is what the clients connect to. The Client is the computer that is connecting to the server, and there can be multiple of these connecting to the same server (Up to 4 is how much this script is built for.)

In order for the client to connect to the server they must have the IP address the server is running on, in this situation you would use the server's private IP in the zerotier network (under Managed IP's.) The server must be running under that same IP as well for both to make the connection, obviously. The reason why the ports dont matter too much as long as it's the same is because you can imagine ports as different pipes (or different dimensions if you wanna be dramatic.) The client must know the right port to look for the server, this port being the same port the server is running on. The Server and the Client cant find each other on different ports.

The reason why you use ZeroTier for this is that it is more secure and stops the hassle of having to port forward and set up your server to connect over the internet. ZeroTier makes it work as if you and your friend are connected to the same router, but infact you are both connecting through a virtual network.

In short, you can use a ZeroTier VPN (Virtual Private Network) to mimic an LAN (Local Area Network.)

Crazy stuff to learn to just connect to each other, am I right? Thanks to modern day apps like most social media and popular video games we don't have to worry about this, as the program does all this work for us. Plus, you don't have to 'make a server,' because they have their own servers YOU connect to. Like, every time you open Discord for example, you connect to the Discord servers as a client and message other clients (like your friends,) all the messages are stored on the Discord servers (scary, am i right?) Anyways, tell me if there's any more problems!


@SWHSmash Please refer to this comment instead of the one at #17 from now on as it has much more details.

sus12312 commented 1 year ago

@sus12312 Sorry about the lack of help for the past two days, I was inactive and I would have responded sooner. ZeroTier can be a bit confusing to understand especially if you've got zero idea how IP addresses work... I wish there was a convenient place that allowed people to post guides on how to do this stuff but unfortunately there's not.

Now, to the point. As you suggested, I will give a step by step guide on how to use ZeroTier. I, with a friend (who was on mac and I was on windows 10 as well), have successfully done this with ZeroTier before. Plus, ZeroTier is open source, more reliable than Hamachi.

  1. First of all one of you must make a ZeroTier network on the ZeroTier website(after logging in on the website, only one person needs to,)
  2. Both you and the friend download, install and open the ZeroTier app (On windows it shows as a little icon at the right of the taskbar, you have to right click it, im not sure about mac.)
  3. You and your friend join the network using Network ID found at the top of the page of your network (example shown below, where ive marked it out in red) through the ZeroTier app, make sure you allow it any network permissions if it asks. image
  4. Afterwards, you should see you and your friend both connected after refreshing the page, try not to randomly press any buttons, the existing settings should be fine. Make sure you know who is who. image How this works? What you just did is create a Virtual Private Network, well, literally a VPN, but not for the purpose they're most known for. This way, you can play any single LAN game with your friends without being connected to the same internet! Though, the network isn't that fast. You can add more friends with ZeroTier from any OS (Windows, Mac, Linux, etc.)
  5. In the screenshot from the previous step, you might see a checkbox that I have circled in red. Make those are checked for both you and your friend else you wont be able to connect to each other.
  6. Below Managed IPs label is your private IP address in the network, both you and your friend must have the private IP of the person who is hosting in the lua script (assuming that it's you who is hosting, BOTH you and your friend must have YOUR private IP (that is labelled under your Managed IPs on the list of connected people) entered in the script. With your script being the server script and your friend's script being the client script.) The port can be left the same, just make sure you and your friend have the same one (It cannot be 1024 or below for technical reasons.)
  7. And that should be it! Start up the server and then tell your friend to start their client script (after making sure you both have the right IP address entered)

A bit of insight into how the whole entire client-server connection works: The Server is the computer that is 'hosting' the game and is what the clients connect to. The Client is the computer that is connecting to the server, and there can be multiple of these connecting to the same server (Up to 4 is how much this script is built for.)

In order for the client to connect to the server they must have the IP address the server is running on, in this situation you would use the server's private IP in the zerotier network (under Managed IP's.) The server must be running under that same IP as well for both to make the connection, obviously. The reason why the ports dont matter too much as long as it's the same is because you can imagine ports as different pipes (or different dimensions if you wanna be dramatic.) The client must know the right port to look for the server, this port being the same port the server is running on. The Server and the Client cant find each other on different ports.

The reason why you use ZeroTier for this is that it is more secure and stops the hassle of having to port forward and set up your server to connect over the internet. ZeroTier makes it work as if you and your friend are connected to the same router, but infact you are both connecting through a virtual network.

In short, you can use a ZeroTier VPN (Virtual Private Network) to mimic an LAN (Local Area Network.)

Crazy stuff to learn to just connect to each other, am I right? Thanks to modern day apps like most social media and popular video games we don't have to worry about this, as the program does all this work for us. Plus, you don't have to 'make a server,' because they have their own servers YOU connect to. Like, every time you open Discord for example, you connect to the Discord servers as a client and message other clients (like your friends,) all the messages are stored on the Discord servers (scary, am i right?) Anyways, tell me if there's any more problems!

@SWHSmash Please refer to this comment instead of the one at #17 from now on as it has much more details.

OMG thank you so much now me and my friend can play. You truly are amazing. THANK YOU!

televisionia commented 1 year ago

No problem!

TrueBloo commented 1 year ago

man i still cant get it to work with me and my friend even after following the tutorial

ECGBastos commented 11 months ago

Hello @televisionia , at first I thought I was doing something wrong, so I managed to find your tutorial. I am using 2 Macs and ZeroTier

Release is Alpha3, mgba version is 0.10.2 on both. Followed your tutorial to a T, and on the host it says "Player 2: Disconnected" and on the client "connected to a server: no". At any point did the script run or entered any phase

When both say "Searching for an open game on IP xxxx" both have the same IP (which is the Managed IP of the host/server) and Port (the default one, 4096).

My best friend is in bed recovering from a major surgery and I wanted to keep him company so we could both play this but it has been impossible.

Any further hints of something I could be missing? Thank you very much in advance

televisionia commented 11 months ago

Have you tried leaving the nicknames blank in both scripts? @ECGBastos