### Main Server Configuration Example
Source: https://docs.nickuc.com/nlogin/config/template
This snippet shows the main configuration structure for a server. It includes settings like language version, debugging mode, and language file selection. The configuration is in a YAML format.
```yaml
####################################################################################################
# +----------------------------------------------------------------------------------------------+ #
# | __ _ | #
# | _ __ / / ___ __ _(_)_ __ | #
# | | '_ / / / _ / _` | | '_ | #
# | | | | / /__| (_) | (_| | | | | | | #
# | |_| |_____/___/ __, |_|_| |_| | #
# | |___/ | #
# | | #
# | A practical, secure and friendly authentication plugin | #
# | | #
# | © 2024 - Powered by nickuc.com | #
# | | #
# | | #
# | For a better understanding of this file see our documentation: | #
# | ==> https://docs.nickuc.com/nlogin/ | #
# | | #
# | New options are not automatically added in this file. Default values are used | #
# | if an option is not found. | #
# +----------------------------------------------------------------------------------------------+ #
####################################################################################################
# Set the version of the file.
language-version: 2
# Sets the debugging mode.
# - This option is used to find problems in the plugin.
debug: false
# Set the language of the plugin
#
# - Available translations:
#
# |=> Arabic: messages_ar.yml
# |=> Bulgarian: messages_bg.yml
# |=> Chinese: messages_cn.yml
# |=> Czech: messages_cz.yml
# |=> German: messages_de.yml
# |=> English: messages_en.yml
# |=> Spanish: messages_es.yml
# |=> French: messages_fr.yml
# |=> Hungarian: messages_hu.yml
# |=> Indonesian: messages_id.yml
# |=> Italian: messages_it.yml
# |=> Lithuanian: messages_lt.yml
# |=> Polish: messages_pl.yml
# |=> Portuguese: messages_br.yml
# |=> Romanian: messages_ro.yml
# |=> Russian: messages_ru.yml
# |=> Turkish: messages_tr.yml
# |=> Ukrainian: messages_ua.yml
# |=> Vietnamese: messages_vn.yml
# |=> Other languages: https://github.com/nickuc/OpeNLogin/blob/master/docs/lang.md
#
# - When changing the language, the current file can be reset.
language-file: "messages_en.yml"
# ___ _ _
# / __ _| |_ __ _| |__ __ _ ___ ___
# / / / _` | __/ _` | '_ / _` / __|/ _
# / /_// (_| | || (_| | |_) | (_| __ __/
# /___,' __,_|____,_|_.__/ __,_|___/___|
```
--------------------------------
### NickUC Configuration Example in YAML
Source: https://docs.nickuc.com/nchat/config/channels
This is an example YAML configuration file for the NickUC project. It demonstrates how to set various options, including channel name, permissions, message delay, logging, capslock prevention, message formatting for sender, target, and spies, balance settings, proxy server configurations, and detailed tag definitions with hover text, suggestions, commands, URLs, and permissions.
```yaml
name: default
permission: nchat.tell
delay-message: 3.0
loggable: false
prevent-capslock: true
format:
sender: '&8[{channel}&8] &8Mensagem para {prefix} {target}&6: {message}'
target: '&8[{channel}&8] &8Mensagem de {prefix} {sender}&6: {message}'
spy: '&c[SPY] &8Mensagem de {sender} para {target}&6: {message}'
balance:
min-balance: 0.0
message-cost: 0.0
proxy:
servers: []
tags:
channel:
hover: '&cMensagem privada'
suggest: ''
sender:
hover: '&7Jogador: &f{sender}'
suggest: '/tell {sender} '
target:
hover: '&7Jogador: &f{target}'
suggest: '/tell {target} '
message:
hover: '&7Data de envio: &f{data}'
suggest: ''
sender_displayname:
hover: '&7Jogador: &f{sender}'
suggest: ''
target_displayname:
hover: '&7Jogador: &f{target}'
suggest: ''
custom_tag:
text: '&b[NickUC.com]'
hover: '&7Clique aqui para acessar o website.'
url: https://www.nickuc.com
permission: nchat.tag.admin
```
--------------------------------
### Public Channel Configuration Example (YAML)
Source: https://docs.nickuc.com/nchat/config/channels
This snippet demonstrates the configuration of a public chat channel named 'local'. It includes settings for commands, permissions, message delay, logging, mentioning, highlighting, preventing caps lock, message formatting (default and spy), balance management, proxy settings, and custom tags with associated hover text, commands, and URLs.
```yaml
name: local
commands:
- l
permission: nchat.channel.local
distance: 50.0
delay-message: 5.0
loggable: false
mentionable: false
highlight: false
prevent-capslock: true
format:
default: '&e[{channel_logo}] &f{clan_tag} {faction_fulltag} {prefix} {bprefix2}
{bprefix} {sender} {bsuffix} {suffix}&e: {message}'
spy: ''
balance:
min-balance: 0.0
message-cost: 0.0
show-message-cost: false
proxy:
enabled: false
servers: []
tags:
channel_logo:
hover: '&7Canal: &f{channel}'
suggest: '/{channel_cmd} '
sender:
hover: |-
&7Clique aqui para mencionar este jogador.
&7Coins: &2$&f{balance}
suggest: '/{channel_cmd} {sender}, '
message:
hover: '&7Data de envio: &f{data}'
suggest: ''
prefix:
hover: '&7Cargo: &f{prefix}'
suggest: ''
magnata:
hover: '&7Magnata do servidor.'
suggest: /money {sender}
faction_fulltag:
hover: |-
&7Nome da facção: &f{faction_name}
&7Posição: &f{faction_role}
suggest: ''
faction_tag:
hover: |-
&7Nome da facção: &f{faction_name}
&7Posição: &f{faction_role}
suggest: ''
clan_tag:
hover: '&7Nome do clan: &f{clan_name}'
suggest: ''
killer:
hover: '&7Vencedor do evento killer.'
suggest: ''
displayname:
hover: '&7Jogador: &f{sender}'
suggest: ''
custom_tag:
text: '&b[NickUC.com]'
hover: '&7Clique aqui para acessar o website.'
url: https://www.nickuc.com
permission: nchat.tag.admin
custom_tag2:
text: '&a[$]'
hover: '&7Clique aqui para ver o saldo de {sender}.'
command: /money {sender}
```
--------------------------------
### Enable OS Firewall Integration (Linux/iptables/ipset)
Source: https://docs.nickuc.com/es/nantibot/config/template
This section details the configuration for integrating with the operating system's firewall, specifically using iptables and ipset on Linux systems. It includes enabling the feature, setting a chain name, and defining commands for installation, startup, shutdown, and blocking.
```yaml
os:
enable-if-available: true
commands:
chain-name: "nantibot"
install: "sudo apt-get install -y iptables ipset"
start:
- "sudo ipset create {chain} hash:ip timeout {time} maxelem 4294967295"
- "sudo iptables -t raw -I PREROUTING -m set --match-set {chain} src -j DROP"
stop:
- "sudo iptables -t raw -D PREROUTING -m set --match-set {chain} src -j DROP"
- "sudo ipset x {chain}"
block:
- "sudo ipset add {chain} {address}"
```
--------------------------------
### nLogin MySQL/MariaDB Configuration (YAML)
Source: https://docs.nickuc.com/nlogin/config/storage
Example configuration for the nLogin plugin's database settings, specifying the connection type, hostname, database name, username, and password. Includes options for SSL and character encoding.
```yaml
# Database settings.
database:
# Sets the type of database used.
#
# - Options available:
# |=> MariaDB
# |=> MySQL
# |=> SQLite
type: MariaDB
remote:
# Defines MariaDB/MySQL information.
# - Tutorial for installation: https://docs.nickuc.com/nlogin/mysql
hostname: "localhost:3306"
database: "nlogin"
username: "root"
password: ""
# Set the connection properties.
# - Don't change this information if you don't know what you are doing!
properties:
#useSSL: false
#sslMode: disable
#verifyServerCertificate: false
useUnicode: true
characterEncoding: "utf8"
```
--------------------------------
### Configure Authentication Servers in nLogin Proxy
Source: https://docs.nickuc.com/nlogin/proxy
This configuration sets up the list of servers that handle player authentication for nLogin on a proxy. Ensure that nLogin is installed on all listed authentication servers. This is crucial for managing player logins across your server network.
```yaml
# ___ _ _
# / __\ __ _ ___| | _____ _ __ __| |
# /__\/// _` |/ __| |/ / _ \ '_ \ / _` |
# / \/ \ (_| | (__| < __/ | | | (_| |
# \_____/\__,_|\___|_|\_\___|_| |_|\__,_|
# Settings related to the backend servers.
backend:
# Sets the list of authentication servers.
# - You must enter this list ALL servers that nLogin is installed on.
# - Most servers use either an authentication server or a main lobby.
# - For more information, go to the tutorial:
# ==> https://docs.nickuc.com/nlogin/proxy
auth-servers:
- 'lobby'
# Defines whether the proxy should check if authentication servers are properly configured.
# - If you are using a server without nLogin (e.g. limbo servers not based on Spigot)
# it is recommended to disable this option.
check-ack-message: true
```
--------------------------------
### Add nChat API Dependency with Maven
Source: https://docs.nickuc.com/nchat/development/usage
This snippet shows how to add the nChat API as a dependency in a Maven project. It includes configuring the repository and specifying the API artifact. Ensure you have Maven installed and configured.
```xml
nickuc-repo
https://repo.nickuc.com/maven-releases/
com.nickuc.chat
api
5.6
provided
com.nickuc.chat
api
5.6
javadocs
```
--------------------------------
### Add nChat API Dependency with Gradle
Source: https://docs.nickuc.com/nchat/development/usage
This snippet demonstrates how to add the nChat API as a compile-only dependency in a Gradle project. It configures the repository and specifies the API artifact. Ensure you have Gradle installed and configured.
```gradle
repositories {
maven {
url = uri('https://repo.nickuc.com/maven-releases/')
}
}
dependencies {
compileOnly('com.nickuc.chat:api:5.6')
}
```
--------------------------------
### Set Tag in PrivateMessageEvent using adventure
Source: https://docs.nickuc.com/nchat/development/usage
This Java code example demonstrates setting a custom tag 'tycoon' with a hover event for private messages using the adventure library. It manages event cancellation and applies specific styling to the message component. This is suitable for private, real, and local/remote messages.
```java
@EventHandler
public void onPrivateMessage(PrivateMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component), PrivateMessageEvent.Type.ALL);
}
```
--------------------------------
### Set Tag in PublicMessageEvent using md5-chat
Source: https://docs.nickuc.com/nchat/development/usage
This Java code example shows how to set a custom tag 'tycoon' with a hover event for public messages using the md5-chat library. It handles event cancellation and ensures the message is processed correctly. This is suitable for public, real, and local/remote messages.
```java
@EventHandler
public void onPublicMessage(PublicMessageEvent event) {
if (event.isCancelled()) {
return;
}
TextComponent component = new TextComponent(TextComponent.fromLegacyText("§2[$]"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new Text(TextComponent.fromLegacyText("§7Server tycoon."))));
event.setTag("tycoon", Component.from(component));
}
```
--------------------------------
### Set Tag in PublicMessageEvent using adventure
Source: https://docs.nickuc.com/nchat/development/usage
This Java code example shows how to set a custom tag 'tycoon' with a hover event for public messages using the adventure library. It handles event cancellation and applies formatting with color and hover text. This is suitable for public, real, and local/remote messages.
```java
@EventHandler
public void onPublicMessage(PublicMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component));
}
```
--------------------------------
### Set Tag in PrivateMessageEvent using md5-chat
Source: https://docs.nickuc.com/nchat/development/usage
This Java code example demonstrates how to set a custom tag 'tycoon' with a hover event for private messages using the md5-chat library. It addresses event cancellation and specifically targets all types of private messages. This is suitable for private, real, and local/remote messages.
```java
@EventHandler
public void onPrivateMessage(PrivateMessageEvent event) {
if (event.isCancelled()) {
return;
}
TextComponent component = new TextComponent(TextComponent.fromLegacyText("§2[$]"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new Text(TextComponent.fromLegacyText("§7Server tycoon."))));
event.setTag("tycoon", Component.from(component), PrivateMessageEvent.Type.ALL);
}
```
--------------------------------
### Configurar Servidores de Autenticação Proxy (YAML)
Source: https://docs.nickuc.com/pt/nlogin/proxy/setup
Configura a seção 'backend' no arquivo config.yml para definir os servidores de autenticação. É necessário listar todos os servidores onde o nLogin está instalado. A opção 'check-ack-message' pode ser desativada para servidores sem nLogin.
```yaml
# ___ _ _
# / __\ __ _ ___| | _____ _ __ __| |
# /__\/// _` |/ __| |/ / _ \ '_ \ / _` |
# / \/ \ (_| | (__| < __/ | | | (_| |
# \_____/\__,_|\___|_|\_\___|_| |_|\__,_|
# Configurações relacionadas aos servidores de backend.
backend:
# Define a lista de servidores de autenticação.
# - Você deve insira nesta lista TODOS os servidores que o nLogin está instalado.
# - A maioria dos servidores utiliza um servidor de autenticação ou um lobby principal.
# - Para mais informações, acesse o tutorial:
# ==> https://docs.nickuc.com/nlogin/proxy
auth-servers:
- 'lobby'
# Define se o proxy deve verificar se os servidores de autenticação estão configurados corretamente.
# - Se você usa um servidor sem o nLogin (ex.: servidores limbo não baseados no Spigot)
# é recomendável desativar esta opção.
check-ack-message: true
```
--------------------------------
### Configurar Redirecionamento Após Login Proxy (YAML)
Source: https://docs.nickuc.com/pt/nlogin/proxy/setup
Configura a seção 'redirect' no arquivo config.yml para gerenciar o redirecionamento de jogadores após a autenticação. Opções incluem sobrescrever o primeiro servidor, redirecionar para o último servidor conectado, tempos de espera e habilitar o encaminhamento automático para servidores definidos em 'after-auth.servers'.
```yaml
# ___ _ _
# / __\ __ _ ___| | _____ _ __ __| |
# /__\/// _` |/ __| |/ / _ \ '_ \ / _` |
# / \/ \ (_| | (__| < __/ | | | (_| |
# \_____/\__,_|\___|_|\_\___|_| |_|\__,_|
# Configurações relacionadas aos servidores de backend.
backend:
# Define a lista de servidores de autenticação.
# - Você deve insira nesta lista TODOS os servidores que o nLogin está instalado.
# - A maioria dos servidores utiliza um servidor de autenticação ou um lobby principal.
# - Para mais informações, acesse o tutorial:
# ==> https://docs.nickuc.com/nlogin/proxy
auth-servers:
- 'auth'
# Define se o proxy deve verificar se os servidores de autenticação estão configurados corretamente.
# - Se você usa um servidor sem o nLogin (ex.: servidores limbo não baseados no Spigot)
# é recomendável desativar esta opção.
check-ack-message: true
# __ _ _ _
# /__\ ___ __| (_)_ __ ___ ___| |_
# / \/// _ \/ _` | | '__/ _ \/ __| __|
# / _ \ __/ (_| | | | __/ (__| |_
# \/ \_/\___|\__,_|_|_| \___|\___|\__|
# Configurações do redirecionamento de servidores.
redirect:
# Define se o redirecionamento do primeiro servidor deve ser sobrescrito pelo nLogin.
# - Esta opção evita que jogadores burlem o servidor de autenticação e restaura
# o primeiro servidor fornecido pelo proxy.
override-first-server: true
# Define se o plugin deverá redirecionar os jogadores para o último servidor conectado.
# - Se o último servidor conectado não existir mais, um servidor aleatório da opção "after-auth.servers" será escolhido.
redirect-to-last-server: false
# Define o tempo de espera (em milissegundos) ao trocar o servidor.
connect-delay: 500
# Define o tempo de espera (em milissegundos) para reconectar ao servidor após falhar a conexão.
retry-delay: 5000
after-auth:
# Define se jogadores deverão ser encaminhados automaticamente para outros servidores ao se autenticarem.
enabled: true
# Define a quais servidores os jogadores deverão ser encaminhados.
# - Ao inserir mais de um item, o servidor será escolhido randomicamente.
servers:
- "lobby-1"
- "lobby-2"
```
--------------------------------
### Añadir API de nLogin con Gradle
Source: https://docs.nickuc.com/es/nlogin/development/usage
Configura tu proyecto Gradle para incluir la API de nLogin. Esto requiere añadir el repositorio de nLogin y la dependencia de la API. La versión es 10.4 y se utiliza `compileOnly`.
```groovy
repositories {
maven {
url = uri('https://repo.nickuc.com/maven-releases/')
}
}
dependencies {
compileOnly('com.nickuc.login:api:10.4')
}
```
--------------------------------
### Backend Server Configuration
Source: https://docs.nickuc.com/nlogin/proxy/bungeeguard
Configuration for backend servers (Spigot/Paper) to work with BungeeGuard+. This requires Paper 1.9.4+ or ProtocolLib, setting 'bungeecord' to true in spigot.yml, adding BungeeGuard.jar, and listing allowed tokens in config.yml.
```yaml
bungeecord: true
```
```yaml
# plugins/BungeeGuard/config.yml
allowed-tokens:
- "YOUR TOKEN HERE"
```
--------------------------------
### Añadir API de nLogin con Maven
Source: https://docs.nickuc.com/es/nlogin/development/usage
Configura tu proyecto Maven para incluir la API de nLogin. Esto implica añadir el repositorio de nLogin y la dependencia de la API. La versión especificada es 10.4.
```xml
nickuc-repo
https://repo.nickuc.com/maven-releases/
com.nickuc.login
api
10.4
provided
com.nickuc.login
api
10.4
javadocs
```
--------------------------------
### Crear base de datos MySQL/MariaDB en la shell
Source: https://docs.nickuc.com/es/nlogin/config/storage
Comandos SQL para crear una base de datos en MySQL o MariaDB. Se especifican diferentes collations para MySQL 8.0 y versiones anteriores. Requiere acceso a la shell de MySQL.
```sql
SET storage_engine=InnoDB;
-- MySQL 8.0
CREATE DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
-- Other versions
CREATE DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```
--------------------------------
### Conceder privilegios de usuario MySQL/MariaDB
Source: https://docs.nickuc.com/es/nlogin/config/storage
Comando SQL para otorgar permisos a un usuario en una base de datos específica. Se requiere el nombre de la base de datos, el nombre de usuario, la contraseña y el host ('localhost' en este caso).
```sql
GRANT ALTER, DROP, SELECT, INSERT, UPDATE, DELETE ON TO @'localhost' IDENTIFIED BY ''
```
--------------------------------
### Configuración de base de datos nLogin (YAML)
Source: https://docs.nickuc.com/es/nlogin/config/storage
Ejemplo de configuración de la sección 'database' en el archivo `config.yml` del plugin nLogin. Especifica el tipo de base de datos, hostname, puerto, nombre de la base de datos, usuario y contraseña, así como propiedades de conexión.
```yaml
# ___ _ _
# / \__ _| |_ __ _| |__ __ _ ___ ___
# / /\ / _` | __/ _` | '_ \ / _` / __|/ _ \
# / /_// (_| | || (_| | |_) | (_| \__ \ __/
# /___,' \__,_|\__\__,_|_.__/ \__,_|___/\___|
# Configuración de la base de datos.
database:
# Establece el tipo de base de datos utilizada.
#
# - Opciones disponibles:
# |=> MariaDB
# |=> MySQL
# |=> SQLite
type: MariaDB
remote:
# Define la información de MariaDB/MySQL.
# - Tutorial de instalación: https://docs.nickuc.com/nlogin/mysql
hostname: "localhost:3306"
database: "nlogin"
username: "root"
password: ""
# Establece las propiedades de la conexión.
# - ¡No cambies esta información si no sabes lo que estás haciendo!
properties:
#useSSL: false
#sslMode: disable
#verifyServerCertificate: false
useUnicode: true
characterEncoding: "utf8"
```
--------------------------------
### Create MySQL Database (Shell)
Source: https://docs.nickuc.com/nlogin/config/storage
Commands to enter the MySQL shell, set the storage engine, and create a database with specific character set and collation. Supports MySQL 8.0 and other versions.
```sql
SET storage_engine=InnoDB;
CREATE DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
```
```sql
SET storage_engine=InnoDB;
CREATE DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
```
--------------------------------
### Configuración de Canal Público en YAML
Source: https://docs.nickuc.com/es/nchat/config/channels
Ejemplo de configuración de un canal público en formato YAML. Define parámetros como nombre, comandos, permisos, delay de mensajes, formato de mensajes, balance de usuario, proxy y etiquetas personalizadas. La configuración permite un alto grado de personalización para la visualización y el comportamiento de los mensajes.
```yaml
name: local
commands:
- l
permission: nchat.channel.local
distance: 50.0
delay-message: 5.0
loggable: false
mentionable: false
highlight: false
prevent-capslock: true
format:
default: '&e[{channel_logo}] &f{clan_tag} {faction_fulltag} {prefix} {bprefix2}
{bprefix} {sender} {bsuffix} {suffix}&e: {message}'
spy: ''
balance:
min-balance: 0.0
message-cost: 0.0
show-message-cost: false
proxy:
enabled: false
servers: []
tags:
channel_logo:
hover: '&7Canal: &f{channel}'
suggest: '/{channel_cmd} '
sender:
hover: |-
&7Clique aqui para mencionar este jogador.
&7Coins: &2$&f{balance}
suggest: '/{channel_cmd} {sender}, '
message:
hover: '&7Data de envio: &f{data}'
suggest: ''
prefix:
hover: '&7Cargo: &f{prefix}'
suggest: ''
magnata:
hover: '&7Magnata do servidor.'
suggest: /money {sender}
faction_fulltag:
hover: |-
&7Nome da facção: &f{faction_name}
&7Posição: &f{faction_role}
suggest: ''
faction_tag:
hover: |-
&7Nome da facção: &f{faction_name}
&7Posição: &f{faction_role}
suggest: ''
clan_tag:
hover: '&7Nome do clan: &f{clan_name}'
suggest: ''
killer:
hover: '&7Vencedor do evento killer.'
suggest: ''
displayname:
hover: '&7Jogador: &f{sender}'
suggest: ''
custom_tag:
text: '&b[NickUC.com]'
hover: '&7Clique aqui para acessar o website.'
url: https://www.nickuc.com
permission: nchat.tag.admin
custom_tag2:
text: '&a[$]'
hover: '&7Clique aqui para ver o saldo de {sender}.'
command: /money {sender}
```
--------------------------------
### Deshabilitar Legendchat Hook en DiscordSRV (YAML)
Source: https://docs.nickuc.com/es/nchat/tutorials/discordsrv
Configura DiscordSRV para deshabilitar el hook de Legendchat, lo cual es necesario para solucionar problemas de mensajes duplicados en nChat. Requiere reiniciar el servidor después de aplicar el cambio.
```yaml
# Plugin hooks
# You must restart your server after changing these options
DisabledPluginHooks: [Legendchat]
```
--------------------------------
### BungeeCord Proxy Configuration
Source: https://docs.nickuc.com/nlogin/proxy/bungeeguard
Steps to configure BungeeGuard+ on a BungeeCord proxy. This involves setting 'ip_forward' in config.yml, adding the BungeeGuard.jar plugin, and annotating a token in the token.yml file.
```yaml
ip_forward: true
```
```yaml
# token.yml content will be generated after plugin installation
```
--------------------------------
### Configure Post-Login Redirection in nLogin Proxy
Source: https://docs.nickuc.com/nlogin/proxy/setup
This configuration snippet for the nLogin proxy plugin manages player redirection after successful authentication. It allows specifying multiple servers for players to connect to, with options to override the initial server and control connection delays. The 'after-auth.enabled' option must be set to true to activate this feature.
```yaml
# ___ _ _
# / __\ __ _ ___| | _____ _ __ __| |
# /__\/// _` |/ __| |/ / _ \ '_ \ / _` |
# / \/ \ (_| | (__| < __/ | | | (_| |
# \_____/\__,_|\___|_|\_\___|_| |_|\__,_|
# Settings related to the backend servers.
backend:
# Sets the list of authentication servers.
# - You must enter this list ALL servers that nLogin is installed on.
# - Most servers use either an authentication server or a main lobby.
# - For more information, go to the tutorial:
# ==> https://docs.nickuc.com/nlogin/proxy
auth-servers:
- 'auth'
# Defines whether the proxy should check if authentication servers are properly configured.
# - If you are using a server without nLogin (e.g. limbo servers not based on Spigot)
# it is recommended to disable this option.
check-ack-message: true
# __ _ _ _
# /__\ ___ __| (_)_ __ ___ ___| |_
# / \/// _ \/ _` | | '__/ _ \/ __| __|
# / _ \ __/ (_| | | | | __/ (__| |_
# \/ \_/\___|\__,_|_|_| \___|\___|\__|
# Server redirection settings.
redirect:
# Defines whether the redirection of the first server should be overwritten by nLogin.
# - This option prevents players from bypassing the authentication server
# and restores the first server provided by the proxy.
override-first-server: true
# Defines whether the plugin should redirect players to the last connected server.
# - If the last connected server no longer exists, a random server from the "after-auth.servers" option will be chosen.
redirect-to-last-server: false
# Sets the waiting time (in milliseconds) when switching the server.
connect-delay: 500
# Sets the waiting time (in milliseconds) to reconnect to the server when the connection fails.
retry-delay: 5000
after-auth:
# Defines whether players should be automatically forwarded to other servers after authentication.
enabled: false
# Defines which servers the players should be forwarded to.
# - When entering more than one item, the server will be chosen randomly.
servers:
- "lobby-1"
- "lobby-2"
```
--------------------------------
### Configure Firewall IP Blocking and Throttling
Source: https://docs.nickuc.com/es/nantibot/config/template
This configuration section defines the parameters for IP blocking and connection throttling. It sets the duration for IP blocking, and parameters for connection throttling such as duration, refusal threshold, and blocking threshold.
```yaml
firewall:
duration: 90
throttle:
duration: 2000
refuse: 3
block: 10
```
--------------------------------
### Adding nChat API (Gradle)
Source: https://docs.nickuc.com/es/nchat/development/usage
Instructions for adding the nChat API dependency to your project using Gradle.
```APIDOC
## Adding nChat API
### Gradle
```gradle
repositories {
maven {
url = uri('https://repo.nickuc.com/maven-releases/')
}
}
dependencies {
compileOnly('com.nickuc.chat:api:5.6')
}
```
```
--------------------------------
### Configure Post-Login Server Redirection in nLogin Proxy
Source: https://docs.nickuc.com/nlogin/proxy
This configuration allows nLogin to manage player redirection after successful authentication. It specifies which servers players should be sent to, whether to override the proxy's initial server, and delays for connection and retries. This enhances the player experience by directing them to appropriate game servers.
```yaml
# ___ _ _
# / __\ __ _ ___| | _____ _ __ __| |
# /__\/// _` |/ __| |/ / _ \ '_ \ / _` |
# / \/ \ (_| | (__| < __/ | | | (_| |
# \_____/\__,_|\___|_|\_\___|_| |_|\__,_|
# Settings related to the backend servers.
backend:
# Sets the list of authentication servers.
# - You must enter this list ALL servers that nLogin is installed on.
# - Most servers use either an authentication server or a main lobby.
# - For more information, go to the tutorial:
# ==> https://docs.nickuc.com/nlogin/proxy
auth-servers:
- 'auth'
# Defines whether the proxy should check if authentication servers are properly configured.
# - If you are using a server without nLogin (e.g. limbo servers not based on Spigot)
# it is recommended to disable this option.
check-ack-message: true
# __ _ _ _
# /__\ ___ __| (_)_ __ ___ ___| |_
# / \/// _ \/ _` | | '__/ _ \/ __| __|
# / _ \ __/ (_| | | | __/ (__| |_
# \/ \_/\___|\__,_|_| |_\___|\___|\__|
# Server redirection settings.
redirect:
# Defines whether the redirection of the first server should be overwritten by nLogin.
# - This option prevents players from bypassing the authentication server
# and restores the first server provided by the proxy.
override-first-server: true
# Defines whether the plugin should redirect players to the last connected server.
# - If the last connected server no longer exists, a random server from the "after-auth.servers" option will be chosen.
redirect-to-last-server: false
# Sets the waiting time (in milliseconds) when switching the server.
connect-delay: 500
# Sets the waiting time (in milliseconds) to reconnect to the server when the connection fails.
retry-delay: 5000
after-auth:
# Defines whether players should be automatically forwarded to other servers after authentication.
enabled: false
# Defines which servers the players should be forwarded to.
# - When entering more than one item, the server will be chosen randomly.
servers:
- "lobby-1"
- "lobby-2"
```
--------------------------------
### Configure Username Appender in nLogin (YAML)
Source: https://docs.nickuc.com/es/nlogin/config/username-appender
YAML configuration for the Username Appender feature in nLogin. This section allows enabling the feature, setting prefixes/suffixes for premium and offline players, defining their position (prefix/suffix), and specifying the domains that identify each player type. It helps differentiate players and prevent nick collisions.
```yaml
# ___ _
# / _ \_ __ ___ _ __ ___ (_)_ _ _ __ ___ __/__
# / /_)/ '__/ _ \ '_ ` _ \ | | | | '_ ` _ \ \ /
# / ___/| | | __/ | | | | | | |_| | | | | | /_ _
# \/ |_| \___|_| |_| |_|_|\__,_|_| |_| |_| \/
# Funciones de pago del plugin (versión premium).
premium:
username-appender:
# Establece si el plugin debe añadir una extensión al nick.
# - Esta característica se recomienda para diferenciar a los jugadores premium de los jugadores offline.
#
# - Puedes cambiar esta opción libremente: los datos de los jugadores no se perderán.
#
# - Para más información, accede a la documentación:
# * https://docs.nickuc.com/nlogin/username-appender
#
enabled: true
premium:
# Establece el prefijo/sufijo que se añade a los apodos de los jugadores premium.
username-appendix: ""
# Establece la posición del apéndice que se añade a los apodos de los jugadores premium.
#
# - Opciones disponibles:
# |=> PREFIX (antes del apodo)
# |=> SUFFIX (después del apodo)
#
position: "suffix"
# Define la lista de dominios que se utilizarán para identificar a los jugadores premium.
# - Se aceptan expresiones regex.
# - Los dominios a comprobar estarán siempre en minúsculas.
domains:
- "premium.servidor.com"
offline:
# Establece el prefijo/sufijo que se añade a los apodos de los jugadores offline.
username-appendix: "+"
# Establece la posición del apéndice que se añade a los apodos de los jugadores offline.
#
# - Opciones disponibles:
# |=> PREFIX (antes del apodo)
# |=> SUFFIX (después del apodo)
#
position: "suffix"
# Define la lista de dominios que se utilizarán para identificar a los jugadores offline.
# - Se aceptan expresiones regex.
# - Los dominios a comprobar estarán siempre en minúsculas.
domains:
- "servidor.com"
```
--------------------------------
### Adding nChat API (Maven)
Source: https://docs.nickuc.com/es/nchat/development/usage
Instructions for adding the nChat API dependency to your project using Maven.
```APIDOC
## Adding nChat API
### Maven
```xml
nickuc-repo
https://repo.nickuc.com/maven-releases/
com.nickuc.chat
api
5.6
provided
com.nickuc.chat
api
5.6
javadocs
```
```
--------------------------------
### Velocity Proxy Configuration
Source: https://docs.nickuc.com/nlogin/proxy/bungeeguard
Instructions for configuring BungeeGuard+ on a Velocity proxy. This includes ensuring Velocity version compatibility, setting 'player-info-forwarding-mode' to 'bungeeguard' in velocity.toml, and noting the forwarding-secret.
```toml
player-info-forwarding-mode = "bungeeguard"
```
--------------------------------
### Grant MySQL User Privileges (Shell)
Source: https://docs.nickuc.com/nlogin/config/storage
SQL command to grant necessary privileges (ALTER, DROP, SELECT, INSERT, UPDATE, DELETE) to a user on a newly created database. Requires the database name, username, and user password.
```sql
GRANT ALTER, DROP, SELECT, INSERT, UPDATE, DELETE ON TO @'localhost' IDENTIFIED BY ''
```
--------------------------------
### Listening to Events
Source: https://docs.nickuc.com/es/nchat/development/usage
Information on how to listen to various chat events and tag them.
```APIDOC
## Listening to Events
All events have the following characteristics:
* **Asynchronous**: They run in parallel to the server thread.
* **Public or Private**: Public events are seen by multiple players (e.g., global chat), while Private events have a sender and receiver (e.g., tell).
* **Real or Virtual**: Real events are created by a player (e.g., global chat, local chat, tell), while Virtual events are created without a player (e.g., message generated by a plugin).
* **Local or Remote (proxy)**: Local events are processed on a single server, while Remote events are processed for multiple servers.
**Limitation**: Tags defined in events cannot be used as placeholders in custom tags. In such cases:
* Register the tag with PlaceholderAPI: `%tag-name%`.
* Register a global tag with the nChat API: `{tag-name}`.
### Tycoon (using md5-chat)
#### Public Message Event
```java
@EventHandler
public void onPublicMessage(PublicMessageEvent event) {
if (event.isCancelled()) {
return;
}
TextComponent component = new TextComponent(TextComponent.fromLegacyText("§2[$]"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new Text(TextComponent.fromLegacyText("§7Server tycoon."))));
event.setTag("tycoon", Component.from(component));
}
```
#### Private Message Event
```java
@EventHandler
public void onPrivateMessage(PrivateMessageEvent event) {
if (event.isCancelled()) {
return;
}
TextComponent component = new TextComponent(TextComponent.fromLegacyText("§2[$]"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new Text(TextComponent.fromLegacyText("§7Server tycoon."))));
event.setTag("tycoon", Component.from(component), PrivateMessageEvent.Type.ALL);
}
```
### Tycoon (using adventure)
#### Public Message Event
```java
@EventHandler
public void onPublicMessage(PublicMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component));
}
```
#### Private Message Event
```java
@EventHandler
public void onPrivateMessage(PrivateMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component), PrivateMessageEvent.Type.ALL);
}
```
```
--------------------------------
### Define Custom Tag - YAML
Source: https://docs.nickuc.com/nchat/config/tags
This snippet shows how to define a custom tag in YAML format. It includes properties for the tag's display text, hover message, suggestion text, and required permission. The 'text' field supports color codes.
```yaml
champion:
text: "&a[Champion]"
hover: "&7The player won the championship."
suggest: "/championship about"
permission: "tag.champion"
```
--------------------------------
### Set Tycoon Tag in Public/Private Messages (Adventure)
Source: https://docs.nickuc.com/es/nchat/development/usage
This Java code snippet demonstrates setting a 'tycoon' tag for public and private messages using the Adventure library. It defines event handlers for PublicMessageEvent and PrivateMessageEvent, creating a styled TextComponent with hover effects and applying it using event.setTag(). The private message tag is set for all types.
```java
// Mensaje recibido por cualquier canal público, real y local/remoto (global, local, etc.)
@EventHandler
public void onPublicMessage(PublicMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component));
}
// Mensaje recibido por cualquier canal privado, real y local/remoto (tell)
@EventHandler
public void onPrivateMessage(PrivateMessageEvent event) {
if (event.isCancelled()) {
return;
}
HoverEvent hoverEvent = HoverEvent.showText(
Component.text("Server tycoon.").color(NamedTextColor.GRAY));
TextComponent component = Component.text("[$]")
.color(NamedTextColor.DARK_GREEN)
.hoverEvent(hoverEvent);
event.setTag("tycoon", com.nickuc.chat.api.util.Component.from(component), PrivateMessageEvent.Type.ALL);
}
```