NidToolbox: Server Rules module 1.7.1

Due to human (non-bot) spam the first contribution of a user has to be reviewed and activated manually, all further contributions do not require this.
As long as a user does not have at least one reviewed and activated contribution, the user is unable to edit his profile, set a avatar, title picture or a signature.

Enables server rules enforcement. Provides the ability to restrict certain player actions, until they accept the set of server rules.

Server Rules Module

for NidToolbox Light

requries nid-core module available here



NEW - if you would like to have your server logo appear in the notifications area in messages that come from NidToolbox. Please join my Discord https://discord.nidaren.net/ and post them in #server-logos channel.


This module enables sever owner to enable and enforce set of Server Rules. Certain actions of the players can be restricted, until they have accepted the Server ruleset.


Support is provided as well as suggestions are accepted on my Discord here


Server Rules module offers:

  • Prevent player actions as: mining, digging, loitering, tree chopping until they have accepted server rules.
  • Module has own AuthProvider, which means it does not mess or interfere with Server's established laws or demographic systems and allows for module to have more granular control on what players can and cannot do.
  • Provides means for the admins to help protect the server from players, who log just for short time and create mess on the server.
  • Ability to customise Rules popup - it supports all standard Eco's formatting- such as: <b> <color=yellow> <u> or icons.
  • Ability to customise confirmation button that displays the required info to the player, prior to the rules acceptance.
  • Ability to customise deny message that appears when player who did not accept server rules, tries to execute denied action.
  • Ability to customise notification being sent to players when they join the server.
  • Easy reloads, without the need of a server restart.
  • Configuration of the plugin can be displayed at any time, without the need to dig into the files themselves.
  • Possibility to require a password for the Rules acceptance, that can be hidden somewhere within Rules text. It helps assure that players actually read the popup ;)
  • Ability to easily display players, who have not accepted the rules yet.


Future plans:


  • This module will be extended in the future to allow the ability to prevent or limit certain actions for exact amount of time , issue temporary bans and such.


Requirements:


As any module of NidToolbox set, it requires nid-core version 1.0.1+ module, available in the main forum thread: here


How to install:

  1. Unpack .zip archive
  2. Copy nid-rules.dll to Mods\NidToolbox\Modules



Settings files:


Config files are located at Configs\Mods\NidToolbox\


ServerRules.json - stores configuration options of the plugin.


Rules.txt - stores text for the Rules popup. Supports standard Eco's formatting tags .i.e <b> <u> <color> or even icons.


RulesConfirmMessage.txt - stores the text for the Confirmation Button (see below) that displays the final conformation message to the player, prior for them accepting the rules. The lookout of this button can be tested via /rules-showbutton command. Button text also supports standard Eco's formatting tags .i.e <b> <u> <color> or even icons.


RulesDenyMessge.txt - stores the text for the Action Denied Message (see below) that displays when user that have not accepted server rules, tries to execute forbidden action. The lookout of this message can be tested via /rules-testdeny command. Supports standard Eco's formatting tags .i.e <b> <u> <color> or even icons.


RulesNotification.txt - stores the text for the Notification Message (see below) which is sent as mail (bell notification) to the user when they join the server. The lookout of this message can be tested via /rules-testNotifycommand. Supports standard Eco's formatting tags .i.e <b> <u> <color> or even icons.



All config files are created upon first start of the plugin.


See below for examples.


Rules.json


RulesEnabled sets the module enabled or disabled, can be set in game via /rules-enable command.


InformEveryone toggles the message to be sent to everyone on the server, when someone accepts the rules.


PreventClaiming prevents claiming action until player accepted server rules, can be toggled in game via /rules-prevent claiming with bool true or false.


AllowStarterCamp allows placing starting camp for new players, even if server prevents claiming land until rules acceptance.


PreventChopping prevents tree chopping action until player accepted server rules, can be toggled in game via /rules-prevent chopping with bool true or false.


PreventMining prevents mining action until player accepted server rules (this also includes digging action), can be toggled in game via /rules-prevent mining with bool true or false.


PreventLittering prevents dropping trash action until player accepted server rules, can be toggled in game via /rules-prevent littering with bool true or false.


