SubtitleOr at least someone better then me with the language.
Just thought I'd put this out to you good people before I run the gauntlet of stack exchange. I'm writing plugins for our Minecraft server (so it has to be done in Java) that need to be able to tell if a player has originated from inside my network (i.e. one of my two children (real human ones, just thought I'd clarify that)) or a user from the outside world.
How do I determine the gateway/router address in Java? I have been using isSiteLocalAddres() but the issue is that this method sees anything coming through my router (192.168.1.1) as being local. Obviously it's trivial to account for this exception specifically but I'm writing something that I'd like to publish. This means that I'll need to accommodate for everyone else's router IP address.
A quick google throws up
this, call me a purist but that method is horrible. My main objection being the hard coding of the Amazon website address (although I could probably come up with more reasons).
Any ideas?