Fix missing group members on 2.5 clients
Build AsminVoicechat / build-and-release (push) Successful in 2m27s
Build AsminVoicechat / build-and-release (push) Successful in 2m27s
This commit is contained in:
1 parent
578e01eda3
commit
7a91c8a41d
7 files changed
+86
-10
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import de.maxhenkel.voicechat.voice.common.Secret;
|
||||
import de.maxhenkel.voicechat.net.ProtocolChannelCompatibility;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
@@ -9,6 +10,8 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class ProtocolCryptoSelfTest {
|
||||
public static void main(String[] args) throws Exception {
|
||||
testStateChannelCompatibility();
|
||||
|
||||
byte[] key = new byte[16];
|
||||
for (int i = 0; i < key.length; i++) key[i] = (byte) (i * 13 + 7);
|
||||
UUID legacyKey = uuidFromBytes(key);
|
||||
@@ -34,7 +37,23 @@ public class ProtocolCryptoSelfTest {
|
||||
throw new AssertionError("Hybrid server AES-GCM round-trip failed");
|
||||
}
|
||||
}
|
||||
System.out.println("PASS: 100 CBC client/server interop cycles and 100 GCM round-trips");
|
||||
System.out.println("PASS: legacy state-channel mapping, 100 CBC interop cycles and 100 GCM round-trips");
|
||||
}
|
||||
|
||||
private static void testStateChannelCompatibility() {
|
||||
check("voicechat:player_state", ProtocolChannelCompatibility.outgoingChannel("voicechat:state", 18));
|
||||
check("voicechat:player_states", ProtocolChannelCompatibility.outgoingChannel("voicechat:states", 18));
|
||||
if (ProtocolChannelCompatibility.outgoingChannel("voicechat:remove_state", 18) != null) {
|
||||
throw new AssertionError("The 2.5 client has no remove-state packet");
|
||||
}
|
||||
check("voicechat:state", ProtocolChannelCompatibility.outgoingChannel("voicechat:state", 20));
|
||||
check("voicechat:states", ProtocolChannelCompatibility.outgoingChannel("voicechat:states", 20));
|
||||
}
|
||||
|
||||
private static void check(String expected, String actual) {
|
||||
if (!expected.equals(actual)) {
|
||||
throw new AssertionError("Expected channel " + expected + ", got " + actual);
|
||||
}
|
||||
}
|
||||
|
||||
private static UUID uuidFromBytes(byte[] bytes) {
|
||||
|
||||
Reference in new issue
Block a user