예제 #1
0
        public void JoinUser(string token)
        {
            ConnectedUser user = GetSubscriber(token);

            if (user == null)
            {
                logger.Error("Attempted to join user but they are not subbed");
                return;
            }

            OpParticipant np = new OpParticipant();

            np.profile  = user.profile;
            np.position = null;
            np.isFC     = user.profile.id == FCID;

            roster.Add(np);

            PushToAll(new ANWI.Messaging.Ops.UpdateRoster(
                          new List <OpParticipant>()
            {
                np
            },
                          null
                          ));
        }
예제 #2
0
        public void UnsubscribeUser(string token)
        {
            ConnectedUser user = GetSubscriber(token);

            if (user == null)
            {
                return;
            }

            // Remove them from the roster if they are joined
            RemoveUser(user.profile.id);

            subscribed.Remove(token);
        }
예제 #3
0
        public void SubscribeUser(ConnectedUser user)
        {
            subscribed.Add(user.token, user);

            // Force this user to join if they are the FC
            if (user.profile.id == FCID)
            {
                JoinUser(user.token);

                // Add some fake users for testing purposes

                /*for(int i = 4; i < 35; ++i) {
                 *      if (i == 11 || i == 12 || i == 14)
                 *              continue;
                 *
                 *      string token = ANWI.Utility.UUID.GenerateUUID();
                 *      SubscribeUser(new ConnectedUser(token, i));
                 *      JoinUser(token);
                 * }*/
            }
        }