IAdminNotesManager.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Threading.Tasks;
  2. using Content.Server.Database;
  3. using Content.Shared.Administration.Notes;
  4. using Content.Shared.Database;
  5. using Robust.Shared.Player;
  6. namespace Content.Server.Administration.Notes;
  7. public interface IAdminNotesManager
  8. {
  9. event Action<SharedAdminNote>? NoteAdded;
  10. event Action<SharedAdminNote>? NoteModified;
  11. event Action<SharedAdminNote>? NoteDeleted;
  12. bool CanCreate(ICommonSession admin);
  13. bool CanDelete(ICommonSession admin);
  14. bool CanEdit(ICommonSession admin);
  15. bool CanView(ICommonSession admin);
  16. Task OpenEui(ICommonSession admin, Guid notedPlayer);
  17. Task OpenUserNotesEui(ICommonSession player);
  18. Task AddAdminRemark(ICommonSession createdBy, Guid player, NoteType type, string message, NoteSeverity? severity, bool secret, DateTime? expiryTime);
  19. Task DeleteAdminRemark(int noteId, NoteType type, ICommonSession deletedBy);
  20. Task ModifyAdminRemark(int noteId, NoteType type, ICommonSession editedBy, string message, NoteSeverity? severity, bool secret, DateTime? expiryTime);
  21. /// <summary>
  22. /// Queries the database and retrieves all notes, secret and visible
  23. /// </summary>
  24. /// <param name="player">Desired player's <see cref="Guid"/></param>
  25. /// <returns>ALL non-deleted notes, secret or not</returns>
  26. Task<List<IAdminRemarksRecord>> GetAllAdminRemarks(Guid player);
  27. /// <summary>
  28. /// Queries the database and retrieves the notes a player should see
  29. /// </summary>
  30. /// <param name="player">Desired player's <see cref="Guid"/></param>
  31. /// <returns>All player-visible notes</returns>
  32. Task<List<IAdminRemarksRecord>> GetVisibleRemarks(Guid player);
  33. /// <summary>
  34. /// Queries the database and retrieves watchlists that may have been placed on the player
  35. /// </summary>
  36. /// <param name="player">Desired player's <see cref="Guid"/></param>
  37. /// <returns>Active watchlists</returns>
  38. Task<List<AdminWatchlistRecord>> GetActiveWatchlists(Guid player);
  39. /// <summary>
  40. /// Queries the database and retrieves new messages a player has gotten
  41. /// </summary>
  42. /// <param name="player">Desired player's <see cref="Guid"/></param>
  43. /// <returns>All unread messages</returns>
  44. Task<List<AdminMessageRecord>> GetNewMessages(Guid player);
  45. /// <summary>
  46. /// Mark an admin message as being seen by the target player.
  47. /// </summary>
  48. /// <param name="id">The database ID of the admin message.</param>
  49. /// <param name="dismissedToo">
  50. /// If true, the message is "permanently dismissed" and will not be shown to the player again when they join.
  51. /// </param>
  52. Task MarkMessageAsSeen(int id, bool dismissedToo);
  53. }