Skip to content

Commit bf94d2e

Browse files
BarofiosoBarofioso
authored andcommitted
Adding all Channel Events
1 parent d414467 commit bf94d2e

9 files changed

Lines changed: 197 additions & 3 deletions

File tree

src/main/java/com/github/theholywaffle/teamspeak3/EventManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.github.theholywaffle.teamspeak3.api.event.ChannelDescriptionEditedEvent;
3737
import com.github.theholywaffle.teamspeak3.api.event.ChannelEditedEvent;
3838
import com.github.theholywaffle.teamspeak3.api.event.ChannelMovedEvent;
39+
import com.github.theholywaffle.teamspeak3.api.event.ChannelPasswordChangedEvent;
3940
import com.github.theholywaffle.teamspeak3.api.event.ClientJoinEvent;
4041
import com.github.theholywaffle.teamspeak3.api.event.ClientLeaveEvent;
4142
import com.github.theholywaffle.teamspeak3.api.event.ClientMovedEvent;
@@ -63,6 +64,7 @@ public EventManager() {
6364
map.put("notifychannelcreated", new ChannelCreateEvent());
6465
map.put("notifychanneldeleted", new ChannelDeletedEvent());
6566
map.put("notifychannelmoved", new ChannelMovedEvent());
67+
map.put("notifychannelpasswordchanged", new ChannelPasswordChangedEvent());
6668
}
6769

6870
public void addListeners(TS3Listener... listeners) {

src/main/java/com/github/theholywaffle/teamspeak3/api/event/ChannelCreateEvent.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
package com.github.theholywaffle.teamspeak3.api.event;
1+
package com.github.theholywaffle.teamspeak3.api.event;
2+
3+
/*
4+
* #%L
5+
* TeamSpeak 3 Java API
6+
* %%
7+
* Copyright (C) 2014 Bert De Geyter
8+
* %%
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
* #L%
27+
*/
28+
229

330
import java.util.HashMap;
431

src/main/java/com/github/theholywaffle/teamspeak3/api/event/ChannelDeletedEvent.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
package com.github.theholywaffle.teamspeak3.api.event;
1+
package com.github.theholywaffle.teamspeak3.api.event;
2+
3+
/*
4+
* #%L
5+
* TeamSpeak 3 Java API
6+
* %%
7+
* Copyright (C) 2014 Bert De Geyter
8+
* %%
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
* #L%
27+
*/
28+
229

330
import java.util.HashMap;
431

src/main/java/com/github/theholywaffle/teamspeak3/api/event/ChannelMovedEvent.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,31 @@
1-
package com.github.theholywaffle.teamspeak3.api.event;
1+
package com.github.theholywaffle.teamspeak3.api.event;
2+
3+
/*
4+
* #%L
5+
* TeamSpeak 3 Java API
6+
* %%
7+
* Copyright (C) 2014 Bert De Geyter
8+
* %%
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
* #L%
27+
*/
28+
229

330
import java.util.HashMap;
431

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.github.theholywaffle.teamspeak3.api.event;
2+
3+
import java.util.HashMap;
4+
5+
import com.github.theholywaffle.teamspeak3.api.wrapper.Wrapper;
6+
7+
public class ChannelPasswordChangedEvent extends Wrapper implements TS3EventEmitter {
8+
9+
public ChannelPasswordChangedEvent() {
10+
super(null);
11+
}
12+
public ChannelPasswordChangedEvent(HashMap<String, String> map) {
13+
super(map);
14+
}
15+
16+
public int getChannelId() {
17+
return getInt("cid");
18+
}
19+
public int getReasonId(){
20+
return getInt("reasonid");
21+
}
22+
public int getInvokerId(){
23+
return getInt("invokerid");
24+
}
25+
public String getInvokerName(){
26+
return get("invokername");
27+
}
28+
public String getInvokerUId(){
29+
return get("invokeruid");
30+
}
31+
@Override
32+
public void fire(TS3Listener listener, HashMap<String, String> map) {
33+
listener.onChannelPasswordChanged(new ChannelPasswordChangedEvent(map));
34+
35+
}
36+
37+
}

src/main/java/com/github/theholywaffle/teamspeak3/api/event/DefaultListener.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,10 @@ public void onChannelMoved(ChannelMovedEvent e) {
110110

111111
}
112112

113+
@Override
114+
public void onChannelPasswordChanged(ChannelPasswordChangedEvent e) {
115+
// TODO Auto-generated method stub
116+
117+
}
118+
113119
}

