Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Add moderations logs #656

Closed
verdie-g opened this issue Dec 27, 2022 · 1 comment
Closed

Add moderations logs #656

verdie-g opened this issue Dec 27, 2022 · 1 comment
Labels
area/web-api Web API related enhancement New feature or request

Comments

@verdie-g
Copy link
Owner

verdie-g commented Dec 27, 2022

class ModerationLog
{
    public int Id { get; set; }
    public ModerationLogType Type { get; set; }
    public int UserId { get; set; } // Not sure, maybe nullable?
    public Dictionary<string, string> Metadatas { get; set; }
    public DateTime CreatedAt { get; set; }
}

enum ModerationLogType
{
    ChatMessage,
    TeamHit,
    UserJoin,
    UserLeft,
    UserServerJoin,
    UserRenamed,
    ItemBought,
    ItemSold,
    CharacterRespecialization,
    CharacterRetirement,
    CharacterDeletion,
   // ...
}

A log would look like this

{
  "id": 25233,
  "type": "TeamHit",
  "userId": 11788,
  "metadatas": {
    "targetUserId": "12333",
    "damage": 22,
    "killed": false,
    "gameServerInstance": "crpg01-battle"
  }
}

Then from a log type and the metadatas the web UI would have the logic to create a string such as

User 11788 team hit user 12333 for 22 damage on server crpg01-battle
@verdie-g verdie-g added enhancement New feature or request area/web-api Web API related labels Dec 27, 2022
@verdie-g
Copy link
Owner Author

I'd like to use a JSON column for the metadata but it's not supported yet dotnet/efcore#28688.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/web-api Web API related enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant