Beispiel #1
0
        public Task SendCommandsToUser()
        {
            string message
                = ClientInfo.getGroup(Context.ConnectionId).Equals("")
                    ? ""
                    : CommandHolder.getEnabledCommands(ClientInfo.getGroup(Context.ConnectionId));

            return(Clients.Caller.SendAsync("CommandUpdate", message));
        }
Beispiel #2
0
 public void unregisteredNamesDNT()
 {
     Assert.DoesNotThrow(() => CommandHolder.removeClient(""));
     Assert.DoesNotThrow(() => CommandHolder.updateCommand("", "", true));
     Assert.DoesNotThrow(() => CommandHolder.updateCommand(ts, "", true));
     Assert.DoesNotThrow(() => CommandHolder.getCommandEnabled("", ""));
     Assert.DoesNotThrow(() => CommandHolder.getCommandEnabled(ts, ""));
     Assert.DoesNotThrow(() => CommandHolder.getEnabledCommands(""));
 }
Beispiel #3
0
        public Task JoinGroup(string group)
        {
            ClientInfo.setGroup(Context.ConnectionId, group);
            string message
                = ClientInfo.getGroup(Context.ConnectionId).Equals("")
                    ? ""
                    : CommandHolder.getEnabledCommands(ClientInfo.getGroup(Context.ConnectionId));

            Groups.AddToGroupAsync(Context.ConnectionId, group);
            return(Clients.Caller.SendAsync("CommandUpdate", message));
        }