mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-30 05:07:12 +01:00
[feature] init vite project
This commit is contained in:
42
old_js/js/parser.js
Normal file
42
old_js/js/parser.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// Parse teamspeak channel structure into our objects
|
||||
function parseChannelInfos(channelInfos, connectionId) {
|
||||
let result = [];
|
||||
let rootChannels = channelInfos.rootChannels;
|
||||
let subChannels = channelInfos.subChannels;
|
||||
|
||||
rootChannels.forEach((rc) => {
|
||||
result.push(new Channel(rc.id, connectionId, rc.properties.name));
|
||||
|
||||
if (subChannels !== null && rc.id in subChannels) {
|
||||
subChannels[rc.id].forEach((sc) => {
|
||||
result.push(new Channel(sc.id, connectionId, sc.properties.name));
|
||||
});
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// Parse teamspeak clients into our objects
|
||||
function parseClientInfos(clientInfos, connectionId) {
|
||||
let result = [];
|
||||
clientInfos.forEach((e) => {
|
||||
console.log("-----------------------------------");
|
||||
console.log(e);
|
||||
console.log(connectionId);
|
||||
console.log(channelList.items);
|
||||
console.log(channelList.getByIds(e.channelId, connectionId));
|
||||
console.log("-----------------------------------");
|
||||
|
||||
result.push(
|
||||
new Client(
|
||||
e.id,
|
||||
connectionId,
|
||||
channelList.getByIds(e.channelId, connectionId),
|
||||
e.properties.nickname,
|
||||
e.properties.inputMuted,
|
||||
e.properties.outputMuted
|
||||
)
|
||||
);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user