Handle notifypermissionlist, Init127
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.github.manevolent.ts3j.event;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PermissionListEvent extends BaseEvent {
|
||||
public PermissionListEvent(Map<String, String> map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fire(TS3Listener listener) {
|
||||
listener.onPermissionList(this);
|
||||
}
|
||||
}
|
||||
@@ -79,6 +79,8 @@ public interface TS3Event {
|
||||
return new ClientPokeEvent(command.toMap());
|
||||
case "notifyclientchatcomposing": // CLIENT
|
||||
return new ClientChatComposingEvent(command.toMap());
|
||||
case "notifypermissionlist": // CLIENT
|
||||
return new PermissionListEvent(command.toMap());
|
||||
default:
|
||||
throw new IllegalArgumentException("unknown event: " + command.getName());
|
||||
}
|
||||
|
||||
@@ -52,4 +52,5 @@ public interface TS3Listener {
|
||||
default void onServerGroupClientDeleted(ServerGroupClientDeletedEvent e) {}
|
||||
default void onClientPoke(ClientPokeEvent e) {}
|
||||
default void onClientComposing(ClientChatComposingEvent e) {}
|
||||
default void onPermissionList(PermissionListEvent e) {}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,9 @@ public class PacketBody8Init1 extends PacketBody {
|
||||
case 4:
|
||||
step = new Step4();
|
||||
break;
|
||||
case 127:
|
||||
step = new Step127();
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("invalid Init1 step: " + stepNumber);
|
||||
}
|
||||
@@ -423,4 +426,25 @@ public class PacketBody8Init1 extends PacketBody {
|
||||
return 64 + 64 + 4 + 100 + 64 + clientivcommand.length;
|
||||
}
|
||||
}
|
||||
|
||||
public class Step127 extends Step {
|
||||
protected Step127() {
|
||||
super((byte)127, ProtocolRole.SERVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ByteBuffer byteBuffer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuffer byteBuffer) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,15 +24,11 @@ public class ServerConnectionTest {
|
||||
|
||||
Ts3Debugging.setEnabled(true);
|
||||
|
||||
LocalIdentity identity = LocalIdentity.load(
|
||||
new BigInteger(Base64.getDecoder().decode("Tj6YXM3qyRv8n25L2pH+OEJnRUl4auQf8+znjYrOmWU="))
|
||||
);
|
||||
|
||||
identity.improveSecurity(10);
|
||||
LocalIdentity identity = LocalIdentity.generateNew(9);
|
||||
|
||||
client.setIdentity(identity);
|
||||
client.setNickname("Hello from Java");
|
||||
client.setHWID("JAVAJAVAJAVA");
|
||||
client.setNickname("ts3j issue 2");
|
||||
client.setHWID("TestTestTest");
|
||||
|
||||
|
||||
while (true) {
|
||||
@@ -49,7 +45,7 @@ public class ServerConnectionTest {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
client.disconnect();
|
||||
Thread.sleep(30000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user