internal static bool HasGroup(this ConnectionUser connectionUser, int groupId, HubGroupTypes type, HubGroupPrefix prefix) { return(connectionUser.HasGroup(CreateGroupName(groupId, type, prefix))); }
private static async Task <string> _addOrReplaceGroupAsync(this ConnectionUser connectionUser, IGroupManager groups, int groupId, string groupName, HubGroupTypes groupType, string nativeName) { await groups.AddToGroupAsync(connectionUser.ConnectionId, groupName); connectionUser.Groups[groupName] = new HubGroupItem(groupId, (byte)groupType, nativeName, groupName); return(groupName); }
internal static async Task <string> AddOrReplaceGroupAsync(this ConnectionUser connectionUser, IGroupManager grops, int groupId, HubGroupTypes groupType, string nativeName, HubGroupPrefix prefix) { var name = CreateGroupName(groupId, groupType, prefix); return(await connectionUser._addOrReplaceGroupAsync(grops, groupId, name, groupType, nativeName)); }
internal static string CreateGroupName(int groupId, HubGroupTypes type, HubGroupPrefix prefix) { var name = prefix + "_" + (byte)type + "_" + groupId; return(name.ToLower()); }