Is there a way to redirect players based on location?

Status
This thread has been locked.

Scrooby

Microsoft, Sophos and Idiot Certified
Supreme
Feedback score
35
Posts
324
Reactions
189
Resources
0
Hey all,

I'm investing in a new server or should I say 'Servers' and I plan to have an EU and a US server. I know servers such as Mineplex use 'US.domain.tld' and 'eu.domain.tld'.

Is there a way to link bungee to a location-based redirect to a specific server.

I.e a player joins from an ip located in the US, they get sent to 1x.xxx.xxx.xx (ip) but if the location is from the EU it goes to 2x.xxx.xxx.xx.

There might be something that's already like this but I wouldn't know. Any ideas?
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

NotSoBoop

New Developer
Premium
Feedback score
23
Posts
963
Reactions
345
Resources
0
I think it'd be possible by having a BungeeCord server that gets the player IP on connect and uses a service like IPAPI (https://ipapi.co/) to determine where they are and send them to the appropriate server. Never played with the Bungee API, but I'd imagine it'd only need a .send method (to send players to a server) and a connect event where you can get the player's IP.
 

Billison

I make stuff with code occasionally
Supreme
Feedback score
6
Posts
144
Reactions
43
Resources
0
I know it isn't hard I do it a lot, though in a world where it was p.send there would be happy faces all round.
 

Scrooby

Microsoft, Sophos and Idiot Certified
Supreme
Feedback score
35
Posts
324
Reactions
189
Resources
0
Maybe for something for someone to develop? :D

- (10% fee to me.... ;) )
 
Status
This thread has been locked.
Top