Commit Graph
100 Commits
Author SHA1 Message Date
Manevolent d97b95f021 When the COMPRESSED flag is set by the official Teamspeak Gbmh client on a VOICE or VOICE_WHISPER packet, which is done for the first 5 packets of any decoder session, the packet is always 1 byte longer. More importantly, the final byte is static for those 5 packets.
You have to trim that last byte off, otherwise your audio will be corrupted.  TS3J now does this automatically and stores it in ServerFlag0 for you, as a nullable Byte object. This way you can handle it if you need to. This has also been factored into the output/write stage.

Digging into theory, I believe this ID has something to do with the opening of a new decoder to ensure that the decoder opens cleanly each time. You do NOT have to do anything to your decoder to reset states, etc., from what I can tell. In other words, COMPRESSED being on shouldn't change the behavior of your decoding.
2018-10-13 16:03:51 -04:00
Manevolent d9ce7f21a3 JitPack is broken. Trying one more time to get this to go through. 2018-10-13 02:17:13 -04:00
Manevolent 2f7bf10322 Merge remote-tracking branch 'origin/master' 2018-10-13 01:35:14 -04:00
Manevolent ce77f91c6f I'm changing whisper and voice handlers. I think that the COMPRESSED flag is important, it may signal you to reset your decoder for each incoming packet. Not sure. 2018-10-13 01:35:09 -04:00
Manevolent a85904555e Synchronize the remote counter, and correct an issue with rest() concerning generation IDs 2018-10-02 08:58:29 -04:00
Manevolent 6bf85e3c6c Re-order handleError (handleComplete) 2018-09-20 02:13:05 -04:00
Manevolent 5ee74e6c45 Make step 127 public 2018-09-18 15:13:58 -04:00
Manevolent e4a1e69410 Packet flags for server, setters would apply to wrong object 2018-09-18 00:15:14 -04:00
Manevolent 8ba218f094 Timestamp was not sent right 2018-09-17 23:54:54 -04:00
Manevolent 66bc483490 Init1 changes to make it neater 2018-09-17 23:41:28 -04:00
Manevolent 127ae9bc8f Don't mind me... 2018-09-17 23:01:25 -04:00
Manevolent ec34b59ad3 DatagramPackets are synchronized. This could have caused problems, or would, cause problems. 2018-09-17 22:55:34 -04:00
Manevolent e683ad1bbb Added helper methods to connect()
Refactored packet handlers
2018-09-17 21:43:36 -04:00
Manevolent 4c539e44c7 Proper extension 2018-09-17 19:51:33 -04:00
Manevolent e48a5a0435 Handle notifypermissionlist, Init127 2018-09-17 15:24:30 -04:00
Manevolent 8d74195d42 Support clientinitivexpand and not just expand2 for all TS3 server support (incl. TeaSpeak) 2018-09-17 13:24:09 -04:00
Manevolent d271b7a358 Set transformation before connecting 2018-09-11 08:35:17 -04:00
Manevolent 956344f1c9 Better logging for decryption errors 2018-09-11 08:21:16 -04:00
Manevolent 8e87f8c2c1 Merge remote-tracking branch 'origin/master' 2018-09-06 11:53:55 -04:00
Manevolent 285d6ab9a4 Add setEventMultiThreading(boolean) instead of forcing multi-threading on 2018-09-06 11:53:44 -04:00
Manevolent 15f7485fa9 Moving command execution to a single thread executor. I leave it up to end-users now if they want event processing to be multi-threaded. 2018-09-06 11:49:51 -04:00
Manevolent 1dbca2543b Remove -> Deleted 2018-08-31 21:55:55 -04:00
Manevolent 882812ff40 Merge remote-tracking branch 'origin/master' 2018-08-31 21:54:19 -04:00
Manevolent f248faad72 Add support for more missing events 2018-08-31 21:54:15 -04:00
Manevolent b7282cc337 Reconnection issues 2018-08-29 11:44:14 -04:00
Manevolent 2207e65392 Silly imports. 2018-08-23 11:41:39 -04:00
Manevolent 4c235badd5 Server group add/del 2018-08-23 11:34:27 -04:00
Manevolent 61f35951e2 Weak TSDNS support (_udp SRV record type) 2018-08-23 09:18:24 -04:00
Manevolent 09c21b171e Pull up socket role 2018-08-23 08:48:58 -04:00
Manevolent becc64f297 Java 8 2018-08-19 10:44:30 -04:00
Manevolent da3495c297 Whisper support 2018-08-17 16:27:18 -04:00
Manevolent 0cd72622a2 latestPacketId exposure for the same reason as the last commit 2018-08-16 13:44:43 -04:00
Manevolent 3898f2658c Expose the remote counter's features for discerning buffer beginning and end. I need this because my bot will be decoding audio for speech recognition. 2018-08-16 10:12:05 -04:00
Manevolent 83e59ab6e9 Exposed voice packets to the client 2018-08-15 11:43:41 -04:00
Manevolent 99ed8dda77 Use packet ID instead of key. 2018-08-13 20:30:50 -04:00
Manevolent d0e2ad194f It's possible for a packet's responsible queue to be incorrectly tracked. 2018-08-13 20:30:05 -04:00
Manevolent e4e1b5b4fe Still getting random connection losses. I think it may have to do with the way I set up ACK, ACK_LOW, and PING commands. 2018-08-13 18:18:49 -04:00
Manevolent f041820020 Catch socket exception for code clarity even though I dont think it was causing any problems 2018-08-13 09:58:55 -04:00
Manevolent ca869089cf Reconnection works now 2018-08-13 09:48:30 -04:00
Manevolent 89c483d3b9 Fragments which wrap around 65536 and cause the packet ID to ascend more than once will crash the code 2018-08-13 09:20:27 -04:00
Manevolent aad790c146 Packet reassembly would fail if the server sent packets out of order. Now, it is resilient to this. 2018-08-13 01:03:44 -04:00
Manevolent 7d195439b8 Send a zero-length byte array when the audio thread is done sending audio, as Teamspeak does. this is to prevent interpolation 2018-08-12 15:39:55 -04:00
Manevolent fb7923b63b Change HighPrecisionRecurrentTask to 0.01 instead of 0.02 2018-08-12 15:13:21 -04:00
Manevolent 9d37b982d5 Packet fragmentation had a bug 2018-08-12 15:07:49 -04:00
Manevolent 69024381de It would help if I pasted it after a packet has its ID assigned wouldn't it? 2018-08-12 12:45:27 -04:00
Manevolent 3f873f7ef5 Merge remote-tracking branch 'origin/master' 2018-08-12 12:15:37 -04:00
Manevolent 555f6a56d6 Mic packet ID was wrongly generated, changed some tests and increased verbosity of the reassembly exceptions 2018-08-12 12:14:29 -04:00
Manevolent bc37491328 Created a new test for fragments. If a packet fragment is received which wraps around the generation, it is lost. Also, packet fragmentation outgoing would cause a desync in the packet IDs. 2018-08-11 18:44:44 -04:00
Manevolent 04299b5c77 More tests for packet generations. Compression test also exists now to test compression into the future. QuickLZ first checks the level on decompression, and also throws a diagnostic error with full Base64 byte array on issue. Disconnections will actually fully reset and free the client for valid re-use. There is now a Consumer for Throwables for the abstract client socket for error handling. 2018-08-11 15:50:22 -04:00
Manevolent 5a440c890f Round ping to nearest whole number 2018-08-11 12:36:37 -04:00
Manevolent 2666e940e8 Undo debugging stuff 2018-08-10 23:38:07 -04:00
Manevolent 7f6f6c79d2 Bitmasks were wrong 2018-08-10 23:37:45 -04:00
Manevolent 798f84689f get rid of JavaFX 2018-08-10 22:46:03 -04:00
Manevolent a6a263cae1 get rid of JavaFX 2018-08-10 22:42:44 -04:00
Manevolent de6b4b370b Trying maven compiler target 2018-08-10 22:35:58 -04:00
Manevolent 2d21b701c5 Jitpack failed... 2018-08-10 22:28:39 -04:00
Manevolent 7aa0f864a0 Handle throwable 2018-08-10 22:20:27 -04:00
Manevolent 83b2f5c46f Network reader should close if it has to exit 2018-08-10 22:20:03 -04:00
Manevolent 2f7b5a376b Facepalm, nanoTime 2018-08-10 19:56:53 -04:00
Manevolent d3a157672b More accurate ping and handling all packet types properly 2018-08-10 19:27:46 -04:00
Manevolent 844e3e6e75 More accurate ping and handling all packet types properly 2018-08-10 19:01:06 -04:00
Manevolent 4072b19f09 Fix total 2018-08-10 16:30:58 -04:00
Manevolent 99961d84aa notifyconnectioninforequest 2018-08-10 16:28:55 -04:00
Manevolent 3d09c5ef21 Disconnected and leave events were not on the proper handlers 2018-08-05 19:47:35 -04:00
Manevolent a316b76d70 Channel subscription, getting channel info, and multithreaded event handling 2018-08-05 19:20:02 -04:00
Manevolent fffd19cf9b Microphone changes 2018-08-05 02:21:33 -04:00
Manevolent 582daddf67 Microphone changes 2018-08-05 01:57:12 -04:00
Manevolent 68dcaa35c3 Microphone changes 2018-08-05 01:24:10 -04:00
Manevolent 836a952a6d Need actual byte length for characters 2018-08-05 00:58:21 -04:00
Manevolent e7beee972d Nickname changing 2018-08-05 00:17:02 -04:00
Manevolent 44edb80431 Nickname changing 2018-08-05 00:02:16 -04:00
Manevolent 0c2f4c0341 Must get client ID properly there 2018-08-04 23:58:34 -04:00
Manevolent 07ca284851 Client info call 2018-08-04 23:10:14 -04:00
Manevolent 95adfc6e3d Ignore compressed packets for voice, there is an issue 2018-08-04 23:01:03 -04:00
Manevolent 8f9cc3cdd8 Merge remote-tracking branch 'origin/master' 2018-08-04 22:39:03 -04:00
Manevolent a535724a4b Ignore compressed packets for voice, there is an issue 2018-08-04 22:38:44 -04:00
Manevolent 80a57784ef Any kind of proper acknowledgement constitutes an alive connection for 30 seconds. 2018-08-04 20:08:41 -04:00
Manevolent 7239f3f7ef Needed virtual server id 2018-08-04 19:31:51 -04:00
Manevolent 1ed4e0c4da Channel list event is back, adding chat to client commands. 2018-08-04 19:22:08 -04:00
Manevolent 1236221f6b Commands now spool sequentially. Command ACK queues no longer collide with pings or ack_low. Getter more stable. 2018-08-02 19:52:44 -04:00
Manevolent 964936abdf Working on commands, having trouble with acks right now 2018-08-01 16:29:31 -04:00
Manevolent 401f00c83d Added events that were needed 2018-08-01 12:46:14 -04:00
Manevolent f50ada0888 Working quickly to finish packet generation following. I've implemented my own counter now, using the same window system as the previous Java rewrite, using just an integer array and one array copy call. Hopefully this is good for performance.
Also, there was a breaking issue with the computeParameters() call that the test did not account for.  Once you reached packet ID 128, the encryption keys were all off.  This was due to the packet ID byte shifting: it worked for the first 127 bytes.  We can thank Java's lack of unsigned primitives, and a little bit of my own ignorance for that issue.

