示例#1
0
 internal static bool HasGroup(this ConnectionUser connectionUser, int groupId, HubGroupTypes type,
                               HubGroupPrefix prefix)
 {
     return(connectionUser.HasGroup(CreateGroupName(groupId, type, prefix)));
 }
示例#2
0
        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);
        }
示例#3
0
        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));
        }
示例#4
0
        internal static string CreateGroupName(int groupId, HubGroupTypes type, HubGroupPrefix prefix)
        {
            var name = prefix + "_" + (byte)type + "_" + groupId;

            return(name.ToLower());
        }