mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-30 13:17:11 +01:00
[feature] add List object
This commit is contained in:
11
js/app.js
11
js/app.js
@@ -14,13 +14,12 @@ function connectToTeamSpeak() {
|
||||
};
|
||||
|
||||
ws.onopen = (event) => {
|
||||
ws.send("Connected to TeamSpeak5");
|
||||
// Send payload to TS5 client
|
||||
ws.send(JSON.stringify(paylaod));
|
||||
};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
let data = JSON.parse(event.data);
|
||||
//console.log(data);
|
||||
|
||||
switch (data.type) {
|
||||
case "auth":
|
||||
@@ -39,19 +38,19 @@ function connectToTeamSpeak() {
|
||||
console.log(`No handler for event type: ${data.type}`);
|
||||
break;
|
||||
}
|
||||
|
||||
// Draw clientList in HTML object
|
||||
drawClients();
|
||||
console.log(clients);
|
||||
//console.log(channels);
|
||||
};
|
||||
|
||||
ws.onerror = (err) => {
|
||||
console.error(err);
|
||||
connectToTeamSpeak();
|
||||
connectToTeamSpeak(); // Reconnected
|
||||
};
|
||||
|
||||
ws.onclose = (event) => {
|
||||
console.log("Disconnected: " + event.reason);
|
||||
connectToTeamSpeak();
|
||||
connectToTeamSpeak(); // Reconnected
|
||||
};
|
||||
}
|
||||
connectToTeamSpeak();
|
||||
|
||||
Reference in New Issue
Block a user