Keep the virtual server properties from initserver

initserver announces the whole virtual server (its name above all), but only
the client and server ids were taken from it and the rest was dropped. The
name is not obtainable elsewhere: servergetvariables answers without it, and
notifyserveredited only fires when someone edits the server.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 14:15:26 +00:00
co-authored by Claude Opus 5
parent dce4e68150
commit 0e5724b877
@@ -56,6 +56,9 @@ public class LocalTeamspeakClientSocket
private Integer serverId = null;
/** The virtual server's properties as announced by <b>initserver</b>. */
private volatile Map<String, String> serverProperties = Collections.emptyMap();
/**
* The internal command buffer
* <p>
@@ -302,6 +305,7 @@ public class LocalTeamspeakClientSocket
}
serverId = null;
serverProperties = Collections.emptyMap();
remote = null;
}
@@ -375,6 +379,7 @@ public class LocalTeamspeakClientSocket
// Free stuff
serverId = null;
serverProperties = Collections.emptyMap();
synchronized (commandSendLock) {
@@ -780,12 +785,24 @@ public class LocalTeamspeakClientSocket
LocalTeamspeakClientSocket.super.setNickname(singleCommand.get("acn").getValue());
serverId = Integer.parseInt(singleCommand.get("virtualserver_id").getValue());
serverProperties = Collections.unmodifiableMap(singleCommand.toMap());
} catch (Exception e) {
throw new CommandProcessException(e);
}
}
}
/** The virtual server's properties from <b>initserver</b>; empty while disconnected. */
public Map<String, String> getServerProperties() {
return serverProperties;
}
/** The virtual server's name, or null if it was not announced. */
public String getServerName() {
return serverProperties.get("virtualserver_name");
}
@Override
public void setNickname(String nickname) {
switch (getState()) {