TheHolyWaffle / TeamSpeak-3-Java-API

A Java wrapper of TeamSpeak's 3 server query API.
MIT License
307 stars 107 forks source link

Question #136

Closed SmoxTV closed 7 years ago

SmoxTV commented 8 years ago

Hi Guys, I need your help! I dont know much about JavaDoc, but I want to know something

  1. How can I set some countries on a Blacklist?
  2. How can I check a host, for example ( the host "Ovh SaS 4636" was banned.)
  3. How can I configurate groups with permissions on commands, that I want to give that groups

Thank's for help

rogermb commented 8 years ago
  1. There is no such thing as a blacklist. You can do register an onClientJoin listener to achieve this, though. Get a string representing the client's country by calling event.getClientCountry. (Note that this information is not guaranteed to accurate.) If that string is not what you expect it to be, kick the client.

    Off topic real quick: Installing a geo blocker is a pretty shitty thing to do. Please do consider other alternatives.

  2. Check a host for what? I'm sorry, but I don't understand what exactly you're asking.
  3. I assume you mean that you want to implement a sort-of permissions system for when a client types a "command" into the chat? Like "!help"?

    In that case, I'd suggest you just use client.isInServerGroup(someGroupIdHere) to check if a client is in one of the groups who you want to allow that "command".

SmoxTV commented 8 years ago

also for example


IPAdress xxx.xxx.xxx.xxx --> search the provider --> "Ovh SaS 4636" --> banned

thanks

rogermb commented 8 years ago

What kind of "provider"?

And what is Ovh SaS 4636? Just a name? A name for what?

SmoxTV commented 8 years ago

The Server/Inet Provider i use this for the bans

Example: "The Hoster "blubbb" is not allowed."

rogermb commented 8 years ago

Huh, interesting.

You can't do such lookups directly with our API or with TeamSpeak. You can only get the client's IP by calling ClientInfo client = api.getClientInfo(e.getClientId()), followed by client.getIP().

I really can't help you with doing those provider lookups. I honestly don't even know how you'd get that kind of information.

krjan02 commented 7 years ago

He means the Hostname of an IP Adress

You can get the Hostname like this;

InetAddress addr = InetAddress.getByName(client.getIp);
String host = addr.getHostName();
System.out.println(host);

Then check it etc.

krjan02 commented 7 years ago

And Make Sure to Not Block Home ISP's like Vodafone , Kabel Deutschland , KabelBW , Unitymedia , 1&1 , Telekom (Dip...) and other one's Verizon , Google Fiber i live in Germany so i dont know ISP's in other Countrys