-
Notifications
You must be signed in to change notification settings - Fork 110
/
ClientJoinEvent.java
178 lines (140 loc) · 4.87 KB
/
ClientJoinEvent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
package com.github.theholywaffle.teamspeak3.api.event;
/*
* #%L
* TeamSpeak 3 Java API
* %%
* Copyright (C) 2014 Bert De Geyter
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* #L%
*/
import com.github.theholywaffle.teamspeak3.api.ClientProperty;
import com.github.theholywaffle.teamspeak3.api.wrapper.Wrapper;
public class ClientJoinEvent extends BaseEvent {
public ClientJoinEvent(Wrapper wrapper) {
super(wrapper);
}
public int getClientFromId() {
return getInt("cfid");
}
public int getClientTargetId() {
return getInt("ctid");
}
public int getClientId() {
return getInt("clid");
}
public String getUniqueClientIdentifier() {
return get(ClientProperty.CLIENT_UNIQUE_IDENTIFIER);
}
public String getClientNickname() {
return get(ClientProperty.CLIENT_NICKNAME);
}
public boolean isClientInputMuted() {
return getBoolean(ClientProperty.CLIENT_INPUT_MUTED);
}
public boolean isClientOutputMuted() {
return getBoolean(ClientProperty.CLIENT_OUTPUT_MUTED);
}
public boolean isClientOutputOnlyMuted() {
return getBoolean(ClientProperty.CLIENT_OUTPUTONLY_MUTED);
}
public boolean isClientUsingHardwareInput() {
return getBoolean(ClientProperty.CLIENT_INPUT_HARDWARE);
}
public boolean isClientUsingHardwareOutput() {
return getBoolean(ClientProperty.CLIENT_OUTPUT_HARDWARE);
}
public String getClientMetadata() {
return get(ClientProperty.CLIENT_META_DATA);
}
public boolean isClientRecording() {
return getBoolean(ClientProperty.CLIENT_IS_RECORDING);
}
public int getClientDatabaseId() {
return getInt(ClientProperty.CLIENT_DATABASE_ID);
}
public int getClientChannelGroupId() {
return getInt(ClientProperty.CLIENT_CHANNEL_GROUP_ID);
}
public int getAmountOfServerGroups() {
//getInt was turning the String 1,2,3,.. to a int which wasn't right.
//Now it gets the Amount even if the ID is <=10
String[] split = get(ClientProperty.CLIENT_SERVERGROUPS).split(",");
return split.length;
}
public String getClientServerGroups() {
//getClientServerGroups returns a string containing the server group ID for example 1,2,3,...
return get(ClientProperty.CLIENT_SERVERGROUPS);
}
public boolean isClientAway() {
return getBoolean(ClientProperty.CLIENT_AWAY);
}
public String getClientAwayMessage() {
return get(ClientProperty.CLIENT_AWAY_MESSAGE);
}
public int getClientType() {
return getInt(ClientProperty.CLIENT_TYPE);
}
public String getClientFlagAvatarId() {
return get(ClientProperty.CLIENT_FLAG_AVATAR);
}
public int getClientTalkPower() {
return getInt(ClientProperty.CLIENT_TALK_POWER);
}
public boolean isClientRequestingToTalk() {
return getBoolean(ClientProperty.CLIENT_TALK_REQUEST);
}
public String getClientTalkRequestMessage() {
return get(ClientProperty.CLIENT_TALK_REQUEST_MSG);
}
public String getClientDescription() {
return get(ClientProperty.CLIENT_DESCRIPTION);
}
public boolean isClientTalking() {
return getBoolean(ClientProperty.CLIENT_IS_TALKER);
}
public boolean isClientPrioritySpeaker() {
return getBoolean(ClientProperty.CLIENT_IS_PRIORITY_SPEAKER);
}
public int getClientUnreadMessages() {
return getInt(ClientProperty.CLIENT_UNREAD_MESSAGES);
}
public String getClientPhoneticNickname() {
return get(ClientProperty.CLIENT_NICKNAME_PHONETIC);
}
public int getClientNeededServerQueryViewPower() {
return getInt(ClientProperty.CLIENT_NEEDED_SERVERQUERY_VIEW_POWER);
}
public long getClientIconId() {
return getLong(ClientProperty.CLIENT_ICON_ID);
}
public boolean isClientChannelCommander() {
return getBoolean(ClientProperty.CLIENT_IS_CHANNEL_COMMANDER);
}
public String getClientCountry() {
return get(ClientProperty.CLIENT_COUNTRY);
}
public int getClientInheritedChannelGroupId() {
return getInt(ClientProperty.CLIENT_CHANNEL_GROUP_INHERITED_CHANNEL_ID);
}
@Override
public void fire(TS3Listener listener) {
listener.onClientJoin(this);
}
}