diff --git a/4-series/epi-essentials-mobile-control/WebSocketServer/MobileControlWebsocketServer.cs b/4-series/epi-essentials-mobile-control/WebSocketServer/MobileControlWebsocketServer.cs index 4e706e3..97e14bb 100644 --- a/4-series/epi-essentials-mobile-control/WebSocketServer/MobileControlWebsocketServer.cs +++ b/4-series/epi-essentials-mobile-control/WebSocketServer/MobileControlWebsocketServer.cs @@ -354,7 +354,7 @@ private void AddConsoleCommands() CrestronConsole.AddNewConsoleCommand(GenerateClientTokenFromConsole, "MobileAddUiClient", "Adds a client and generates a token. ? for more help", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(RemoveToken, "MobileRemoveUiClient", "Removes a client. ? for more help", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand((s) => PrintClientInfo(), "MobileGetClientInfo", "Displays the current client info", ConsoleAccessLevelEnum.AccessOperator); - CrestronConsole.AddNewConsoleCommand(RemoveAllTokens, "MobileRemoveAllUiClients", "Removes all clients", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(RemoveAllTokens, "MobileRemoveAllClients", "Removes all clients", ConsoleAccessLevelEnum.AccessOperator); } @@ -802,7 +802,13 @@ private void RemoveAllTokens(string s) { if (s == "?" || string.IsNullOrEmpty(s)) { - CrestronConsole.ConsoleCommandResponse(@"Removes all clients from the server"); + CrestronConsole.ConsoleCommandResponse(@"Removes all clients from the server. To execute add 'confirm' to command"); + return; + } + + if (s != "confirm") + { + CrestronConsole.ConsoleCommandResponse(@"To remove all clients, add 'confirm' to the command"); return; } @@ -816,8 +822,6 @@ private void RemoveAllTokens(string s) var path = _wsPath + client.Key; if (_server.RemoveWebSocketService(path)) { - UiClients.Remove(client.Key); - CrestronConsole.ConsoleCommandResponse(string.Format("Client removed with token: {0}", client.Key)); } else @@ -826,6 +830,8 @@ private void RemoveAllTokens(string s) } } + UiClients.Clear(); + UpdateSecret(); }