This API utilizes SLF4J for logging purposes and doesn't come shipped with a default logging implementation, if you use Maven instead of the standalone jar.
You will manually have to add one via Maven to get any logging going, if you don't have one already.
The easiest way to do so is to just add SimpleLogger to your project, which also supports configuration via
config file (needs to be shipped as a resource with your jar), if you want to log DEBUG messages for instance (e.g. raw client-server communication).
See this configuration example for SimpleLogger.
Add the following to your pom.xml to get started:
You can however choose whichever logging framework suits your needs best. Just add your logging framework and the
corresponding binding to your pom.xml.
Usage
All functionality is contained in the TS3Api object.
Only use FloodRate.UNLIMITED if you are sure that your query account is whitelisted (query_ip_whitelist.txt in Teamspeak server folder). If not, use FloodRate.DEFAULT. The server will temporarily ban your account if you send too many commands in a short period of time. For more info on this, check the TeamSpeak 3 Server Query Manual, page 6.
TS3Config Settings
Option
Description
Method signature
Default value
Required
Host/IP
IP/Host of TeamSpeak 3 server.
setHost(String)
yes
QueryPort
Query port of TeamSpeak 3 server.
setQueryPort(int)
10011
no
FloodRate
Prevents possible spam to the server.
setFloodRate(FloodRate)
FloodRate.DEFAULT
no
Communications logging
Log client-server communication.
setEnableCommunicationsLogging(boolean)
false
no
Command timeout
Time until a command waiting for a response fails
setCommandTimeout(int)
4000 (ms)
no
Questions or bugs?
Please let us know here. We'll try to help you as soon as we can.
If you just have a simple question or want to talk to us about something else, please join the repository chat on Gitter.
请发表评论