mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-30 13:17:11 +01:00
using spaces instead of tabs now & added prettier config
This commit is contained in:
@@ -1,80 +1,80 @@
|
||||
function handleAuthMessage(data) {
|
||||
channelList.setItems(
|
||||
parseChannelInfos(data.payload.connections[0].channelInfos)
|
||||
);
|
||||
clientList.setItems(
|
||||
parseClientInfos(data.payload.connections[0].clientInfos)
|
||||
);
|
||||
thisClient = clientList.getById(data.payload.connections[0].clientId);
|
||||
channelList.setItems(
|
||||
parseChannelInfos(data.payload.connections[0].channelInfos)
|
||||
);
|
||||
clientList.setItems(
|
||||
parseClientInfos(data.payload.connections[0].clientInfos)
|
||||
);
|
||||
thisClient = clientList.getById(data.payload.connections[0].clientId);
|
||||
}
|
||||
|
||||
function handleClientMoved(data) {
|
||||
const client = clientList.getById(data.payload.clientId);
|
||||
const client = clientList.getById(data.payload.clientId);
|
||||
|
||||
if (data.payload.newChannelId == 0) {
|
||||
// User disconnected
|
||||
if (client) {
|
||||
console.log(`${client.name} disconnected`);
|
||||
clientList.remove(client);
|
||||
}
|
||||
if (data.payload.clientId == thisClient.id) {
|
||||
console.log("You disconnected");
|
||||
clientList.clear();
|
||||
}
|
||||
} else {
|
||||
// User moved channel
|
||||
if (client) {
|
||||
// Client already exists in list
|
||||
clientList.getById(data.payload.clientId).channel = channelList.getById(
|
||||
data.payload.newChannelId
|
||||
);
|
||||
} else {
|
||||
// New Client has to be created
|
||||
clientList.add(
|
||||
new Client(
|
||||
data.payload.clientId,
|
||||
channelList.getById(data.payload.newChannelId),
|
||||
data.payload.properties.nickname
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (data.payload.newChannelId == 0) {
|
||||
// User disconnected
|
||||
if (client) {
|
||||
console.log(`${client.name} disconnected`);
|
||||
clientList.remove(client);
|
||||
}
|
||||
if (data.payload.clientId == thisClient.id) {
|
||||
console.log("You disconnected");
|
||||
clientList.clear();
|
||||
}
|
||||
} else {
|
||||
// User moved channel
|
||||
if (client) {
|
||||
// Client already exists in list
|
||||
clientList.getById(data.payload.clientId).channel = channelList.getById(
|
||||
data.payload.newChannelId
|
||||
);
|
||||
} else {
|
||||
// New Client has to be created
|
||||
clientList.add(
|
||||
new Client(
|
||||
data.payload.clientId,
|
||||
channelList.getById(data.payload.newChannelId),
|
||||
data.payload.properties.nickname
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleClientPropertiesUpdate(data) {
|
||||
let client = clientList.getById(data.payload.clientId);
|
||||
if (data.payload.properties.channelGroupInheritedChannelId == 0) {
|
||||
if (client) {
|
||||
clientList.remove(client);
|
||||
}
|
||||
} else {
|
||||
if (client) {
|
||||
client.channel = channelList.getById(
|
||||
data.payload.properties.channelGroupInheritedChannelId
|
||||
);
|
||||
let client = clientList.getById(data.payload.clientId);
|
||||
if (data.payload.properties.channelGroupInheritedChannelId == 0) {
|
||||
if (client) {
|
||||
clientList.remove(client);
|
||||
}
|
||||
} else {
|
||||
if (client) {
|
||||
client.channel = channelList.getById(
|
||||
data.payload.properties.channelGroupInheritedChannelId
|
||||
);
|
||||
|
||||
client.name = data.payload.properties.nickname;
|
||||
client.inputMuted = data.payload.properties.inputMuted;
|
||||
client.outputMuted = data.payload.properties.outputMuted;
|
||||
} else {
|
||||
clientList.add(
|
||||
new Client(
|
||||
data.payload.clientId,
|
||||
channelList.getById(
|
||||
data.payload.properties.channelGroupInheritedChannelId
|
||||
),
|
||||
data.payload.properties.nickname,
|
||||
data.payload.properies.inputMuted,
|
||||
data.payload.properies.outputMuted
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
client.name = data.payload.properties.nickname;
|
||||
client.inputMuted = data.payload.properties.inputMuted;
|
||||
client.outputMuted = data.payload.properties.outputMuted;
|
||||
} else {
|
||||
clientList.add(
|
||||
new Client(
|
||||
data.payload.clientId,
|
||||
channelList.getById(
|
||||
data.payload.properties.channelGroupInheritedChannelId
|
||||
),
|
||||
data.payload.properties.nickname,
|
||||
data.payload.properies.inputMuted,
|
||||
data.payload.properies.outputMuted
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleTalkStatusChanged(data) {
|
||||
let client = clientList.getById(data.payload.clientId);
|
||||
if (client) {
|
||||
client.talkStatus = data.payload.status;
|
||||
}
|
||||
let client = clientList.getById(data.payload.clientId);
|
||||
if (client) {
|
||||
client.talkStatus = data.payload.status;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user