Skip to content

localconfig.yml

Oliver Martin edited this page Jul 15, 2020 · 3 revisions
############################################################
# +------------------------------------------------------+ #
# |                    MultiChatLocal                    | #
# +------------------------------------------------------+ #
############################################################

# By Revilo410

##################
#   DON'T EDIT   #
version: "1.9.3" #
##################

# 1. Global Chat Settings
# 2. Local Chat Settings
# 3. MultiChat Placeholders
# 4. MultiChat Nicknames
# 5. Channel Control (Support for Towny etc.)

# Specify the name of this server here for the %SERVER% placeholder
server_name: "UNNAMED_SERVER"

This is the config file version, do not edit or it could break your plugin!


############################################################
# +------------------------------------------------------+ #
# |                        Global                        | #
# +------------------------------------------------------+ #
############################################################

# Should this server use a different format for the global chat than the one assigned in the Proxy Plugins folder?
# ( Useful if you want to use local placeholders that may only be present on one server )
override_global_format: false

# The format to use for the global chat if the setting above is set to true
# 
# USES STANDARD MINECRAFT '&X' COLOUR/FORMAT CODES
# %NAME% = The name of the sender
# %DISPLAYNAME% = The display name of the sender
# %PREFIX% = The prefix of the sender
# %SUFFIX% = The suffix of the sender
# %NICK% = The nickname of the sender
# %SERVER% = The server of the sender
# %WORLD% = The world of the sender
#
# Will display as [FORMAT] [MESSAGE]
override_global_format_format: "&5[&dG&5] &f%DISPLAYNAME%&f: "

The above settings allow you to define an "overriding" global chat format. This means that messages sent from this server to the global chat will use this format rather than the one defined in your main MultiChat config.yml file. This is useful if you want to use placeholders for a certain server (i.e. factions) which aren't present on your other servers.


# If the setting below is set to true, then regardless of the settings above, MultiChat will NOT touch the chat format.
# This means that if a plugin such as Towny manages the chat format locally, then this will be used instead.
# MultiChat will still send the message to all the other servers.
# 
# NOTE: THIS IS DONE ON A BEST EFFORT BASIS! (MultiChat is a chat formatting plugin so is designed to format the chat!)
override_all_multichat_formatting: false

If this setting is set to true, then MultiChat will give up all control of chat formatting for this particular server. This means that messages sent to the global chat will use the format set by whatever plugins you have installed. This can be useful if you have a plugin that defines different formats for different ranks etc. Please note however; this is done on a BEST EFFORT BASIS. MultiChat is designed to be the plugin managing your chat, and trying to use info from other plugins will never be 100% perfect.


# Setting this to true will try to override any stubborn plugins messing around with the chat format
force_multichat_format: false

This setting is essentially the opposite of the previous one! If a plugin you have appears to be overriding MultiChats formats, then setting this to true will try and force our formats instead!


############################################################
# +------------------------------------------------------+ #
# |                        Local                         | #
# +------------------------------------------------------+ #
############################################################

# Should MultiChat set the format of the local chat? (Leaving this at false lets other plugins handle the chat)
set_local_format: true

# The local chat format to set if MultiChat is to manage the format
# 
# USES STANDARD MINECRAFT '&X' COLOUR/FORMAT CODES
# %NAME% = The name of the sender
# %DISPLAYNAME% = The display name of the sender
# %PREFIX% = The prefix of the sender
# %SUFFIX% = The suffix of the sender
# %NICK% = The nickname of the sender
# %WORLD% = The world of the sender
# %SERVER% = The server of the sender
#
# Will display as [FORMAT] [MESSAGE]
local_chat_format: "&3[&bL&3] &f%DISPLAYNAME%&f: &7"

This section allows you to define how the local chat works for this server. By default MultiChat will take control of the formatting for the local chat, but if you have a plugin such as towny which presents different channels etc, then you may want to set this to false so that MultiChat does not do any formatting. You can set the format multichat will use if it is enabled above.


############################################################
# +------------------------------------------------------+ #
# |                MultiChat Placeholders                | #
# +------------------------------------------------------+ #
############################################################

# This setting lets you use multichat variables in other plugins!
# For example, if you use essentials chat for your local chat, but wanted to use a multichat nickname.
# You can specify the {multichat_nickname} placeholder as defined below. MultiChat will parse it as usual.
# Essentials doesn't support placeholder API by default, but you can still use PAPI placeholders by making one below!
# {multichat_papi_displayname} will be replaced using the example below and parsed by multichat.
multichat_placeholders:
  nickname: "%NICK%"
  papi_displayname: "%player_displayname%"

Here you can define additional placeholder (the defaults are "nickname" and "papi_displayname", just replace these or add more underneath). These placeholders will be available in other plugins such as essentials chat. If I defined a new placeholder called "server", then it would be usable with the placeholder "{multichat_server}".


############################################################
# +------------------------------------------------------+ #
# |                  MultiChat Nicknames                 | #
# +------------------------------------------------------+ #
############################################################

