mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-26 00:31:50 +01:00
Add BungeeCord playerSendTo config
This commit is contained in:
parent
37918e845c
commit
625369db5a
@ -1,7 +1,14 @@
|
|||||||
package fr.xephi.authme.process.login;
|
package fr.xephi.authme.process.login;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.backup.JsonCache;
|
import fr.xephi.authme.cache.backup.JsonCache;
|
||||||
@ -16,11 +23,6 @@ import fr.xephi.authme.listener.AuthMePlayerListener;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.util.Utils;
|
import fr.xephi.authme.util.Utils;
|
||||||
import fr.xephi.authme.util.Utils.GroupType;
|
import fr.xephi.authme.util.Utils.GroupType;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@ -197,6 +199,16 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
|
|
||||||
// Login is now finish , we can force all commands
|
// Login is now finish , we can force all commands
|
||||||
forceCommands();
|
forceCommands();
|
||||||
|
|
||||||
|
sendTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendTo() {
|
||||||
|
if (Settings.sendPlayerTo.isEmpty())
|
||||||
|
return;
|
||||||
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(Settings.sendPlayerTo);
|
||||||
|
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataOutput;
|
import com.google.common.io.ByteArrayDataOutput;
|
||||||
import com.google.common.io.ByteStreams;
|
import com.google.common.io.ByteStreams;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
@ -14,11 +21,6 @@ import fr.xephi.authme.settings.Settings;
|
|||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
import fr.xephi.authme.util.Utils;
|
import fr.xephi.authme.util.Utils;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@ -161,5 +163,16 @@ public class ProcessSyncPasswordRegister implements Runnable {
|
|||||||
|
|
||||||
// Register is now finish , we can force all commands
|
// Register is now finish , we can force all commands
|
||||||
forceCommands();
|
forceCommands();
|
||||||
|
|
||||||
|
sendTo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendTo() {
|
||||||
|
if (Settings.sendPlayerTo.isEmpty())
|
||||||
|
return;
|
||||||
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(Settings.sendPlayerTo);
|
||||||
|
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
package fr.xephi.authme.settings;
|
package fr.xephi.authme.settings;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
|
||||||
import com.google.common.io.Files;
|
|
||||||
import fr.xephi.authme.AuthMe;
|
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
|
||||||
import fr.xephi.authme.datasource.DataSource.DataSourceType;
|
|
||||||
import fr.xephi.authme.security.HashAlgorithm;
|
|
||||||
import fr.xephi.authme.util.Wrapper;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -25,6 +15,18 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
|
import com.google.common.io.Files;
|
||||||
|
|
||||||
|
import fr.xephi.authme.AuthMe;
|
||||||
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
|
import fr.xephi.authme.datasource.DataSource.DataSourceType;
|
||||||
|
import fr.xephi.authme.security.HashAlgorithm;
|
||||||
|
import fr.xephi.authme.util.Wrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public final class Settings {
|
public final class Settings {
|
||||||
@ -93,7 +95,7 @@ public final class Settings {
|
|||||||
getMailSubject, getMailText, getMySQLlastlocWorld, defaultWorld,
|
getMailSubject, getMailText, getMySQLlastlocWorld, defaultWorld,
|
||||||
getPhpbbPrefix, getWordPressPrefix, getMySQLColumnLogged,
|
getPhpbbPrefix, getWordPressPrefix, getMySQLColumnLogged,
|
||||||
spawnPriority, crazyloginFileName, getPassRegex,
|
spawnPriority, crazyloginFileName, getPassRegex,
|
||||||
getMySQLColumnRealName, emailOauth2Token;
|
getMySQLColumnRealName, emailOauth2Token, sendPlayerTo;
|
||||||
public static int getWarnMessageInterval, getSessionTimeout,
|
public static int getWarnMessageInterval, getSessionTimeout,
|
||||||
getRegistrationTimeout, getMaxNickLength, getMinNickLength,
|
getRegistrationTimeout, getMaxNickLength, getMinNickLength,
|
||||||
getPasswordMinLen, getMovementRadius, getmaxRegPerIp,
|
getPasswordMinLen, getMovementRadius, getmaxRegPerIp,
|
||||||
@ -301,6 +303,7 @@ public final class Settings {
|
|||||||
preventOtherCase = configFile.getBoolean("settings.preventOtherCase", false);
|
preventOtherCase = configFile.getBoolean("settings.preventOtherCase", false);
|
||||||
kickPlayersBeforeStopping = configFile.getBoolean("Security.stop.kickPlayersBeforeStopping", true);
|
kickPlayersBeforeStopping = configFile.getBoolean("Security.stop.kickPlayersBeforeStopping", true);
|
||||||
emailOauth2Token = configFile.getString("Email.emailOauth2Token", "");
|
emailOauth2Token = configFile.getString("Email.emailOauth2Token", "");
|
||||||
|
sendPlayerTo = configFile.getString("Hooks.sendPlayerTo", "");
|
||||||
|
|
||||||
// Load the welcome message
|
// Load the welcome message
|
||||||
getWelcomeMessage();
|
getWelcomeMessage();
|
||||||
@ -743,6 +746,12 @@ public final class Settings {
|
|||||||
|
|
||||||
if (!contains("Email.emailOauth2Token"))
|
if (!contains("Email.emailOauth2Token"))
|
||||||
set("Email.emailOauth2Token", "");
|
set("Email.emailOauth2Token", "");
|
||||||
|
|
||||||
|
if (!contains("Hook.sendPlayerTo"))
|
||||||
|
{
|
||||||
|
set("Hooks.sendPlayerTo", "");
|
||||||
|
changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (changes) {
|
if (changes) {
|
||||||
plugin.getLogger().warning("Merged new Config Options - I'm not an error, please don't report me");
|
plugin.getLogger().warning("Merged new Config Options - I'm not an error, please don't report me");
|
||||||
|
@ -359,8 +359,10 @@ Email:
|
|||||||
Hooks:
|
Hooks:
|
||||||
# Do we need to hook with multiverse for spawn checking?
|
# Do we need to hook with multiverse for spawn checking?
|
||||||
multiverse: true
|
multiverse: true
|
||||||
# Do we need to hook with BungeeCord for get the real Player ip?
|
# Do we need to hook with BungeeCord ?
|
||||||
bungeecord: false
|
bungeecord: false
|
||||||
|
# Send player to this BungeeCord server after register/login
|
||||||
|
sendPlayerTo: ''
|
||||||
# Do we need to disable Essentials SocialSpy on join?
|
# Do we need to disable Essentials SocialSpy on join?
|
||||||
disableSocialSpy: true
|
disableSocialSpy: true
|
||||||
# Do we need to force /motd Essentials command on join?
|
# Do we need to force /motd Essentials command on join?
|
||||||
|
Loading…
Reference in New Issue
Block a user