Example #1
0
        public void StartBroadcast(BroadcastInfo info)
        {
            var id = ConnectionDictionary[Context.ConnectionId].Id;

            var canBroadcast =
                info != null &&
                VerifyOnOperator(id) &&
                VerifyOnPrompters(info.PrompterIdList);

            if (!canBroadcast)
            {
                Clients.Caller.cantStartBroadcast();
                return;
            }

            var groupName = id.ToString();
            var groupInfo = new GroupInfo
            {
                OperatorId     = id,
                PrompterIdList = info.PrompterIdList
            };

            Groups.Add(Context.ConnectionId, groupName);
            IdDictionary[id].Group = groupInfo;

            foreach (var prompterId in info.PrompterIdList)
            {
                var userInfo = IdDictionary[prompterId];
                Groups.Add(userInfo.Connection, groupName);
                userInfo.Group = groupInfo;
                Clients.Client(userInfo.Connection).fetchScript(info.ScriptId, id);
            }
        }
Example #2
0
        public void StartBroadcast(BroadcastInfo info)
        {
            var id = ConnectionDictionary[Context.ConnectionId].Id;

            var canBroadcast =
                info != null
                && VerifyOnOperator(id)
                && VerifyOnPrompters(info.PrompterIdList);

            if (!canBroadcast)
            {
                Clients.Caller.cantStartBroadcast();
                return;
            }

            var groupName = id.ToString();
            var groupInfo = new GroupInfo
            {
                OperatorId = id,
                PrompterIdList = info.PrompterIdList
            };

            Groups.Add(Context.ConnectionId, groupName);
            IdDictionary[id].Group = groupInfo;

            foreach (var prompterId in info.PrompterIdList)
            {
                var userInfo = IdDictionary[prompterId];
                Groups.Add(userInfo.Connection, groupName);
                userInfo.Group = groupInfo;
                Clients.Client(userInfo.Connection).fetchScript(info.ScriptId, id);
            }
        }