DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
639 stars 172 forks source link

ENH: Admin defined "contraband" detection and removal #1563

Open HailStorm32 opened 4 months ago

HailStorm32 commented 4 months ago

Is your feature request related to a problem?

In short, provide a means for server admins to define what items the server should consider "contraband" and prevent non GM accounts ( GM level of 0) from using said items.

Describe the solution you'd like

Brief

A new config will be added that includes a list of item IDs. Whenever a non-GM account (level 0) logs into the game, the system will search both the character’s personal inventory and vault for these flagged items. If found, the account will be flagged, and the items will be addressed accordingly.

Config Layout

The config will be structured as a JSON file, as shown below. The name field acts primarily as a reference for users reviewing the list, rather than having a functional role within the code. This setup enables users to quickly identify what each ID represents, enhancing clarity and usability.

{
  "contrabandIds": [
    {
      "id": 14128,
      "name": "Atlantis Squid Helm"
    },
    {
      "id": 6655,
      "name": "Stig's Helmet"
    },
    {
      "id": 9947,
      "name": "Sentinel Grunt Helm"
    }
  ],
}

I prefer to avoid using the .ini format, as employed in the other configs, at it does not support inline comments. Inline comments are, imo, crucial for clarity when managing a large list of IDs.

Details

If a character is found to be in possession of one of the items, the following should happen.

  1. The account is flagged (this could be a new column in the accounts table and something ND could pickup on and display)
  2. The flagged item is either deleted, or the user prevented from using it

Expanding on point #2 It would be beneficial to include an option in the config that allows an admin to choose between automatically removing the item or simply preventing its use. Alternatively, defaulting to blocking the use of the item may be safer in cases where an item might have been erroneously listed.

Repository breaking implications

Addition of a new config and column in the database

Describe alternatives you've considered

No response

Additional context

No response