예제 #1
0
 public void SetBanInfo(BanChangeType changeType, BanInfo banInfo)
 {
     if (changeType == BanChangeType.Ban)
     {
         base.BanInfo = banInfo;
     }
     else
     {
         base.BanInfo = BanInfo.Empty;
     }
 }
예제 #2
0
 void IUserServiceCallback.OnUsersBanChanged(SignatureDate signatureDate, BanInfo[] banInfos, BanChangeType changeType, string[] comments)
 {
     throw new NotImplementedException();
 }
예제 #3
0
 public static object[] Build(object[] items, BanChangeType changeType, string[] comments)
 {
     return(new object[] { changeType, comments });
 }
예제 #4
0
 public static object[] Build(object[] items, BanChangeType changeType)
 {
     return(Build(items, changeType, items.Select(item => string.Empty).ToArray()));
 }
예제 #5
0
        void IUserServiceCallback.OnUsersBanChanged(SignatureDate signatureDate, BanInfo[] banInfos, BanChangeType changeType, string[] comments)
        {
            this.InvokeAsync(() =>
            {
                var authentication = this.Authenticate(signatureDate);
                var users          = new User[banInfos.Length];
                for (var i = 0; i < banInfos.Length; i++)
                {
                    var banInfo = banInfos[i];
                    var user    = this[banInfo.Path] as User;
                    user.SetBanInfo(changeType, banInfo);
                    users[i] = user;
                }

                switch (changeType)
                {
                case BanChangeType.Ban:
                    this.Users.InvokeUsersBannedEvent(authentication, users, comments);
                    break;

                case BanChangeType.Unban:
                    this.Users.InvokeUsersUnbannedEvent(authentication, users);
                    break;
                }
            }, nameof(IUserServiceCallback.OnUsersBanChanged));
        }