Example #1
0
        public void JoinPenalty(Penalty penalty)
        {
            var user = SyncManager.Instance.User;

            // If penalty is already decided - ignore
            if (!penalty.IsUnderInvestigation)
            {
                return;
            }

            if (penalty.Users.Contains(user))
            {
                // If we are already investigating - leave
                penalty.Users.Remove(user);
            }
            else
            {
                // If we are not yet investigating - join
                penalty.JoinUser(user);

                // Sync camera
                CameraControl.ChangeCamera(penalty.Camera);
            }

            SyncManager.Instance.SendPenaltyUpdate(penalty);
            this.PenaltiesView.Refresh();
        }