private void BanUser(string username, DateTime?duration) { AuthServerAdminClient.Ban(username, duration); IClientObject user = Manager.FindClient(username); if (user == null || user.ToString() == "") //user not found { return; } LogProvider.AppendRecord(string.Format("[{0}]: banned user {1}", user.Username, username)); user.SendMessage(ResponseConstructor.GetBannedNotification(duration)); user.Role = new BannedUser(user, duration); }
private void UnBanUser(string username) { AuthServerAdminClient.UnBan(username); IClientObject user = Manager.FindClient(username); if (user == null || user.ToString() == "") { return; } user.SendMessage(ResponseConstructor.GetUnBannedNotification(username)); LogProvider.AppendRecord(string.Format("[{0}]: unbanned user {1}", user.Username, username)); user.Role = new User(user); }