|
32 | 32 | import me.vlod.pinto.networking.packet.PacketRegister; |
33 | 33 | import me.vlod.pinto.networking.packet.PacketRemoveContact; |
34 | 34 | import me.vlod.pinto.networking.packet.PacketServerID; |
| 35 | +import me.vlod.pinto.networking.packet.PacketSetOption; |
35 | 36 | import me.vlod.pinto.networking.packet.PacketStatus; |
36 | 37 | import me.vlod.pinto.networking.packet.PacketTyping; |
37 | 38 |
|
38 | 39 | public class NetworkHandler { |
39 | | - public static final int PROTOCOL_VERSION = 2; |
| 40 | + public static final int PROTOCOL_VERSION = 3; |
40 | 41 | public static final int USERNAME_MAX = 16; |
41 | 42 | public static final int MESSAGE_RATE_LIMIT_TIME = 1; |
42 | 43 | private PintoServer server; |
@@ -247,6 +248,11 @@ private void finishLogin() { |
247 | 248 | this.userName, this.clientVersion); |
248 | 249 | } |
249 | 250 |
|
| 251 | + // Experimental features |
| 252 | + if (MainConfig.instance.enableExperimentsToUsers.contains(this.userName)) { |
| 253 | + this.sendPacket(new PacketSetOption("exp_calls", "1")); |
| 254 | + } |
| 255 | + |
250 | 256 | // Send a heart beat with the updated users count |
251 | 257 | this.server.sendHeartbeat(); |
252 | 258 | } |
@@ -553,6 +559,12 @@ public void handleCallChangeStatusPacket(PacketCallChangeStatus packet) { |
553 | 559 |
|
554 | 560 | switch (packet.callStatus) { |
555 | 561 | case CONNECTING: |
| 562 | + if (!MainConfig.instance.enableExperimentsToUsers.contains(this.userName)) { |
| 563 | + this.sendPacket(new PacketCallChangeStatus(CallStatus.ERROR, |
| 564 | + "Feature unavailable")); |
| 565 | + return; |
| 566 | + } |
| 567 | + |
556 | 568 | if (!packet.details.contains("@")) { |
557 | 569 | this.kick("Protocol violation!"); |
558 | 570 | return; |
|
0 commit comments