At this point, I believe all we need now are the clientQuery commands.  Several events must be added, and the responding commands must be typed out as well.  More to come.  Home stretch.
2018-08-01 12:27:09 -04:00
Manevolent 1bdffc8634 Update test 2018-07-31 16:30:22 -04:00
Manevolent f794c23391 Merge remote-tracking branch 'origin/master' 2018-07-31 16:19:17 -04:00
Manevolent 7b457c97c2 Possibly at the point where we can send audio into a channel now. 2018-07-31 16:19:05 -04:00
Manevolent 44a18ad7a0 Beginning to work on audio stuff now. Lots of changes. 2018-07-31 15:39:03 -04:00
Manevolent e93b0dee6f Moving more towards a serverquery look. 2018-07-30 16:32:50 -04:00
Manevolent f533e2e918 Moving further along with the connection-level commands that are received, and now have model objects to store variables. No callbacks to the server yet, but that will happen soon. Right now I have channel listings and basic client information done. 2018-07-28 22:34:18 -04:00
Manevolent f124583fa6 Merge remote-tracking branch 'origin/master' 2018-07-28 13:32:29 -04:00
Manevolent c121202735 We can now connect to servers, get the welcome message, handle pings, properly decompress fragments, etc. I have also added CommandLow/AckLow support. We need to implement data objects now to recognize command objects, and then implement the voice protocol. 2018-07-28 13:32:01 -04:00
Manevolent ab4cb12010 Command processing started 2018-07-27 16:30:49 -04:00
Manevolent e4bb886d64 Set state to connected. We may want an interim state for this step of the protocol. 2018-07-27 16:12:06 -04:00
Manevolent 6007b24b5f Client authentication is done. It will now put an API client in a server, however we clearly need to work on decompression, and we also need to accept and handle ping packets appropriately.
Then we can start working on the text-based protocol Teamspeak uses.
2018-07-27 16:07:29 -04:00
Manevolent 146f2b6564 Clientinit is finally being accepted
[DEBUG] error id=525 msg=client\sis\smodified
2018-07-27 13:27:40 -04:00
Manevolent 7c1d0dfa4e Add QuickLZ for compression/decompression, this should finish up the protocol I/O unless I have made mistakes 2018-07-27 09:54:52 -04:00
Manevolent 2c9a6505c0 More tests; I identified two issues. First, the temp key generation was wrong and the clientek would have been wrong. Second, the clientek packet ID is incorrect. It needs to start at 1. 2018-07-27 09:54:01 -04:00
Manevolent 5cdedba51c Still not getting the last packet to work. 2018-07-26 22:07:05 -04:00
Manevolent a0009693e2 License hash is failing. Need to fix that 2018-07-26 00:02:36 -04:00
Manevolent 1043a4112c Getting there. 2018-07-25 23:04:45 -04:00