PasswordEnabled sets password requirement to true or false, can be toggled in game via /rules-requirepass with bool true or false.


Password sets the actual password, can be changed in game via /rules-password.


RulesWindowTitle sets the title of the rules window.[/tt].



See below for the list of all available commands in this module with their example usage.


Rules.txt

Code
<color=green><b>Server Rules</b></color>
    1.
    2.
    3.
    4.


Have fun!

<i>Server admins</i>


RulesConfirmMessage.txt, affects this button in game: (click to see the image)


RulesDenyMessage.txt, affects this message in game: (click to see the image)


RulesNotification.txt, affects this message in game: (click to see the image)


Example screenshots:



Available commands:


/help nidRules

Displays information about all commands contained within this module.


/rules-reload

Reloads Rules message from the Rules.txt file.

/nidrules-reload

Code
/rules-reload


/rules-show

Shows current Rules popup.

/rules-show

Code
/rules-show


/rules-enable

Sets the whole module to enabled or disabled state

/rules-enable bool trueFalse

Code
/rules-enable trueFalse


/rules-prevent

Prevents set action from being used by player until they accept the rules. Accepts the following options as actionName claiming chopping littering mining

/rules-prevent string actionName bool true or false

Code
/rules-prevent actionName, trueFalse


/rules-not

Displays the set of players who have not accepted the server ruleset yet.

/rules-not

Code
/rules-not


/rules-requirepass

Sets the password requirement for rules acceptance.

/rules-requirepass-title bool trueFalse

Code
/rules-requirepass trueFalse


/rules-password

Sets the actual password.

/rules-password string password

Code
/rules-password password


/rules-WindowTitle

Sets the window title for Server Rules pop-up.

/rules-WindowTitle string title

Code
/rules-WindowTitle title


/rules-showconfig

Shows the current configuration of the module

/rules-showconfig

Code
/rules-showconfig


/rules-showbutton

Shows confirmation button to test how it looks. Clicking yes or no has no effect, as this is just a test.

/rules-showbutton

Code
/rules-showbutton


/rules-testDeny

Shows deny message to test how it looks.

/rules-testDeny

Code
/rules-testDeny


/rules-testNotify

Sends user a notification to test how it looks.

/rules-testNotify

Code
/rules-testNotify


/rules-accept

Allows to accept server rules, triggers confirmation button to appear for the accepting player.

/rules-accept string password (it is optional)

Code
/rules-accept password
  • Version 1.7.1

    * Updated project to net7.

  • Version 1.6.0

    * Updated Auth Provider to changes in Eco 9.6.


    * Updated module to Eco version 9.6.0


    * Updated to net6.


    * REQUIRES: EM-Framework 3.3.0-beta2 or higher

  • Version 1.5.1

    • Changed OpenCustomPanel to OpenInfoPanel method, as the former seems to trigger "Failed to handle RPC method" on clients.
  • Version 1.5.0

    * (RC.6) Updated module to match changes to IAuthManager and IGameActionAware.


    * (RC.3) Module output filename updated to match namespace.


    * Module updated to Eco 9.5.0


    * REQUIRES: EM-Framework 3.2.0-RC.3 or higher.

  • Version 1.1.5

    Version 1.1.5

    • Compatibility patch with EM Framework 3.1.0
    • Requires EM Framework 3.1.0
  • Version 1.1.4

    Version 1.1.4

    • Deny message can be fully customised.
    • Notification mail can be fully customised.
    • Server Rules window title can be set.
    • Added new command /rules-testDeny - Shows deny message to test how it looks.
    • Added new command /rules-testNotify - Sends user a notification to test how it looks.
    • Added new command /rules-WindowTitle - Sets the window title for Server Rules pop-up.
    • Fixed text column alignment in /rules-showConfig window.
    • Removed NidToolbox header from the rules notification sent to player on login.
  • Version 1.1.2

    Version 1.1.2

    • Added AllowStarterCamp option - if claiming prevention is enabled this option will allow new players to place their starter camps.
    • Migrated project to Net5
    • Compatibility patch for Eco version 9.4
  • Version 1.0.2

    Version 1.0.2:

    • Module has been made compatible with Eco 9.2, due to Auth provider service changing in that version of the game.
  • Version 1.0.1