Ejemplo n.º 1
0
        protected virtual void OnRoomUserUpdate(RoomUserUpdateEventArgs args)
        {
            var func = RoomUserUpdate;

            if (func != null)
            {
                func(this, args);
            }
        }
Ejemplo n.º 2
0
 protected virtual void OnRoomUserUpdate(RoomUserUpdateEventArgs args)
 {
     var func = RoomUserUpdate;
     if (func != null)
     {
         func(this, args);
     }
 }
Ejemplo n.º 3
0
        void EngineRoomUserUpdate(object sender, RoomUserUpdateEventArgs e)
        {
            var roomUserUpdateEvent = e.Event;

            var user = UserManager.FindByName(roomUserUpdateEvent.UserName);
            var room = RoomManager.FindById(roomUserUpdateEvent.RoomId);
            if (user == null)
            {
                user = new ClientUser { UserName = roomUserUpdateEvent.UserName };
                //foreach (UserVariable current in roomUserUpdateEvent.UserVariables)
                //{
                //    user.AddUserVariable(current);
                //}
            }

            switch (roomUserUpdateEvent.Action)
            {
                case RoomUserUpdateAction.AddUser:
                        user = UserManager.AddUser(user);
                        room.AddUser(user);
                        break;
                case RoomUserUpdateAction.DeleteUser:
                        UserManager.RemoveUser(user.UserName);
                        room.RemoveUser(user);
                        break;
            }
        }