SenorCerveza
Synchronizes sets of groups and permissions across servers

Supported Games
GameServerKingsGameServerKings

Overview

Synchronizes multiple sets of Groups and Permissions with customizable Commands across multiple Servers.

This can be used in several ways. If a SteamId gets entered in the Database or as a Command, it will automatically add or remove all the Users on all Servers using this Plugin attached to the Database. You can also work with a ServerId for each Configuration so some Commands and Permissions only get applied on a specific Server. If you specify a ServerId for a Record but there is also a global Record, the specific Record will take account and overwrites the Global one (for example a User is in "Group1" on all Servers but also has "Group2" for ServerId "server2", then on Server 2 only the "Group2" will be applied.

That means you can also fill the Database from 3rd Party Applications like Discord Bots / Websites and so on which allows a wide range of use cases.

It is written that you cannot add duplicates, invalid SteamIds and so on. Also it will create the Group if not exist, adds all the Permissions dynamically from Configuration and only process Removed / Added SteamIds to optimize performance.

Permissions

  • permissiongroupsync.admin - Allows to use the specified Command to Add and Remove SteamIds
  • permissiongroupsync.<custompermission> - Every set of GroupPermissions will have its own Permission (see below)

Server/Console Commands

  • <customcommand> <add/remove> <steamid> - Custom command can be set in the Configuration File for each set of GroupPermissions

Configuration

Default configuration:

{
  "ServerId": "yourid",
  "PollIntervalSeconds": 300,
  "DatabaseConfiguration": {
    "Host": "",
    "Port": 3306,
    "Username": "username",
    "Password": "password",
    "Database": "PermissionGroupSync"
  },
  "GroupPermissions": [
    {
      "CommandName": "yourCommand1",
      "GroupName": "PermissionGroupSync",
      "ExtendedPermissionHandling": true,
      "PermissionUse": true,
      "ProtectedGroup": false,
      "OverrideServerIdCheck": false,
      "GroupsCheckExcludedSync": [
        "admin",
        "testgroup"
      ],
      "GroupsRemove": [
        "moderator"
      ],
      "PermissionsRust": 0,
      "PermissionsOxide": [
        "plugin.permission1",
        "plugin.permission2"
      ],
      "AdditionalCommands": [
        "writefg"
      ]
    },
    {
      "CommandName": "yourCommand2",
      "GroupName": "PermissionGroupSync2",
      "ExtendedPermissionHandling": false,
      "PermissionUse": false,
      "ProtectedGroup": false,
      "OverrideServerIdCheck": false,
      "GroupsCheckExcludedSync": [
        "admin",
        "testgroup"
      ],
      "GroupsRemove": [
        "moderator"
      ],
      "PermissionsRust": 0,
      "PermissionsOxide": [
        "plugin.permission1",
        "plugin.permission2"
      ],
      "AdditionalCommands": [
        "writefg"
      ]
    }
  ]
}

Options explained:

  • ServerId - Put in a short and nonspace identifier for your Server. Groups can be assigned later to that specific ServerId
  • PollIntervalSeconds - Intervall in Seconds between the Sync jobs with the MySQL Database
  • DatabaseConfiguration - The Connection Parameters for the MySQL Database (see structure below)
    • Host - The IP or FQDN to your MySQL Server
    • Port - The TCP Port for the Connection
    • Username - Username for connecting to the Database
    • Password - Password for connecting to the Database
    • Database - The name of the Database
  • GroupPermissions - Each set of GroupPermissions has its own Command, associated Group and Permissions
    • CommandName - Set a custom Chat and Console Command
    • GroupName - The Name of the Oxide Group to sync (will be created if not exist)
    • ExtendedPermissionHandling - Set to true to use ProtectedGroup, GroupCheckExcludedSync, GroupsRemove and PermissionRust functions. If set to false, all these options and functions will be ignored.
    • PermissionUse - Set to true so every set of GroupPermissions has its own Permission which will be checked (for example if some one uses /yourCommand1 but don't have the Permission permissiongroupsync.yourCommand1 it will get blocked. Set to false to ignore this Permission
    • ProtectedGroup - Set to true to protect members of this Group of beeing removed by Groups specified in GroupsRemove below.
    • OverrideServerIdCheck - Set to true that actions for this Group always affects all Servers. Set to false to always check for the specified ServerId (can also be ALL)
    • GroupsCheckExcludedSync - Specifie Groups to check before applying the GroupPermission Settings. If a User is in one of these Groups, the Group Setting will not be applied (for example the Admin Deepcover Group)
    • GroupsRemove - Specify a List of Groups where the user needs to get removed if beeing added to this Group. Usefull for removing lower or higher tier Groups to make sure the User only is in this Group and not multiple
    • PermissionsRust - Set the native Rust Auth Level Permission which should be granted (0 = User, 1 = Moderator, 2 = Owner)
    • PermissionsOxide - List of Permissions the Group should have (will be adjusted if you change it later)
    • AdditionalCommands - Specify additional Console commands which should be executed. The placeholder {0} will be replaced with the SteamId for the specific User

MySQL Setup

  1. You need a set up and working MySQL Server with the needed credentials and Permissions to a MySQL Database.
  2. The Plugin will create its own Table structure if not already exist.
  3. The table will be named "permissiongroupsync".

Localization

{
  "ErrorConfig": "Error: Could not read config values or invalid / empty options specified.",
  "ErrorDatabaseConnect": "Error: Could not connect to Database {0}. Check Connection and Service.",
  "ErrorDatabase": "Error: Could not read or write from Database {0}: {1}",
  "ErrorCommand": "Error: Could not modify Group Permissions for Player {0}.",
  "ConnectedDatabase": "Connected to Database {0}.",
  "NoPermissions": "You don't have Permissions to use this Command.",
  "InvalidSyntax": "Invalid Syntax. Use /{0} <add or remove> <steamId> <optional:serverId>.",
  "InvalidSteamId": "No valid SteamId provided.",
  "GroupAdded": "Added {0} to Group {1} for ServerId: {2}",
  "GroupRemoved": "Removed {0} from Group {1}  for ServerId: {2}",
  "NoAction": "No action needed because {0} is already in Group or removed.",
  "PermissionChanged": "Your ingame Permissions have changed. Please relog so they can apply.",
  "NoLongerInDB": "Removing {0} from {1} because no longer in Database.",
  "NotRemovedProtected": "Could not remove {0} from Group {1} because Group is protected.",
  "NotAddedGroup": "Permissions could not be added to Group. Retrying.",
  "PermissionChangedLog": "Changed AuthLevel for User {0} to {1}."
}

Credits

Trying to give something back to the Umod community due to the great work happening here. All Support and Maintenance is best effort.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.