src/main/java/com/github/theholywaffle/teamspeak3/api/event/TS3Listener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@ public interface TS3Listener {
7474

7575
public void onChannelMoved(ChannelMovedEvent e);
7676

77+
public void onChannelPasswordChanged(ChannelPasswordChangedEvent e);
78+
7779
}

src/main/java/com/github/theholywaffle/teamspeak3/example/ChatBotExample.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@
1010
******************************************************************************/
1111
package com.github.theholywaffle.teamspeak3.example;
1212

13+
/*
14+
* #%L
15+
* TeamSpeak 3 Java API
16+
* %%
17+
* Copyright (C) 2014 Bert De Geyter
18+
* %%
19+
* Permission is hereby granted, free of charge, to any person obtaining a copy
20+
* of this software and associated documentation files (the "Software"), to deal
21+
* in the Software without restriction, including without limitation the rights
22+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23+
* copies of the Software, and to permit persons to whom the Software is
24+
* furnished to do so, subject to the following conditions:
25+
*
26+
* The above copyright notice and this permission notice shall be included in
27+
* all copies or substantial portions of the Software.
28+
*
29+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35+
* THE SOFTWARE.
36+
* #L%
37+
*/
38+
1339
import java.util.logging.Level;
1440

1541
import com.github.theholywaffle.teamspeak3.TS3Api;
@@ -21,6 +47,7 @@
2147
import com.github.theholywaffle.teamspeak3.api.event.ChannelDescriptionEditedEvent;
2248
import com.github.theholywaffle.teamspeak3.api.event.ChannelEditedEvent;
2349
import com.github.theholywaffle.teamspeak3.api.event.ChannelMovedEvent;
50+
import com.github.theholywaffle.teamspeak3.api.event.ChannelPasswordChangedEvent;
2451
import com.github.theholywaffle.teamspeak3.api.event.ClientJoinEvent;
2552
import com.github.theholywaffle.teamspeak3.api.event.ClientLeaveEvent;
2653
import com.github.theholywaffle.teamspeak3.api.event.ClientMovedEvent;
@@ -103,6 +130,12 @@ public void onChannelMoved(ChannelMovedEvent e) {
103130
// TODO Auto-generated method stub
104131

105132
}
133+
134+
@Override
135+
public void onChannelPasswordChanged(ChannelPasswordChangedEvent e) {
136+
// TODO Auto-generated method stub
137+
138+
}
106139
});
107140
}
108141

src/main/java/com/github/theholywaffle/teamspeak3/example/EventListenerExample.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@
1010
******************************************************************************/
1111
package com.github.theholywaffle.teamspeak3.example;
1212

13+
/*
14+
* #%L
15+
* TeamSpeak 3 Java API
16+
* %%
17+
* Copyright (C) 2014 Bert De Geyter
18+
* %%
19+
* Permission is hereby granted, free of charge, to any person obtaining a copy
20+
* of this software and associated documentation files (the "Software"), to deal
21+
* in the Software without restriction, including without limitation the rights
22+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23+
* copies of the Software, and to permit persons to whom the Software is
24+
* furnished to do so, subject to the following conditions:
25+
*
26+
* The above copyright notice and this permission notice shall be included in
27+
* all copies or substantial portions of the Software.
28+
*
29+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35+
* THE SOFTWARE.
36+
* #L%
37+
*/
38+
1339
import java.util.logging.Level;
1440

1541
import com.github.theholywaffle.teamspeak3.TS3Api;
@@ -20,6 +46,7 @@
2046
import com.github.theholywaffle.teamspeak3.api.event.ChannelDescriptionEditedEvent;
2147
import com.github.theholywaffle.teamspeak3.api.event.ChannelEditedEvent;
2248
import com.github.theholywaffle.teamspeak3.api.event.ChannelMovedEvent;
49+
import com.github.theholywaffle.teamspeak3.api.event.ChannelPasswordChangedEvent;
2350
import com.github.theholywaffle.teamspeak3.api.event.ClientJoinEvent;
2451
import com.github.theholywaffle.teamspeak3.api.event.ClientLeaveEvent;
2552
import com.github.theholywaffle.teamspeak3.api.event.ClientMovedEvent;
@@ -101,6 +128,12 @@ public void onChannelMoved(ChannelMovedEvent e) {
101128
// TODO Auto-generated method stub
102129

103130
}
131+
132+
@Override
133+
public void onChannelPasswordChanged(ChannelPasswordChangedEvent e) {
134+
// TODO Auto-generated method stub
135+
136+
}
104137
});
105138

106139

0 commit comments

Comments
 (0)