# Players will be blocked from using any nicknames on this list!
# Can override with permission: multichatlocal.nick.blacklist
# Regular expressions can be used
# (?i) is the regular expression term to ignore case
nickname_blacklist:
- "(?i)Notch"
- "(?i)Jeb"
#- "[1234567890]+.*" # <-- Example to block any nicknames starting with a number!

# Should a prefix be displayed before nicknames to differentiate them from real names?
show_nickname_prefix: false

# What should the prefix before nicknames be?
nickname_prefix: "~"

# The maximum length for nicknames
nickname_length_limit: 20

# The minimum length for nicknames
nickname_length_min: 3

# Should formatting codes such as "&3" be counted in the length of the nickname?
nickname_length_limit_formatting: false

These settings can be used to control how nicknames work on the local server. In the nickname blacklist you can specify nicknames you do not want players to be allowed to use. These work using regular expressions to make it easier. Putting the characters "(?i)" at the start will make it case-insensitive.

If the prefix setting is set to true then MultiChat will display the prefix before a players nickname so it is clear that is not their real name.

For example, if my name is Revilo410, I might be displayed in chat as "[Owner]Revilo410", but if I then nicknamed myself to "Revilo", I would be displayed as "[Owner]~Revilo". This is similar to plugins like Essentials.

There are also options of max and min lengths for nicknames (unless player has multichatlocal.nick.anylength permission).


# Should MultiChat use a database to store nicknames instead of regular files?
# (PLEASE NOTE THE SERVER MUST BE RESTARTED FOR THIS TO TAKE EFFECT)
nickname_sql: false

# If the above option is true, MultiChat will use SQLite by default. Set the below to true if you would prefer to use MySQL.
mysql: false
mysql_url: "" # For example "localhost:3306"
mysql_database: "" # Put the name of your MySQL database here
mysql_user: ""
mysql_pass: ""

# Advanced database settings
mysql_flags: []
#- useSSL=false
#- autoReconnect=true

The above settings allow you to configure an SQL database for MultiChatLocal. By setting nickname_sql to true MultiChat will start using SQLite for nicknames. You can migrate from file based storage to SQL by running /multichatlocal migratetosql from console. If you prefer to use MySQL instead of SQLite then set mysql: true as well as nickname_sql: true. You can then configure the settings for your MySQL below.

The advanced database settings can be used to control if MultiChat should connect to the database using SSL or not. If your database does not support SSL connections then you will need to set "useSSL" to false.

Note that while it is possible to convert to SQL from file based storage, it is not yet possible to go back the other way.

In order to run the /multichatlocal migratetosql command you need to have turned on the applicable SQL settings as described above and restarted your server.


############################################################
# +------------------------------------------------------+ #
# |                   Channel Control                    | #
# +------------------------------------------------------+ #
############################################################

# This section allows you to force messages matching a specific format into a certain channel
# For example, if you had a Towny town channel in the format: [TC]
# You could tell MultiChat to keep this local, even if the player is in global mode
# This allows MultiChat to support Towny and other plugins without having to depend on them directly

# Use regular expressions (regex) to match the channel format
# Allowed channels are currently: local, global or current (for the player's currently selected channel)
# If ignore_format_code=true then format codes (&3 etc.) used in the chat format are filtered out before checking

# The order matters, top has highest priority.
# Credit to metzg for many of these examples...

force_channel:
  # Example to make Towny's town channel stay local
  - regex: '^&f\[&3TC&f\].*'
    ignore_format_codes: false
    channel: 'local'

  # Example to make Towny's nation channel stay local
  - regex: '^&f\[&6NC&f\].*'
    ignore_format_codes: false
    channel: 'local'

  # Example to make Towny's admin channel stay local
  - regex: '^&f\[&4ADMIN&f\].*'
    ignore_format_codes: false
    channel: 'local'

  # Example to make Towny's mod channel stay local
  - regex: '^&f\[&9MOD&f\].*'
    ignore_format_codes: false
    channel: 'local'

  # Make Essentials local (range) chat stay local...
  #- regex: '^\[L\].*'
  #  ignore_format_codes: true
  #  channel: 'local'

  # Make Essentials SHOUT go global
  #- regex: '^\[Shout\].*'
  #  ignore_format_codes: true
  #  channel: 'global'

  # Some other plugin
  #- regex: '^(.+) thinks: (.+)'
  #  ignore_format_codes: true
  #  channel: 'current' # current is useful because we can stop processing other regexes here, instead of waiting until the end and defaulting

  #- regex: '^(.+) slaps (.+) with a trout' 
  #  ignore_format_codes: true
  #  channel: 'local'

  #- regex: '^(.+) slaps (.+) loudly with a trout' 
  #  ignore_format_codes: true
  #  channel: 'global'

This section of the localconfig allows you to force messages matching a specific format into a certain channel using regular expressions. For example, if you had a Towny town channel in the format [TC], then you could tell MultiChat to keep this in local chat, even if the player is in global mode. This allows MultiChat to support Towny and other plugins without having to depend on them directly.

Currently the only channels available in MultiChat are: local, global or current (for the player's currently selected channel). However, in version 2.0 this will change and you will be able to use custom channels. If "ignore_format_code=true" then format codes (&3 etc.) used in the chat format are filtered out before checking if it matches the regex.