public class TS3Api extends Object
TS3Query
synchronously.
This class is used to easily interact with a TS3Query
. It constructs commands,
sends them to the TeamSpeak3 server, processes the response and returns the result.
All methods in this class are synchronous, so they will block until the response arrives.
Calls to this API will usually take about 50 milliseconds to complete (plus ping),
but delays can range up to 4 seconds.
If a command takes longer than 4 seconds to complete, a TS3ConnectionFailedException
will be thrown.
You won't be able to execute most commands while you're not logged in due to missing permissions.
Make sure to either pass your login credentials to the TS3Config
object when
creating the TS3Query
or to call login(String, String)
to log in.
After that, most commands also require you to select a virtual server.
To do so, call either selectVirtualServerByPort(int)
or selectVirtualServerById(int)
.
Be aware that many methods in this class will return null
or -1
if a command fails.
The asynchronous version of the API
Constructor and Description |
---|
TS3Api(TS3Query query)
Creates a new synchronous API object for the given
TS3Query . |
Modifier and Type | Method and Description |
---|---|
int |
addBan(String ip,
String name,
String uid,
long timeInSeconds,
String reason)
Adds a new ban entry.
|
boolean |
addChannelClientPermission(int channelId,
int clientDBId,
String permName,
int permValue)
Adds a specified permission to a client in a specific channel.
|
int |
addChannelGroup(String name)
Creates a new channel group for clients using a given name and returns its ID.
|
int |
addChannelGroup(String name,
PermissionGroupDatabaseType type)
Creates a new channel group using a given name and returns its ID.
|
boolean |
addChannelGroupPermission(int groupId,
String permName,
int permValue)
Adds a specified permission to a channel group.
|
boolean |
addChannelPermission(int channelId,
String permName,
int permValue)
Adds a specified permission to a channel.
|
boolean |
addClientPermission(int clientDBId,
String permName,
int value,
boolean skipped)
Adds a specified permission to a channel.
|
boolean |
addClientToServerGroup(int groupId,
int clientDatabaseId)
Adds a client to the specified server group.
|
boolean |
addComplaint(int clientDBId,
String message)
Submits a complaint about the specified client.
|
boolean |
addPermissionToAllServerGroups(ServerGroupType type,
String permName,
int value,
boolean negated,
boolean skipped)
Adds a specified permission to all server groups of the type specified by
type on all virtual servers. |
String |
addPrivilegeKey(TokenType type,
int groupId,
int channelId,
String description)
Create a new privilege key that allows one client to join a server or channel group.
|
String |
addPrivilegeKeyChannelGroup(int channelGroupId,
int channelId,
String description)
Creates a new privilege key for a channel group.
|
String |
addPrivilegeKeyServerGroup(int serverGroupId,
String description)
Creates a new privilege key for a server group.
|
int |
addServerGroup(String name)
Creates a new server group for clients using a given name and returns its ID.
|
int |
addServerGroup(String name,
PermissionGroupDatabaseType type)
Creates a new server group using a given name and returns its ID.
|
boolean |
addServerGroupPermission(int groupId,
String permName,
int value,
boolean negated,
boolean skipped)
Adds a specified permission to a server group.
|
void |
addTS3Listeners(TS3Listener... listeners)
Adds one or more
TS3Listener s to the event manager of the query. |
int[] |
banClient(int clientId,
long timeInSeconds)
Bans a client with a given client ID for a given time.
|
int[] |
banClient(int clientId,
long timeInSeconds,
String reason)
Bans a client with a given client ID for a given time for the specified reason.
|
int[] |
banClient(int clientId,
String reason)
Bans a client with a given client ID permanently for the specified reason.
|
boolean |
broadcast(String message)
Sends a text message to all clients on all virtual servers.
|
boolean |
copyChannelGroup(int sourceGroupId,
int targetGroupId,
PermissionGroupDatabaseType type)
Creates a copy of the channel group specified by
sourceGroupId ,
overwriting any other channel group specified by targetGroupId . |
int |
copyChannelGroup(int sourceGroupId,
String targetName,
PermissionGroupDatabaseType type)
Creates a copy of the channel group specified by
sourceGroupId with a given name
and returns the ID of the newly created channel group. |
boolean |
copyServerGroup(int sourceGroupId,
int targetGroupId,
PermissionGroupDatabaseType type)
Creates a copy of the server group specified by
sourceGroupId ,
overwriting another server group specified by targetGroupId . |
int |
copyServerGroup(int sourceGroupId,
String targetName,
PermissionGroupDatabaseType type)
Creates a copy of the server group specified by
sourceGroupId with a given name
and returns the ID of the newly created server group. |
int |
createChannel(String name,
Map<ChannelProperty,String> options)
Creates a new channel with a given name using the given properties and returns its ID.
|
CreatedVirtualServer |
createServer(String name,
Map<VirtualServerProperty,String> options)
Creates a new virtual server with the given name and returns an object containing the ID of the newly
created virtual server, the default server admin token and the virtual server's voice port.
|
Snapshot |
createServerSnapshot()
Creates a
Snapshot of the selected virtual server containing all settings,
groups and known client identities. |
boolean |
deleteAllBans()
Deletes all active ban rules from the server.
|
boolean |
deleteAllComplaints(int clientDBId)
Deletes all complaints about the client with specified database ID from the server.
|
boolean |
deleteBan(int banId)
Deletes the ban rule with the specified ID from the server.
|
boolean |
deleteChannel(int channelId)
Deletes an existing channel specified by its ID, kicking all clients out of the channel.
|
boolean |
deleteChannel(int channelId,
boolean force)
Deletes an existing channel with a given ID.
|
boolean |
deleteChannelClientPermission(int channelId,
int clientDBId,
String permName)
Removes a specified permission from a client in a specific channel.
|
boolean |
deleteChannelGroup(int groupId)
Removes the channel group with the given ID.
|
boolean |
deleteChannelGroup(int groupId,
boolean force)
Removes the channel group with the given ID.
|
boolean |
deleteChannelGroupPermission(int groupId,
String permName)
Removes a permission from the channel group with the given ID.
|
boolean |
deleteChannelPermission(int channelId,
String permName)
Removes a permission from the channel with the given ID.
|
boolean |
deleteClientPermission(int clientDBId,
String permName)
Removes a permission from a client.
|
boolean |
deleteComplaint(int targetClientDBId,
int fromClientDBId)
Deletes the complaint about the client with database ID
targetClientDBId submitted by
the client with database ID fromClientDBId from the server. |
boolean |
deleteDatabaseClientProperties(int clientDBId)
Removes all stored database information about the specified client.
|
boolean |
deleteOfflineMessage(int messageId)
Deletes the offline message with the specified ID.
|
boolean |
deletePermissionFromAllServerGroups(ServerGroupType type,
String permName)
Removes a specified permission from all server groups of the type specified by
type on all virtual servers. |
boolean |
deletePrivilegeKey(String token)
Deletes the privilege key with the given token.
|
boolean |
deleteServer(int serverId)
Deletes the virtual server with the specified ID.
|
boolean |
deleteServerGroup(int groupId)
Deletes the server group with the specified ID, even if the server group still contains clients.
|
boolean |
deleteServerGroup(int groupId,
boolean force)
Deletes a server group with the specified ID.
|
boolean |
deleteServerGroupPermission(int groupId,
String permName)
Removes a permission from the server group with the given ID.
|
boolean |
deployServerSnapshot(Snapshot snapshot)
Restores the selected virtual servers configuration using the data from a
previously created server snapshot.
|
boolean |
deployServerSnapshot(String snapshot)
Restores the configuration of the selected virtual server using the data from a
previously created server snapshot.
|
boolean |
editChannel(int channelId,
Map<ChannelProperty,String> options)
Changes a channel's configuration using the given properties.
|
boolean |
editClient(int clientId,
Map<ClientProperty,String> options)
Changes a client's configuration using given properties.
|
boolean |
editDatabaseClient(int clientDBId,
Map<ClientProperty,String> options)
Changes a client's database settings using given properties.
|
boolean |
editInstance(ServerInstanceProperty property,
String value)
Changes the server instance configuration using given properties.
|
boolean |
editServer(Map<VirtualServerProperty,String> options)
Changes the configuration of the selected virtual server using given properties.
|
List<Ban> |
getBans()
Gets a list of all bans on the selected virtual server.
|
List<Binding> |
getBindings()
Gets a list of IP addresses used by the server instance.
|
Channel |
getChannelByNameExact(String name,
boolean ignoreCase)
Finds and returns the channel matching the given name exactly.
|
List<Permission> |
getChannelClientPermissions(int channelId,
int clientDBId)
Displays a list of permissions defined for a client in a specific channel.
|
List<ChannelGroupClient> |
getChannelGroupClients(int channelId,
int clientDBId,
int groupId)
Gets all client / channel ID combinations currently assigned to channel groups.
|
List<ChannelGroupClient> |
getChannelGroupClientsByChannelGroupId(int groupId)
Gets all client / channel ID combinations currently assigned to the specified channel group.
|
List<ChannelGroupClient> |
getChannelGroupClientsByChannelId(int channelId)
Gets all channel group assignments in the specified channel.
|
List<ChannelGroupClient> |
getChannelGroupClientsByClientDBId(int clientDBId)
Gets all channel group assignments for the specified client.
|
List<Permission> |
getChannelGroupPermissions(int groupId)
Gets a list of all permissions assigned to the specified channel group.
|
List<ChannelGroup> |
getChannelGroups()
Gets a list of all channel groups on the selected virtual server.
|
ChannelInfo |
getChannelInfo(int channelId)
Gets detailed configuration information about the channel specified channel.
|
List<Permission> |
getChannelPermissions(int channelId)
Gets a list of all permissions assigned to the specified channel.
|
List<Channel> |
getChannels()
Gets a list of all channels on the selected virtual server.
|
List<Channel> |
getChannelsByName(String name)
Gets a list of channels whose names contain the given search string.
|
Client |
getClientByNameExact(String name,
boolean ignoreCase)
Finds and returns the client whose nickname matches the given name exactly.
|
ClientInfo |
getClientByUId(String clientUId)
Gets information about the client with the specified unique identifier.
|
ClientInfo |
getClientInfo(int clientId)
Gets information about the client with the specified client ID.
|
List<Permission> |
getClientPermissions(int clientDBId)
Gets a list of all permissions assigned to the specified client.
|
List<Client> |
getClients()
Gets a list of all clients on the selected virtual server.
|
List<Client> |
getClientsByName(String name)
Gets a list of clients whose nicknames contain the given search string.
|
List<Complaint> |
getComplaints()
Gets a list of all complaints on the selected virtual server.
|
List<Complaint> |
getComplaints(int clientDBId)
Gets a list of all complaints about the specified client.
|
ConnectionInfo |
getConnectionInfo()
Gets detailed connection information about the selected virtual server.
|
DatabaseClientInfo |
getDatabaseClientByUId(String clientUId)
Gets information about the client with the specified unique identifier in the server database.
|
DatabaseClientInfo |
getDatabaseClientInfo(int clientDBId)
Gets information about the client with the specified database ID in the server database.
|
List<DatabaseClient> |
getDatabaseClients()
Gets information about all clients in the server database.
|
List<DatabaseClientInfo> |
getDatabaseClientsByName(String name)
Gets all clients in the database whose last nickname matches the specified name exactly.
|
HostInfo |
getHostInfo()
Displays detailed configuration information about the server instance including
uptime, number of virtual servers online, traffic information, etc.
|
InstanceInfo |
getInstanceInfo()
Displays the server instance configuration including database revision number,
the file transfer port, default group IDs, etc.
|
String |
getOfflineMessage(int messageId)
Reads the message body of a message.
|
String |
getOfflineMessage(Message message)
Reads the message body of a message.
|
List<Message> |
getOfflineMessages()
Gets a list of all offline messages for the server query.
|
List<AdvancedPermission> |
getPermissionAssignments(String permName)
Displays detailed information about all assignments of the permission specified
with
permName . |
int |
getPermissionIdByName(String permName)
Gets the ID of the permission specified by
permName . |
List<AdvancedPermission> |
getPermissionOverview(int channelId,
int clientDBId)
Gets a list of all assigned permissions for a client in a specified channel.
|
List<PermissionInfo> |
getPermissions()
Displays a list of all permissions, including ID, name and description.
|
int |
getPermissionValue(String permName)
Displays the current value of the specified permission for this server query instance.
|
List<PrivilegeKey> |
getPrivilegeKeys()
Gets a list of all available tokens to join channel or server groups,
including their type and group IDs.
|
List<ServerGroupClient> |
getServerGroupClients(int serverGroupId)
Gets a list of all clients in the specified server group.
|
List<ServerGroupClient> |
getServerGroupClients(ServerGroup serverGroup)
Gets a list of all clients in the specified server group.
|
List<Permission> |
getServerGroupPermissions(int serverGroupId)
Gets a list of all permissions assigned to the specified server group.
|
List<Permission> |
getServerGroupPermissions(ServerGroup serverGroup)
Gets a list of all permissions assigned to the specified server group.
|
List<ServerGroup> |
getServerGroups()
Gets a list of all server groups on the virtual server.
|
List<ServerGroup> |
getServerGroupsByClient(Client client)
Gets a list of all server groups set for a client.
|
List<ServerGroup> |
getServerGroupsByClientId(int clientDatabaseId)
Gets a list of all server groups set for a client.
|
int |
getServerIdByPort(int port)
Gets the ID of a virtual server by its port.
|
VirtualServerInfo |
getServerInfo()
Gets detailed information about the virtual server the server query is currently in.
|
Version |
getVersion()
Gets the version, build number and platform of the TeamSpeak3 server.
|
List<VirtualServer> |
getVirtualServers()
Gets a list of all virtual servers including their ID, status, number of clients online, etc.
|
boolean |
kickClientFromChannel(Client... clients)
Kicks one or more clients from their current channels.
|
boolean |
kickClientFromChannel(int... clientIds)
Kicks one or more clients from their current channels.
|
boolean |
kickClientFromChannel(String message,
Client... clients)
Kicks one or more clients from their current channels for the specified reason.
|
boolean |
kickClientFromChannel(String message,
int... clientIds)
Kicks one or more clients from their current channels for the specified reason.
|
boolean |
kickClientFromServer(Client... clients)
Kicks one or more clients from the server.
|
boolean |
kickClientFromServer(int... clientIds)
Kicks one or more clients from the server.
|
boolean |
kickClientFromServer(String message,
Client... clients)
Kicks one or more clients from the server for the specified reason.
|
boolean |
kickClientFromServer(String message,
int... clientIds)
Kicks one or more clients from the server for the specified reason.
|
boolean |
login(String username,
String password)
Logs the server query in using the specified username and password.
|
boolean |
logout()
Logs the server query out and deselects the current virtual server.
|
boolean |
moveChannel(int channelId,
int channelTargetId)
Moves a channel to a new parent channel specified by its ID.
|
boolean |
moveChannel(int channelId,
int channelTargetId,
int order)
Moves a channel to a new parent channel specified by its ID.
|
boolean |
moveClient(ChannelBase channel)
Moves the server query into the specified channel.
|
boolean |
moveClient(ChannelBase channel,
String channelPassword)
Moves the server query into the specified channel using the specified password.
|
boolean |
moveClient(Client client,
ChannelBase channel)
Moves a client into the specified channel.
|
boolean |
moveClient(Client client,
ChannelBase channel,
String channelPassword)
Moves a client into the specified channel using the specified password.
|
boolean |
moveClient(int channelId)
Moves the server query into the specified channel.
|
boolean |
moveClient(int clientId,
int channelId)
Moves a client into the specified channel.
|
boolean |
moveClient(int clientId,
int channelId,
String channelPassword)
Moves a client into the specified channel using the specified password.
|
boolean |
moveClient(int channelId,
String channelPassword)
Moves the server query into the specified channel using the specified password.
|
boolean |
pokeClient(int clientId,
String message)
Pokes the client with the specified client ID.
|
boolean |
quit()
Deprecated.
This command leaves the query in an undefined state,
where the connection is closed without the socket being closed and no more command can be executed.
To terminate a connection, use
TS3Query.exit() . |
boolean |
registerAllEvents()
Registers the server query to receive notifications about all server events.
|
boolean |
registerEvent(TS3EventType eventType)
Registers the server query to receive notifications about a given event type.
|
boolean |
registerEvent(TS3EventType eventType,
int channelId)
Registers the server query to receive notifications about a given event type.
|
boolean |
registerEvents(TS3EventType... eventTypes)
Registers the server query to receive notifications about multiple given event types.
|
boolean |
removeClientFromServerGroup(int serverGroupId,
int clientDatabaseId)
Removes the client specified by its database ID from the specified server group.
|
boolean |
removeClientFromServerGroup(ServerGroup serverGroup,
Client client)
Removes the specified client from the specified server group.
|
void |
removeTS3Listeners(TS3Listener... listeners)
Removes one or more
TS3Listener s to the event manager of the query. |
boolean |
renameChannelGroup(ChannelGroup channelGroup,
String name)
Renames the specified channel group.
|
boolean |
renameChannelGroup(int channelGroupId,
String name)
Renames the channel group with the specified ID.
|
boolean |
renameServerGroup(int serverGroupId,
String name)
Renames the server group with the specified ID.
|
boolean |
renameServerGroup(ServerGroup serverGroup,
String name)
Renames the specified server group.
|
String |
resetPermissions()
Resets all permissions and deletes all server / channel groups.
|
boolean |
selectVirtualServer(VirtualServer server)
Moves the server query into the specified virtual server.
|
boolean |
selectVirtualServerById(int id)
Moves the server query into the virtual server with the specified ID.
|
boolean |
selectVirtualServerByPort(int port)
Moves the server query into the virtual server with the specified voice port.
|
boolean |
sendChannelMessage(int channelId,
String message)
Sends a text message to the channel with the specified ID.
|
boolean |
sendChannelMessage(String message)
Sends a text message to the channel the server query is currently in.
|
boolean |
sendOfflineMessage(String clientUId,
String subject,
String message)
Sends an offline message to the client with the given unique identifier.
|
boolean |
sendPrivateMessage(int clientId,
String message)
Sends a private message to the client with the specified client ID.
|
boolean |
sendServerMessage(int serverId,
String message)
Sends a text message to the virtual server with the specified ID.
|
boolean |
sendServerMessage(String message)
Sends a text message to the virtual server the server query is currently in.
|
boolean |
sendTextMessage(TextMessageTargetMode targetMode,
int targetId,
String message)
Sends a text message either to the whole virtual server, a channel or specific client.
|
boolean |
setClientChannelGroup(int groupId,
int channelId,
int clientDBId)
Sets a channel group for a client in a specific channel.
|
boolean |
setMessageRead(int messageId)
Sets the read flag to true for a given message.
|
boolean |
setMessageRead(Message message)
Sets the read flag to true for a given message.
|
boolean |
setMessageReadFlag(int messageId,
boolean read)
Sets the read flag for a given message.
|
boolean |
setMessageReadFlag(Message message,
boolean read)
Sets the read flag for a given message.
|
boolean |
setNickname(String nickname)
Sets the nickname of the server query client.
|
boolean |
startServer(int serverId)
Starts the virtual server with the specified ID.
|
boolean |
startServer(VirtualServer virtualServer)
Starts the specified virtual server.
|
boolean |
stopServer(int serverId)
Stops the virtual server with the specified ID.
|
boolean |
stopServer(VirtualServer virtualServer)
Stops the specified virtual server.
|
boolean |
stopServerProcess()
Stops the entire TeamSpeak 3 Server instance by shutting down the process.
|
boolean |
unregisterAllEvents()
Unregisters the server query from receiving any event notifications.
|
boolean |
updateClient(Map<ClientProperty,String> options)
Updates several client properties for this server query instance.
|
String |
updateServerQueryLogin(String loginName)
Generates new login credentials for the currently connected server query instance, using the given name.
|
boolean |
usePrivilegeKey(PrivilegeKey privilegeKey)
Uses an existing privilege key to join a server or channel group.
|
boolean |
usePrivilegeKey(String token)
Uses an existing privilege key to join a server or channel group.
|
ServerQueryInfo |
whoAmI()
Gets information about the current server query instance.
|
public TS3Api(TS3Query query)
TS3Query
.
Usually, this constructor should not be called. Use TS3Query.getApi()
instead.
query
- the TS3Query to callpublic int addBan(String ip, String name, String uid, long timeInSeconds, String reason)
ip
, name
or uid
needs to be not null.
Returns the ID of the newly created ban.ip
- a RegEx pattern to match a client's IP against, can be nullname
- a RegEx pattern to match a client's name against, can be nulluid
- the unique identifier of a client, can be nulltimeInSeconds
- the duration of the ban in seconds. 0 equals a permanent banreason
- the reason for the ban, can be nullRegEx Pattern
,
Client.getId()
,
Client.getUniqueIdentifier()
,
ClientInfo.getIp()
public boolean addChannelClientPermission(int channelId, int clientDBId, String permName, int permValue)
channelId
- the ID of the channel wherein the permission should be grantedclientDBId
- the database ID of the client to add a permission topermName
- the name of the permission to grantpermValue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)Channel.getId()
,
Client.getDatabaseId()
,
Permission
public int addChannelGroup(String name)
To create channel group templates or ones for server queries,
use addChannelGroup(String, PermissionGroupDatabaseType)
.
name
- the name of the new channel groupChannelGroup
public int addChannelGroup(String name, PermissionGroupDatabaseType type)
name
- the name of the new channel grouptype
- the desired type of channel groupChannelGroup
public boolean addChannelGroupPermission(int groupId, String permName, int permValue)
groupId
- the ID of the channel group to grant the permissionpermName
- the name of the permission to be grantedpermValue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)ChannelGroup.getId()
,
Permission
public boolean addChannelPermission(int channelId, String permName, int permValue)
channelId
- the ID of the channel wherein the permission should be grantedpermName
- the name of the permission to grantpermValue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)Channel.getId()
,
Permission
public boolean addClientPermission(int clientDBId, String permName, int value, boolean skipped)
clientDBId
- the database ID of the client to grant the permissionpermName
- the name of the permission to grantvalue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)skipped
- if set to true
, the permission will not be overridden by channel permissionsClient.getDatabaseId()
,
Permission
public boolean addClientToServerGroup(int groupId, int clientDatabaseId)
Please note that a client cannot be added to default groups or template groups.
groupId
- the ID of the server group to add the client toclientDatabaseId
- the database ID of the client to addServerGroup.getId()
,
Client.getDatabaseId()
public boolean addComplaint(int clientDBId, String message)
clientDBId
- the database ID of the clientmessage
- the message of the complaint, may not contain BB codesClient.getDatabaseId()
,
Complaint.getMessage()
public boolean addPermissionToAllServerGroups(ServerGroupType type, String permName, int value, boolean negated, boolean skipped)
type
on all virtual servers.type
- the kind of server group this permission should be added topermName
- the name of the permission to be grantedvalue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)negated
- if set to true, the lowest permission value will be selected instead of the highestskipped
- if set to true, this permission will not be overridden by client of channel permissionsServerGroupType
,
Permission
public String addPrivilegeKey(TokenType type, int groupId, int channelId, String description)
type
is set to SERVER_GROUP,
groupId
is used as a server group ID and channelId
is ignored.type
is set to CHANNEL_GROUP,
groupId
is used as a channel group ID and channelId
is used as the channel in which the group should be set.type
- the type of token that should be createdgroupId
- the ID of the server or channel groupchannelId
- the ID of the channel, in case the token is channel group tokendescription
- the description for the token, can be nullTokenType
,
addPrivilegeKeyServerGroup(int, String)
,
addPrivilegeKeyChannelGroup(int, int, String)
public String addPrivilegeKeyChannelGroup(int channelGroupId, int channelId, String description)
channelGroupId
- the ID of the channel groupchannelId
- the ID of the channel in which the channel group should be setdescription
- the description for the token, can be nullChannelGroup.getId()
,
Channel.getId()
,
addPrivilegeKey(TokenType, int, int, String)
,
addPrivilegeKeyServerGroup(int, String)
public String addPrivilegeKeyServerGroup(int serverGroupId, String description)
serverGroupId
- the ID of the server groupdescription
- the description for the token, can be nullServerGroup.getId()
,
addPrivilegeKey(TokenType, int, int, String)
,
addPrivilegeKeyChannelGroup(int, int, String)
public int addServerGroup(String name)
To create server group templates or ones for server queries,
use addServerGroup(String, PermissionGroupDatabaseType)
.
name
- the name of the new server groupServerGroup
public int addServerGroup(String name, PermissionGroupDatabaseType type)
name
- the name of the new server grouptype
- the desired type of server groupServerGroup
,
PermissionGroupDatabaseType
public boolean addServerGroupPermission(int groupId, String permName, int value, boolean negated, boolean skipped)
groupId
- the ID of the channel group to which the permission should be addedpermName
- the name of the permission to addvalue
- the numeric value of the permission (or for boolean permissions: 1 = true, 0 = false)negated
- if set to true, the lowest permission value will be selected instead of the highestskipped
- if set to true, this permission will not be overridden by client of channel permissionsServerGroup.getId()
,
Permission
public void addTS3Listeners(TS3Listener... listeners)
TS3Listener
s to the event manager of the query.
These listeners will be notified when the TS3 server fires an event.
Note that for the TS3 server to fire events, you must first also register the event types you want to listen to.
listeners
- one or more listeners to registerregisterAllEvents()
,
registerEvent(TS3EventType, int)
,
TS3Listener
,
TS3EventType
public int[] banClient(int clientId, long timeInSeconds)
Please note that this will create two separate ban rules, one for the targeted client's IP address and their unique identifier.
clientId
- the ID of the clienttimeInSeconds
- the duration of the ban in seconds. 0 equals a permanent banClient.getId()
,
addBan(String, String, String, long, String)
public int[] banClient(int clientId, long timeInSeconds, String reason)
Please note that this will create two separate ban rules, one for the targeted client's IP address and their unique identifier.
clientId
- the ID of the clienttimeInSeconds
- the duration of the ban in seconds. 0 equals a permanent banreason
- the reason for the ban, can be nullClient.getId()
,
addBan(String, String, String, long, String)
public int[] banClient(int clientId, String reason)
Please note that this will create two separate ban rules, one for the targeted client's IP address and their unique identifier.
clientId
- the ID of the clientreason
- the reason for the ban, can be nullClient.getId()
,
addBan(String, String, String, long, String)
public boolean broadcast(String message)
message
- the message to be sentpublic boolean copyChannelGroup(int sourceGroupId, int targetGroupId, PermissionGroupDatabaseType type)
sourceGroupId
,
overwriting any other channel group specified by targetGroupId
.
The parameter type
can be used to create server query and template groups.
sourceGroupId
- the ID of the channel group to copytargetGroupId
- the ID of another channel group to overwritetype
- the desired type of channel groupChannelGroup.getId()
public int copyChannelGroup(int sourceGroupId, String targetName, PermissionGroupDatabaseType type)
sourceGroupId
with a given name
and returns the ID of the newly created channel group.sourceGroupId
- the ID of the channel group to copytargetName
- the name for the copy of the channel grouptype
- the desired type of channel groupChannelGroup.getId()
public boolean copyServerGroup(int sourceGroupId, int targetGroupId, PermissionGroupDatabaseType type)
sourceGroupId
,
overwriting another server group specified by targetGroupId
.
The parameter type
can be used to create server query and template groups.
sourceGroupId
- the ID of the server group to copytargetGroupId
- the ID of another server group to overwritetype
- the desired type of server groupServerGroup.getId()
public int copyServerGroup(int sourceGroupId, String targetName, PermissionGroupDatabaseType type)
sourceGroupId
with a given name
and returns the ID of the newly created server group.sourceGroupId
- the ID of the server group to copytargetName
- the name for the copy of the server grouptype
- the desired type of server groupServerGroup.getId()
public int createChannel(String name, Map<ChannelProperty,String> options)
name
- the name for the new channeloptions
- a map of options that should be set for the channelChannel
public CreatedVirtualServer createServer(String name, Map<VirtualServerProperty,String> options)
If VirtualServerProperty.VIRTUALSERVER_PORT
is not specified in the virtual server properties,
the server will test for the first unused UDP port.
Please also note that creating virtual servers usually requires the server query admin account and that there is a limit to how many virtual servers can be created, which is dependent on your license. Unlicensed TS3 server instances are limited to 1 virtual server with up to 32 client slots.
name
- the name for the new virtual serveroptions
- a map of options that should be set for the virtual serverVirtualServer
public Snapshot createServerSnapshot()
Snapshot
of the selected virtual server containing all settings,
groups and known client identities. The data from a server snapshot can be
used to restore a virtual servers configuration.deployServerSnapshot(Snapshot)
public boolean deleteAllBans()
public boolean deleteAllComplaints(int clientDBId)
clientDBId
- the database ID of the clientClient.getDatabaseId()
,
Complaint
public boolean deleteBan(int banId)
banId
- the ID of the ban to deleteBan.getId()
public boolean deleteChannel(int channelId)
channelId
- the ID of the channel to deleteChannel.getId()
,
deleteChannel(int, boolean)
,
kickClientFromChannel(String, int...)
public boolean deleteChannel(int channelId, boolean force)
force
is true, the channel will be deleted even if there are clients within,
else the command will fail in this situation.channelId
- the ID of the channel to deleteforce
- whether clients should be kicked out of the channelChannel.getId()
,
kickClientFromChannel(String, int...)
public boolean deleteChannelClientPermission(int channelId, int clientDBId, String permName)
channelId
- the ID of the channel wherein the permission should be removedclientDBId
- the database ID of the clientpermName
- the name of the permission to revokeChannel.getId()
,
Client.getDatabaseId()
,
Permission.getName()
public boolean deleteChannelGroup(int groupId)
groupId
- the ID of the channel groupChannelGroup.getId()
public boolean deleteChannelGroup(int groupId, boolean force)
force
is true, the channel group will be deleted even if it still contains clients,
else the command will fail in this situation.groupId
- the ID of the channel groupforce
- whether the channel group should be deleted even if it still contains clientsChannelGroup.getId()
public boolean deleteChannelGroupPermission(int groupId, String permName)
groupId
- the ID of the channel grouppermName
- the name of the permission to revokeChannelGroup.getId()
,
Permission.getName()
public boolean deleteChannelPermission(int channelId, String permName)
channelId
- the ID of the channelpermName
- the name of the permission to revokeChannel.getId()
,
Permission.getName()
public boolean deleteClientPermission(int clientDBId, String permName)
clientDBId
- the database ID of the clientpermName
- the name of the permission to revokeClient.getDatabaseId()
,
Permission.getName()
public boolean deleteComplaint(int targetClientDBId, int fromClientDBId)
targetClientDBId
submitted by
the client with database ID fromClientDBId
from the server.targetClientDBId
- the database ID of the client the complaint is aboutfromClientDBId
- the database ID of the client who added the complaintComplaint
,
Client.getDatabaseId()
public boolean deleteDatabaseClientProperties(int clientDBId)
See DatabaseClientInfo
for a list of stored information about a client.
clientDBId
- the database ID of the clientClient.getDatabaseId()
,
getDatabaseClientInfo(int)
,
DatabaseClientInfo
public boolean deleteOfflineMessage(int messageId)
messageId
- the ID of the offline message to deleteMessage.getId()
public boolean deletePermissionFromAllServerGroups(ServerGroupType type, String permName)
type
on all virtual servers.type
- the kind of server group this permission should be removed frompermName
- the name of the permission to removeServerGroupType
,
Permission.getName()
public boolean deletePrivilegeKey(String token)
token
- the token of the privilege keyPrivilegeKey
public boolean deleteServer(int serverId)
Only stopped virtual servers can be deleted.
serverId
- the ID of the virtual serverVirtualServer.getId()
,
stopServer(int)
public boolean deleteServerGroup(int groupId)
groupId
- the ID of the server groupServerGroup.getId()
public boolean deleteServerGroup(int groupId, boolean force)
If force
is true, the server group will be deleted even if it contains clients,
else the command will fail in this situation.
groupId
- the ID of the server groupforce
- whether the server group should be deleted if it still contains clientsServerGroup.getId()
public boolean deleteServerGroupPermission(int groupId, String permName)
groupId
- the ID of the server grouppermName
- the name of the permission to revokeServerGroup.getId()
,
Permission.getName()
public boolean deployServerSnapshot(Snapshot snapshot)
snapshot
- the snapshot to restorecreateServerSnapshot()
public boolean deployServerSnapshot(String snapshot)
snapshot
- the snapshot to restorecreateServerSnapshot()
public boolean editChannel(int channelId, Map<ChannelProperty,String> options)
channelId
- the ID of the channel to editoptions
- the map of properties to modifyChannel.getId()
public boolean editClient(int clientId, Map<ClientProperty,String> options)
Only ClientProperty.CLIENT_DESCRIPTION
can be changed for other clients.
To update the current client's properties, use updateClient(Map)
.
clientId
- the ID of the client to editoptions
- the map of properties to modifyClient.getId()
,
updateClient(Map)
public boolean editDatabaseClient(int clientDBId, Map<ClientProperty,String> options)
clientDBId
- the database ID of the client to editoptions
- the map of properties to modifyDatabaseClientInfo
,
Client.getDatabaseId()
public boolean editInstance(ServerInstanceProperty property, String value)
IllegalArgumentException
will be thrown.property
- the property to edit, must be changeablevalue
- the new value for the editIllegalArgumentException
- if property
is not changeableServerInstanceProperty.isChangeable()
public boolean editServer(Map<VirtualServerProperty,String> options)
options
- the map of properties to editVirtualServerProperty
public List<Ban> getBans()
Ban
public List<Binding> getBindings()
Binding
public Channel getChannelByNameExact(String name, boolean ignoreCase)
name
- the name of the channelignoreCase
- whether the case of the name should be ignorednull
if no channel was foundChannel
,
getChannelsByName(String)
public List<Channel> getChannelsByName(String name)
name
- the name to searchChannel
,
getChannelByNameExact(String, boolean)
public List<Permission> getChannelClientPermissions(int channelId, int clientDBId)
channelId
- the ID of the channelclientDBId
- the database ID of the clientChannel.getId()
,
Client.getDatabaseId()
,
Permission
public List<ChannelGroupClient> getChannelGroupClients(int channelId, int clientDBId, int groupId)
-1
.channelId
- restricts the search to the channel with a specified ID. Set to -1
to ignore.clientDBId
- restricts the search to the client with a specified database ID. Set to -1
to ignore.groupId
- restricts the search to the channel group with the specified ID. Set to -1
to ignore.Channel.getId()
,
Client.getDatabaseId()
,
ChannelGroup.getId()
,
ChannelGroupClient
public List<ChannelGroupClient> getChannelGroupClientsByChannelGroupId(int groupId)
groupId
- the ID of the channel group whose client / channel assignments should be returned.ChannelGroup.getId()
,
ChannelGroupClient
,
getChannelGroupClients(int, int, int)
public List<ChannelGroupClient> getChannelGroupClientsByChannelId(int channelId)
channelId
- the ID of the channel whose channel group assignments should be returned.Channel.getId()
,
ChannelGroupClient
,
getChannelGroupClients(int, int, int)
public List<ChannelGroupClient> getChannelGroupClientsByClientDBId(int clientDBId)
clientDBId
- the database ID of the client whose channel groupClient.getDatabaseId()
,
ChannelGroupClient
,
getChannelGroupClients(int, int, int)
public List<Permission> getChannelGroupPermissions(int groupId)
groupId
- the ID of the channel group.ChannelGroup.getId()
,
Permission
public List<ChannelGroup> getChannelGroups()
ChannelGroup
public ChannelInfo getChannelInfo(int channelId)
channelId
- the ID of the channelChannel.getId()
,
ChannelInfo
public List<Permission> getChannelPermissions(int channelId)
channelId
- the ID of the channelChannel.getId()
,
Permission
public List<Channel> getChannels()
Channel
public Client getClientByNameExact(String name, boolean ignoreCase)
name
- the name of the clientignoreCase
- whether the case of the name should be ignorednull
if no client was foundClient
,
getClientsByName(String)
public List<Client> getClientsByName(String name)
name
- the name to searchClient
,
getClientByNameExact(String, boolean)
public ClientInfo getClientByUId(String clientUId)
clientUId
- the unique identifier of the clientnull
if no client was foundClient.getUniqueIdentifier()
,
ClientInfo
public ClientInfo getClientInfo(int clientId)
clientId
- the client ID of the clientnull
if no client was foundClient.getId()
,
ClientInfo
public List<Permission> getClientPermissions(int clientDBId)
clientDBId
- the database ID of the clientClient.getDatabaseId()
,
Permission
public List<Client> getClients()
Client
public List<Complaint> getComplaints()
Complaint
,
getComplaints(int)
public List<Complaint> getComplaints(int clientDBId)
clientDBId
- the database ID of the clientClient.getDatabaseId()
,
Complaint
public ConnectionInfo getConnectionInfo()
ConnectionInfo
,
getServerInfo()
public List<DatabaseClientInfo> getDatabaseClientsByName(String name)
name
- the nickname for the clients to matchClient.getNickname()
public DatabaseClientInfo getDatabaseClientByUId(String clientUId)
clientUId
- the unique identifier of the clientnull
if no client was foundClient.getUniqueIdentifier()
,
DatabaseClientInfo
public DatabaseClientInfo getDatabaseClientInfo(int clientDBId)
clientDBId
- the database ID of the clientnull
if no client was foundClient.getDatabaseId()
,
DatabaseClientInfo
public List<DatabaseClient> getDatabaseClients()
As this method uses internal commands which can only return 200 clients at once, this method can take quite some time to execute.
Also keep in mind that the client database can easily accumulate several thousand entries.
List
of all database clientsDatabaseClient
public HostInfo getHostInfo()
public InstanceInfo getInstanceInfo()
public String getOfflineMessage(int messageId)
messageId
- the ID of the message to be readnull
if there was no message with that IDMessage.getId()
,
setMessageRead(int)
public String getOfflineMessage(Message message)
message
- the message to be readnull
if there was no message with that IDMessage.getId()
,
setMessageRead(Message)
public List<Message> getOfflineMessages()
getOfflineMessage(int)
or getOfflineMessage(Message)
.public List<AdvancedPermission> getPermissionAssignments(String permName)
permName
. The output includes the type and the ID of the client,
channel or group associated with the permission.permName
- the name of the permissiongetPermissionOverview(int, int)
public int getPermissionIdByName(String permName)
permName
.
Note that the use of numeric permission IDs is deprecated and that this API only uses the string variant of the IDs.
permName
- the name of the permissionpublic List<AdvancedPermission> getPermissionOverview(int channelId, int clientDBId)
channelId
to -1
.channelId
- the ID of the channelclientDBId
- the database ID of the client to create the overview forChannel.getId()
,
Client.getDatabaseId()
public List<PermissionInfo> getPermissions()
public int getPermissionValue(String permName)
permName
- the name of the permissionpublic List<PrivilegeKey> getPrivilegeKeys()
addPrivilegeKey(TokenType, int, int, String)
,
usePrivilegeKey(String)
public List<ServerGroupClient> getServerGroupClients(int serverGroupId)
serverGroupId
- the ID of the server group for which the clients should be looked uppublic List<ServerGroupClient> getServerGroupClients(ServerGroup serverGroup)
serverGroup
- the server group for which the clients should be looked uppublic List<Permission> getServerGroupPermissions(int serverGroupId)
serverGroupId
- the ID of the server group for which the permissions should be looked upServerGroup.getId()
,
getServerGroupPermissions(ServerGroup)
public List<Permission> getServerGroupPermissions(ServerGroup serverGroup)
serverGroup
- the server group for which the permissions should be looked uppublic List<ServerGroup> getServerGroups()
Depending on your permissions, the output may also contain global server query groups and template groups.
public List<ServerGroup> getServerGroupsByClientId(int clientDatabaseId)
clientDatabaseId
- the database ID of the client for which the server groups should be looked upClient.getDatabaseId()
,
getServerGroupsByClient(Client)
public List<ServerGroup> getServerGroupsByClient(Client client)
client
- the client for which the server groups should be looked upgetServerGroupsByClientId(int)
public int getServerIdByPort(int port)
port
- the port of a virtual serverVirtualServer.getPort()
,
VirtualServer.getId()
public VirtualServerInfo getServerInfo()
public Version getVersion()
public List<VirtualServer> getVirtualServers()
public boolean kickClientFromChannel(int... clientIds)
clientIds
- the IDs of the clients to kickkickClientFromChannel(Client...)
,
kickClientFromChannel(String, int...)
public boolean kickClientFromChannel(Client... clients)
clients
- the clients to kickkickClientFromChannel(int...)
,
kickClientFromChannel(String, Client...)
public boolean kickClientFromChannel(String message, int... clientIds)
message
- the reason message to display to the clientsclientIds
- the IDs of the clients to kickClient.getId()
,
kickClientFromChannel(int...)
,
kickClientFromChannel(String, Client...)
public boolean kickClientFromChannel(String message, Client... clients)
message
- the reason message to display to the clientsclients
- the clients to kickkickClientFromChannel(Client...)
,
kickClientFromChannel(String, int...)
public boolean kickClientFromServer(int... clientIds)
clientIds
- the IDs of the clients to kickClient.getId()
,
kickClientFromServer(Client...)
,
kickClientFromServer(String, int...)
public boolean kickClientFromServer(Client... clients)
clients
- the clients to kickkickClientFromServer(int...)
,
kickClientFromServer(String, Client...)
public boolean kickClientFromServer(String message, int... clientIds)
message
- the reason message to display to the clientsclientIds
- the IDs of the clients to kickClient.getId()
,
kickClientFromServer(int...)
,
kickClientFromServer(String, Client...)
public boolean kickClientFromServer(String message, Client... clients)
message
- the reason message to display to the clientsclients
- the clients to kickkickClientFromServer(Client...)
,
kickClientFromServer(String, int...)
public boolean login(String username, String password)
Note that you can also set the login in the TS3Config
,
so that you will be logged in right after the connection is established.
username
- the username of the server querypassword
- the password to useTS3Config.setLoginCredentials(String, String)
,
logout()
public boolean logout()
login(String, String)
public boolean moveChannel(int channelId, int channelTargetId)
channelTargetId
to 0
.
This will move the channel right below the specified parent channel, above all other child channels. This command will fail if the channel already has the specified target channel as the parent channel.
channelId
- the channel to movechannelTargetId
- the new parent channel for the specified channelChannel.getId()
,
moveChannel(int, int, int)
public boolean moveChannel(int channelId, int channelTargetId, int order)
channelTargetId
to 0
.
The channel will be ordered below the channel with the ID specified by order
.
To move the channel right below the parent channel, set order
to 0
.
Also note that a channel cannot be re-ordered without also changing its parent channel.
channelId
- the channel to movechannelTargetId
- the new parent channel for the specified channelorder
- the channel to sort the specified channel belowChannel.getId()
,
moveChannel(int, int)
public boolean moveClient(int channelId)
channelId
- the ID of the channel to move the client intoChannel.getId()
public boolean moveClient(ChannelBase channel)
channel
- the channel to move the client intopublic boolean moveClient(int channelId, String channelPassword)
channelId
- the ID of the channel to move the client intochannelPassword
- the password of the channelChannel.getId()
public boolean moveClient(ChannelBase channel, String channelPassword)
channel
- the channel to move the client intochannelPassword
- the password of the channelpublic boolean moveClient(int clientId, int channelId)
clientId
- the ID of the client to movechannelId
- the ID of the channel to move the client intoClient.getId()
,
Channel.getId()
public boolean moveClient(Client client, ChannelBase channel)
client
- the client to movechannel
- the channel to move the client intopublic boolean moveClient(int clientId, int channelId, String channelPassword)
clientId
- the ID of the client to movechannelId
- the ID of the channel to move the client intochannelPassword
- the password of the channelClient.getId()
,
Channel.getId()
public boolean moveClient(Client client, ChannelBase channel, String channelPassword)
client
- the client to movechannel
- the channel to move the client intochannelPassword
- the password of the channelpublic boolean pokeClient(int clientId, String message)
hh:mm:ss - "Your Nickname" poked you: <your message in green color>
The displayed message length is limited to 100 UTF-8 bytes. If a client has already received a poke message, all subsequent pokes will simply add a line to the already opened popup window and will still play a sound.
clientId
- the ID of the client to pokemessage
- the message to send, may contain BB codesClient.getId()
@Deprecated public boolean quit()
TS3Query.exit()
.public boolean registerAllEvents()
This means that the following actions will trigger event notifications:
The limitations to when the query receives notifications about chat events cannot be circumvented.
To be able to process these events in your application, register an event listener.addTS3Listeners(TS3Listener...)
public boolean registerEvent(TS3EventType eventType)
If used with TS3EventType.TEXT_CHANNEL
, this will listen to chat events in the current channel.
If used with TS3EventType.CHANNEL
, this will listen to all channel events.
To specify a different channel for channel events, use registerEvent(TS3EventType, int)
.
eventType
- the event type to be notified aboutaddTS3Listeners(TS3Listener...)
,
registerEvent(TS3EventType, int)
,
registerAllEvents()
public boolean registerEvent(TS3EventType eventType, int channelId)
eventType
- the event type to be notified aboutchannelId
- the ID of the channel to listen to, will be ignored if set to -1
.
Can be set to 0
for TS3EventType.CHANNEL
to receive notifications about all channel switches.Channel.getId()
,
addTS3Listeners(TS3Listener...)
,
registerAllEvents()
public boolean registerEvents(TS3EventType... eventTypes)
If used with TS3EventType.TEXT_CHANNEL
, this will listen to chat events in the current channel.
If used with TS3EventType.CHANNEL
, this will listen to all channel events.
To specify a different channel for channel events, use registerEvent(TS3EventType, int)
.
eventTypes
- the event types to be notified aboutaddTS3Listeners(TS3Listener...)
,
registerEvent(TS3EventType, int)
,
registerAllEvents()
public boolean removeClientFromServerGroup(int serverGroupId, int clientDatabaseId)
serverGroupId
- the ID of the server groupclientDatabaseId
- the database ID of the clientServerGroup.getId()
,
Client.getDatabaseId()
,
removeClientFromServerGroup(ServerGroup, Client)
public boolean removeClientFromServerGroup(ServerGroup serverGroup, Client client)
serverGroup
- the server group to remove the client fromclient
- the client to remove from the server groupremoveClientFromServerGroup(int, int)
public void removeTS3Listeners(TS3Listener... listeners)
TS3Listener
s to the event manager of the query.
If a listener was not actually registered, it will be ignored and no exception will be thrown.
listeners
- one or more listeners to removeaddTS3Listeners(TS3Listener...)
,
TS3Listener
,
TS3EventType
public boolean renameChannelGroup(int channelGroupId, String name)
channelGroupId
- the ID of the channel group to renamename
- the new name for the channel groupChannelGroup.getId()
,
renameChannelGroup(ChannelGroup, String)
public boolean renameChannelGroup(ChannelGroup channelGroup, String name)
channelGroup
- the channel group to renamename
- the new name for the channel grouprenameChannelGroup(int, String)
public boolean renameServerGroup(int serverGroupId, String name)
serverGroupId
- the ID of the server group to renamename
- the new name for the server groupServerGroup.getId()
,
renameServerGroup(ServerGroup, String)
public boolean renameServerGroup(ServerGroup serverGroup, String name)
serverGroup
- the server group to renamename
- the new name for the server grouprenameServerGroup(int, String)
public String resetPermissions()
public boolean selectVirtualServerById(int id)
id
- the ID of the virtual serverVirtualServer.getId()
,
selectVirtualServerByPort(int)
,
selectVirtualServer(VirtualServer)
public boolean selectVirtualServerByPort(int port)
port
- the voice port of the virtual serverVirtualServer.getPort()
,
selectVirtualServerById(int)
,
selectVirtualServer(VirtualServer)
public boolean selectVirtualServer(VirtualServer server)
server
- the virtual server to move intoselectVirtualServerById(int)
,
selectVirtualServerByPort(int)
public boolean sendOfflineMessage(String clientUId, String subject, String message)
The message subject's length is limited to 200 UTF-8 bytes and BB codes in it will be ignored. The message body's length is limited to 4096 UTF-8 bytes and accepts BB codes
clientUId
- the unique identifier of the client to send the message tosubject
- the subject for the message, may not contain BB codesmessage
- the actual message body, may contain BB codesClient.getUniqueIdentifier()
,
Message
public boolean sendTextMessage(TextMessageTargetMode targetMode, int targetId, String message)
To send a message to all virtual servers, use broadcast(String)
.
To send an offline message, use sendOfflineMessage(String, String, String)
.
targetMode
- where the message should be sent totargetId
- the client ID of the recipient of this message. This value is ignored unless targetMode
is CLIENT
message
- the text message to sendClient.getId()
public boolean sendChannelMessage(int channelId, String message)
This will move the client into the channel with the specified channel ID, but will not move it back to the original channel!
channelId
- the ID of the channel to which the message should be sent tomessage
- the text message to sendsendChannelMessage(String)
,
Channel.getId()
public boolean sendChannelMessage(String message)
message
- the text message to sendpublic boolean sendServerMessage(int serverId, String message)
This will move the client to the virtual server with the specified server ID, but will not move it back to the original virtual server!
serverId
- the ID of the virtual server to which the message should be sent tomessage
- the text message to sendsendServerMessage(String)
,
VirtualServer.getId()
public boolean sendServerMessage(String message)
message
- the text message to sendpublic boolean sendPrivateMessage(int clientId, String message)
clientId
- the ID of the client to send the message tomessage
- the text message to sendClient.getId()
public boolean setClientChannelGroup(int groupId, int channelId, int clientDBId)
groupId
- the ID of the group the client should joinchannelId
- the ID of the channel where the channel group should be assignedclientDBId
- the database ID of the client for which the channel group should be setChannelGroup.getId()
,
Channel.getId()
,
Client.getDatabaseId()
public boolean setMessageRead(int messageId)
messageId
- the ID of the message for which the read flag should be setsetMessageReadFlag(int, boolean)
public boolean setMessageRead(Message message)
message
- the message for which the read flag should be setsetMessageRead(int)
,
setMessageReadFlag(Message, boolean)
,
deleteOfflineMessage(int)
public boolean setMessageReadFlag(int messageId, boolean read)
messageId
- the ID of the message for which the read flag should be setread
- the boolean value to which the read flag should be setsetMessageRead(int)
,
setMessageReadFlag(Message, boolean)
,
deleteOfflineMessage(int)
public boolean setMessageReadFlag(Message message, boolean read)
message
- the message for which the read flag should be setread
- the boolean value to which the read flag should be setsetMessageRead(Message)
,
setMessageReadFlag(int, boolean)
,
deleteOfflineMessage(int)
public boolean setNickname(String nickname)
nickname
- the new nickname, may not contain any BB codes and may not be null
updateClient(Map)
public boolean startServer(int serverId)
serverId
- the ID of the virtual serverpublic boolean startServer(VirtualServer virtualServer)
virtualServer
- the virtual server to startpublic boolean stopServer(int serverId)
serverId
- the ID of the virtual serverpublic boolean stopServer(VirtualServer virtualServer)
virtualServer
- the virtual server to stoppublic boolean stopServerProcess()
To have permission to use this command, you need to use the server query admin login.
public boolean unregisterAllEvents()
public boolean updateClient(Map<ClientProperty,String> options)
options
- the map of properties to updateeditClient(int, Map)
public String updateServerQueryLogin(String loginName)
This will remove the current login credentials! You won't be logged out, but after disconnecting, the old credentials will no longer work. Make sure to not lock yourselves out!
loginName
- the name for the server query loginpublic boolean usePrivilegeKey(String token)
token
- the privilege key to usePrivilegeKey
,
addPrivilegeKey(TokenType, int, int, String)
,
usePrivilegeKey(PrivilegeKey)
public boolean usePrivilegeKey(PrivilegeKey privilegeKey)
privilegeKey
- the privilege key to usePrivilegeKey
,
addPrivilegeKey(TokenType, int, int, String)
,
usePrivilegeKey(String)
public ServerQueryInfo whoAmI()
getClientInfo(int)
Copyright © 2015. All rights reserved.