mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
TS2: registered login and Auto fallback
- Connector: --login-name/--login-password (TS_LOGIN_NAME/TS_LOGIN_PASSWORD) send a registered login (flag 2 + account name + password). - Server type "auto" retries as TeamSpeak 2 when the TS3 handshake gets no answer, only with ENABLE_TS2=1. Default port 9987 is swapped for 8767. - Gateway and connect dialog pass account name/password for TS2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
83877aaa76
commit
bfe05a8b02
12 files changed
+107
-10
No files matched your search
@@ -774,6 +774,8 @@ wss.on("connection", (socket: WebSocket, req: IncomingMessage) => {
|
||||
identity: msg.identity,
|
||||
serverType: parseServerType(msg.serverType),
|
||||
privilegeKey: parsePrivilegeKey(msg),
|
||||
loginName: typeof msg.loginName === "string" ? msg.loginName.trim() || undefined : undefined,
|
||||
loginPassword: typeof msg.loginPassword === "string" ? msg.loginPassword || undefined : undefined,
|
||||
};
|
||||
connection = new Ts3Connection(options);
|
||||
liveConnections.add(connection);
|
||||
|
||||
@@ -228,6 +228,9 @@ export interface Ts3ConnectOptions {
|
||||
serverType?: ServerType;
|
||||
/** One-time privilege key / token to redeem on connect. */
|
||||
privilegeKey?: string;
|
||||
/** TeamSpeak 2 registered account (anonymous when omitted). */
|
||||
loginName?: string;
|
||||
loginPassword?: string;
|
||||
}
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
@@ -280,6 +283,8 @@ export class Ts3Connection {
|
||||
if (this.options.channelPassword) env.TS_CHANNEL_PASSWORD = this.options.channelPassword;
|
||||
if (this.options.identity) env.TS_IDENTITY = this.options.identity;
|
||||
if (this.options.privilegeKey) env.TS_PRIVILEGE_KEY = this.options.privilegeKey;
|
||||
if (this.options.loginName) env.TS_LOGIN_NAME = this.options.loginName;
|
||||
if (this.options.loginPassword) env.TS_LOGIN_PASSWORD = this.options.loginPassword;
|
||||
this.child = spawn(CONNECTOR_BIN, args, { env });
|
||||
|
||||
// The connector can exit on its own (e.g. the TS3 server drops it) and close
|
||||
|
||||
Reference in new issue
Block a user