mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
Add TS6 clientinit version middleware and fix playNext retry bug
clientinit compatibility: - Analyzed @honeybbq/teamspeak-client's clientinit: it already sends a clean 14-field payload without problematic fields (no badges, integrations, security_hash, etc.) - The key difference vs NeteaseTSBot is client_version: our library sends 3.5.3, NeteaseTSBot sends 3.6.2. TS6 servers may reject older versions. - Add ts6-compat.ts with CommandMiddleware that patches clientinit to use version 3.6.2 + matching ECDSA signature when connecting to detected TS6 servers - Middleware is automatically applied when detectedProtocol === "ts6" Pre-existing bug fix: - Fix playNext() in instance.ts where successful retry still fell through to player.stop(), killing the just-started playback https://claude.ai/code/session_016WhH58avUD9xy2dgADJgTh
This commit is contained in:
4 files changed
+143
-4
No files matched your search
+8
-3
@@ -494,14 +494,19 @@ export class BotInstance extends EventEmitter {
|
||||
this.voteSkipUsers.clear();
|
||||
const next = this.queue.next();
|
||||
if (next) {
|
||||
const ok = await this.resolveAndPlay(next);
|
||||
if (!ok) {
|
||||
let started = await this.resolveAndPlay(next);
|
||||
if (!started) {
|
||||
// Skip to next if URL resolve fails (up to 3 retries)
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const retry = this.queue.next();
|
||||
if (!retry) break;
|
||||
if (await this.resolveAndPlay(retry)) break;
|
||||
if (await this.resolveAndPlay(retry)) {
|
||||
started = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!started) {
|
||||
this.player.stop();
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user