Improved client updates, and showing a query client as a query
This commit is contained in:
parent
a8ffc73ab5
commit
6705d4fd74
1 changed files with 49 additions and 29 deletions
|
@ -468,29 +468,38 @@ class ClientEntry {
|
||||||
updateClientSpeakIcon() {
|
updateClientSpeakIcon() {
|
||||||
let icon: string = "";
|
let icon: string = "";
|
||||||
let clicon: string = "";
|
let clicon: string = "";
|
||||||
if(this.properties.client_away) {
|
|
||||||
icon = "client-away";
|
console.error(this.properties.client_nickname + " - " + this.properties.client_type_exact + " - " + this.properties.client_type);
|
||||||
} else if(!this.properties.client_output_hardware) {
|
if(this.properties.client_type_exact == ClientType.CLIENT_QUERY) {
|
||||||
icon = "client-hardware_output_muted";
|
icon = "client-server_query";
|
||||||
} else if(this.properties.client_output_muted) {
|
console.log("Server query!");
|
||||||
icon = "client-output_muted";
|
|
||||||
} else if(!this.properties.client_input_hardware) {
|
|
||||||
icon = "client-hardware_input_muted";
|
|
||||||
} else if(this.properties.client_input_muted) {
|
|
||||||
icon = "client-input_muted";
|
|
||||||
} else {
|
} else {
|
||||||
if(this._speaking) {
|
if(this.properties.client_away) {
|
||||||
if(this.properties.client_is_channel_commander)
|
icon = "client-away";
|
||||||
clicon = "client_cc_talk";
|
} else if(!this.properties.client_output_hardware) {
|
||||||
else
|
icon = "client-hardware_output_muted";
|
||||||
clicon = "client_talk";
|
} else if(this.properties.client_output_muted) {
|
||||||
|
icon = "client-output_muted";
|
||||||
|
} else if(!this.properties.client_input_hardware) {
|
||||||
|
icon = "client-hardware_input_muted";
|
||||||
|
} else if(this.properties.client_input_muted) {
|
||||||
|
icon = "client-input_muted";
|
||||||
} else {
|
} else {
|
||||||
if(this.properties.client_is_channel_commander)
|
if(this._speaking) {
|
||||||
clicon = "client_cc_idle";
|
if(this.properties.client_is_channel_commander)
|
||||||
else
|
clicon = "client_cc_talk";
|
||||||
clicon = "client_idle";
|
else
|
||||||
|
clicon = "client_talk";
|
||||||
|
} else {
|
||||||
|
if(this.properties.client_is_channel_commander)
|
||||||
|
clicon = "client_cc_idle";
|
||||||
|
else
|
||||||
|
clicon = "client_idle";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(clicon.length > 0)
|
if(clicon.length > 0)
|
||||||
this.tag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon);
|
this.tag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon);
|
||||||
else if(icon.length > 0)
|
else if(icon.length > 0)
|
||||||
|
@ -512,7 +521,11 @@ class ClientEntry {
|
||||||
updateVariables(...variables: {key: string, value: string}[]) {
|
updateVariables(...variables: {key: string, value: string}[]) {
|
||||||
let group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, "Update properties (%i) of %s (%i)", variables.length, this.clientNickName(), this.clientId());
|
let group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, "Update properties (%i) of %s (%i)", variables.length, this.clientNickName(), this.clientId());
|
||||||
|
|
||||||
let update_status_icon = false;
|
let update_icon_status = false;
|
||||||
|
let update_icon_speech = false;
|
||||||
|
let update_away = false;
|
||||||
|
let reorder_channel = false;
|
||||||
|
|
||||||
for(let variable of variables) {
|
for(let variable of variables) {
|
||||||
JSON.map_field_to(this._properties, variable.value, variable.key);
|
JSON.map_field_to(this._properties, variable.value, variable.key);
|
||||||
|
|
||||||
|
@ -521,14 +534,14 @@ class ClientEntry {
|
||||||
this.tag.find(".name").text(variable.value);
|
this.tag.find(".name").text(variable.value);
|
||||||
let chat = this.chat(false);
|
let chat = this.chat(false);
|
||||||
if(chat) chat.name = variable.value;
|
if(chat) chat.name = variable.value;
|
||||||
if(this._channel)
|
|
||||||
this._channel.reorderClients();
|
reorder_channel = true;
|
||||||
}
|
}
|
||||||
if(variable.key == "client_away" || variable.key == "client_output_muted" || variable.key == "client_input_hardware" || variable.key == "client_input_muted" || variable.key == "client_is_channel_commander"){
|
if(variable.key == "client_away" || variable.key == "client_output_muted" || variable.key == "client_input_hardware" || variable.key == "client_input_muted" || variable.key == "client_is_channel_commander"){
|
||||||
this.updateClientSpeakIcon();
|
update_icon_speech = true;
|
||||||
}
|
}
|
||||||
if(variable.key == "client_away_message" || variable.key == "client_away") {
|
if(variable.key == "client_away_message" || variable.key == "client_away") {
|
||||||
this.updateAwayMessage();
|
update_away = true;
|
||||||
}
|
}
|
||||||
if(variable.key == "client_unique_identifier") {
|
if(variable.key == "client_unique_identifier") {
|
||||||
this.audioController.volume = parseFloat(settings.server("volume_client_" + this.clientUid(), "1"));
|
this.audioController.volume = parseFloat(settings.server("volume_client_" + this.clientUid(), "1"));
|
||||||
|
@ -536,11 +549,8 @@ class ClientEntry {
|
||||||
console.log(this.avatarId());
|
console.log(this.avatarId());
|
||||||
}
|
}
|
||||||
if(variable.key == "client_talk_power") {
|
if(variable.key == "client_talk_power") {
|
||||||
if(this._channel) {
|
reorder_channel = true;
|
||||||
this._channel.reorderClients();
|
update_icon_status = true;
|
||||||
this.updateClientStatusIcons();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(variable.key == "client_icon_id")
|
if(variable.key == "client_icon_id")
|
||||||
this.updateClientIcon();
|
this.updateClientIcon();
|
||||||
|
@ -548,6 +558,16 @@ class ClientEntry {
|
||||||
this.updateGroupIcons();
|
this.updateGroupIcons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* process updates after variables have been set */
|
||||||
|
if(this._channel && reorder_channel)
|
||||||
|
this._channel.reorderClients();
|
||||||
|
if(update_icon_speech)
|
||||||
|
this.updateClientSpeakIcon();
|
||||||
|
if(update_icon_status)
|
||||||
|
this.updateClientStatusIcons();
|
||||||
|
if(update_away)
|
||||||
|
this.updateAwayMessage();
|
||||||
|
|
||||||
group.end();
|
group.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue