예제 #1
0
 public UserNotification_SetGroupSystemOperation_ChangeProperty(ProjectReferrencer targetRefer, ElementInfo ei, string propertyName, object value)
     : base(targetRefer.UserIDs)
 {
     GUID         = ei.GUID;
     PropertyName = propertyName;
     Value        = value;
 }
예제 #2
0
 public UserNotification_SetGroupSystemOperation_SetWaterbag(ProjectReferrencer targetRefer, ElementInfo_Waterbag ei)
     : base(targetRefer.UserIDs)
 {
     GUID  = ei.GUID;
     Width = ei.BagWidth;
     Vecs  = ei.JointVecs;
 }
예제 #3
0
 public UserNotification_SetGroupSystemOperation_Modify(ProjectReferrencer targetRefer, ElementInfo ei)
     : base(targetRefer.UserIDs)
 {
     GUID      = ei.GUID;
     TransInfo = ei.BaseTrans;
     Scale     = ei.ManualScaleOnSrcBackImage;
 }
예제 #4
0
        public void RequestMonitorGroupOrUser(long targetId, bool isGroup)
        {
            var user = Program.UserMgr.GetLoginUserInfo(OperationContext.Current);

            if (user != null)
            {
                try
                {
                    ProjectReferrencer prTarget = null;
                    if (!user.LoginInfo.AdjudicatorMode)
                    {
                        user.Feedback.ReplyMonitorTargetGroupOrUser(targetId, isGroup, false);
                    }
                    else if (isGroup)
                    {
                        var grp = Program.UserMgr.GetTaskGroup((int)targetId);
                        if (grp == null || !grp.IsCooperation)
                        {
                            user.Feedback.ReplyMonitorTargetGroupOrUser(targetId, isGroup, false);
                        }
                        else
                        {
                            Program.UserMgr.RemoveMonitorUserFromAllReferrencers(user.AccountID);
                            user.LoginInfo.TargetMonitorUserOrGroupID = grp.GroupID * -1;
                            grp.BeMonitoringUsers[user.AccountID]     = user.LoginInfo;
                            user.Feedback.ReplyMonitorTargetGroupOrUser(targetId, true, true);
                            prTarget = grp;
                        }
                    }
                    else
                    {
                        var target = Program.UserMgr.GetLoginUserInfo(targetId);
                        if (target == null || target.LoginInfo.ParentGroup.IsCooperation)
                        {
                            user.Feedback.ReplyMonitorTargetGroupOrUser(targetId, false, false);
                        }
                        else
                        {
                            Program.UserMgr.RemoveMonitorUserFromAllReferrencers(user.AccountID);
                            user.LoginInfo.TargetMonitorUserOrGroupID          = targetId;
                            target.LoginInfo.BeMonitoringUsers[user.AccountID] = user.LoginInfo;
                            user.Feedback.ReplyMonitorTargetGroupOrUser(targetId, false, true);
                            prTarget = target.LoginInfo;
                        }
                    }
                    if (prTarget != null)
                    {
                        user.LoginInfo.ProjectInstanceDirectly = prTarget.ProjectInstance;
                        user.LoginInfo.ViewportIndex           = prTarget.ViewportIndex;
                        Program.UserMgr.PushNotification(new UserNotification_SetTrainingProject(user.AccountID, false, user.LoginInfo.ProjectName));
                        Program.UserMgr.PushNotification(new UserNotification_SetTrainingMission(user.LoginInfo));
                        user.CheckStartMission();
                    }
                }
                catch
                {
                }
            }
        }
예제 #5
0
        public void Replay(ProjectReferrencer pr, bool bReplay)
        {
            var vi = pr.SpecificViewportInfo;

            vi.IsPlaying = bReplay;
            vi.RemoveAllUnlockElements();
            vi.CurTimeTick    = 0;
            m_fLastReplayTick = -1;
        }
예제 #6
0
 public void MonitorGroupUsers(ProjectReferrencer pr)
 {
     if (pr == null)
     {
         return;
     }
     if (!pr.IsStarted)// || !group.IsCooperation)
     {
         foreach (var id in pr.UserIDs)
         {
             var suser = Program.UserMgr.GetLoginUserInfo(id);
             if (suser != null && suser.Status >= LoginStatus.在线 && suser.Feedback != null)
             {
                 suser.Feedback.TerminateMonitor();
             }
         }
     }
     else
     {
         Dictionary <long, ServerLoginUserInfo> newUsers = new Dictionary <long, ServerLoginUserInfo>();
         foreach (var id in pr.UserIDs)
         {
             var suser = Program.UserMgr.GetLoginUserInfo(id);
             if (suser.Status >= LoginStatus.在线)
             {
                 newUsers[suser.AccountID] = suser;
             }
         }
         List <long> ids = new List <long>();
         foreach (var u in ServerMonitoringUsers.Values)
         {
             if ((u.LoginInfo == null || u.LoginInfo == pr || u.LoginInfo.ParentGroup == pr) && !newUsers.ContainsKey(u.AccountID))
             {
                 if (ProjectDoc.Instance.SelectedViewportInfo != null)
                 {
                     ProjectDoc.Instance.SelectedViewportInfo.RemoveAllCreatorElements(u.AccountID);
                 }
                 u.Feedback.TerminateMonitor();
                 ids.Add(u.AccountID);
             }
         }
         foreach (var suser in newUsers.Values)
         {
             if (!ServerMonitoringUsers.ContainsKey(suser.AccountID))
             {
                 ServerMonitoringUsers[suser.AccountID] = suser;
                 suser.Feedback.StartMonitor();
             }
         }
         foreach (long id in ids)
         {
             ServerMonitoringUsers.Remove(id);
         }
     }
 }
 public void CancelRequest(ProjectReferrencer pr)
 {
     lock (WaitingUsers)
     {
         pr.IsResSynchronizing = false;
         foreach (var id in pr.UserIDs)
         {
             var suser = Program.UserMgr.GetLoginUserInfo(id);
             WaitingUsers.Remove(suser);
         }
     }
 }
예제 #8
0
 public UserNotification_SetCurViewportTime(ProjectReferrencer pr)
     : base(null)
 {
     ProjRefer = pr;
     if (pr is LoginUserInfo)
     {
         UserIDs = new long[] { ((LoginUserInfo)pr).AccountID }
     }
     ;
     else if (pr is UserTaskGroup)
     {
         UserIDs = ((UserTaskGroup)pr).Users.Keys.ToArray();
     }
 }
        public bool PushRequest(ProjectReferrencer pr)
        {
            bool succeeded = false;

            lock (WaitingUsers)
            {
                foreach (var id in pr.UserIDs)
                {
                    var suser = Program.UserMgr.GetLoginUserInfo(id);
                    if (suser.LoginInfo.MissingResourceFiles.Length > 0)
                    {
                        WaitingUsers.Add(suser);
                        succeeded = true;
                    }
                }
                pr.IsResSynchronizing = true;
            }
            return(succeeded);
        }
예제 #10
0
 public UserNotification_SetGroupSystemOperation_SetMask(ProjectReferrencer targetRefer, ElementInfo_Mask ei)
     : base(targetRefer.UserIDs)
 {
     GUID = ei.GUID;
     Vecs = ei.CornerVectors;
 }
예제 #11
0
 public UserNotification_SetGroupSystemOperation_Drive(ProjectReferrencer targetRefer, ElementInfo ei, int x, int y)
     : base(targetRefer.UserIDs)
 {
     GUID = ei.GUID;
     X    = x; Y = y;
 }
예제 #12
0
 public UserNotification_SetGroupSystemOperation_Flip(ProjectReferrencer targetRefer, ElementInfo ei)
     : base(targetRefer.UserIDs)
 {
     GUID  = ei.GUID;
     State = ei.CurFlippingState;
 }
예제 #13
0
 public UserNotification_SetGroupSystemOperation_Drift(ProjectReferrencer targetRefer, ElementInfo ei)
     : base(targetRefer.UserIDs)
 {
     GUID  = ei.GUID;
     Depth = ei.DepthLevel;
 }
예제 #14
0
 public UserNotification_PauseMission(ProjectReferrencer pr, bool paused)
     : base(null)
 {
     UserIDs  = pr.UserIDs;
     IsPaused = paused;
 }
예제 #15
0
 public UserNotification_SetGroupSystemOperation_Delete(ProjectReferrencer targetRefer, Guid guid)
     : base(targetRefer.UserIDs)
 {
     GUID = guid;
 }
예제 #16
0
 public ProjectReferrencerReq(ProjectReferrencer user, RequestType type)
 {
     User    = user;
     ReqType = type;
 }
예제 #17
0
 public UserNotification_StartOrStopTaskGroupMission(ProjectReferrencer pr, bool start)
     : base(pr)
 {
     IsStarting = start;
 }
예제 #18
0
 public UserNotification_DrawRemarkRibbon(ProjectReferrencer pr, float xr, float yr)
     : base(null)
 {
     UserIDs  = pr.UserIDs;
     Location = new PointF(xr, yr);
 }
예제 #19
0
 public UserNotification_CommitRemarkRibbon(ProjectReferrencer pr, float lifeTime)
     : base(null)
 {
     UserIDs  = pr.UserIDs;
     LifeTime = lifeTime;
 }
예제 #20
0
 public UserNotification_SetTrainingMission(ProjectReferrencer pr)
     : base(null)
 {
     ProjRefer = pr;
     UserIDs   = ProjRefer.UserIDs;
 }
예제 #21
0
        private void OperattionHistory_NewOperationPushed(Operation opt)
        {
            var           eo   = opt as Operation_Element;
            var           pr   = CurFocusTreeNodeProjReferrencer;
            UserTaskGroup grp  = SelectedTaskGroup;
            LoginUserInfo user = SelectedUserInfo;

            if (grp == null && user != null)
            {
                grp = user.ParentGroup;
            }
            ServerLoginUserInfo suser = null;

            if (user != null)
            {
                suser = user.LocalObj as ServerLoginUserInfo;
            }
            ProjectReferrencer prTarget = pr;

            if (grp.IsCooperation)
            {
                prTarget = grp;
            }
            else if (suser == null)
            {
                return;
            }
            if (opt is Operation_Element)
            {
                var eop = opt as Operation_Element;
                if (!eop.DonotMakeUserDirty)
                {
                    eop.Element.CreatorId = LoginUserInfo.SystemUserID;
                }
                if (prTarget != null && prTarget.IsStarted)
                {
                    if (eop is Operation_Element_Create)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Create(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_Delete)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Delete(prTarget, eop.Element.GUID));
                    }
                    else if (opt is Operation_Element_Drift)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Drift(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_Flip)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Flip(prTarget, eop.Element));
                    }
                    else if (opt is Operation_Element_ChangeProperty)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_ChangeProperty(prTarget, eop.Element,
                                                                                                                     ((Operation_Element_ChangeProperty)opt).PropertyName,
                                                                                                                     ((Operation_Element_ChangeProperty)opt).ValueNew));
                    }
                    else if (opt is Operation_Element_ChangeMaskInfo)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_SetMask(prTarget, eop.Element as ElementInfo_Mask));
                    }
                    else if (opt is Operation_Element_ChangeWaterbagInfo)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_SetWaterbag(prTarget, eop.Element as ElementInfo_Waterbag));
                    }
                    else if (opt is Operation_Element_SetHotkeyAnimation)
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_HotkeyAnimation(prTarget, eop.Element));
                    }
                    //else if (opt is Operation_Element_ChangeLocation)
                    //    Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Drive(prTarget, eop.Element,
                    //        ((Operation_Element_ChangeLocation)opt).LocationNew.X,
                    //        ((Operation_Element_ChangeLocation)opt).LocationNew.Y));
                    else
                    {
                        Program.UserMgr.PushNotification(new UserNotification_SetGroupSystemOperation_Modify(prTarget, eop.Element));
                    }
                }
            }
        }
예제 #22
0
 public UserNotification_SetGroupSystemOperation_HotkeyAnimation(ProjectReferrencer targetRefer, ElementInfo ei)
     : base(targetRefer.UserIDs)
 {
     GUID = ei.GUID;
     Time = ei.HotKeyAnimBeginTime;
 }
예제 #23
0
 public UserNotification_SetGroupSystemOperation_Create(ProjectReferrencer targetRefer, ElementInfo ei)
     : base(targetRefer.UserIDs)
 {
     CreateInfo = new ElementCreateInfo(ei);
 }
예제 #24
0
 public UserNotification_SetFreeTaskPermission(ProjectReferrencer pr)
     : base(pr.UserIDs)
 {
     Permission = pr.FreeTaskPerm;
 }
예제 #25
0
 public UserNotification_StartMission(ProjectReferrencer pr, bool start)
     : base(null)
 {
     UserIDs = pr.UserIDs;
     IsStart = start;
 }