Merge branch '3.6.0' into master

This commit is contained in:
Fuzzlemann 2017-07-27 14:47:21 +02:00 committed by GitHub
commit 97e2950af1
18 changed files with 309 additions and 32 deletions

View File

@ -1,14 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.destroystokyo.paper:paper-spigot:1.12">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-spigot/1.12/paper-spigot-1.12.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-spigot/1.12/paper-spigot-1.12-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/Downloads/PaperSpigot-latest.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/destroystokyo/paper/paper-spigot/1.12/paper-spigot-1.12-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.0">
<library name="Maven: com.djrapitops:abstract-plugin-framework:2.0.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.0/abstract-plugin-framework-2.0.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/djrapitops/abstract-plugin-framework/2.0.1/abstract-plugin-framework-2.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.command.defaultcmds.StatusCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.command.commands.*;
@ -27,6 +29,24 @@ public class PlanCommand extends TreeCommand<Plan> {
public PlanCommand(Plan plugin) {
super(plugin, "plan", CommandType.CONSOLE, "", "", "plan");
super.setDefaultCommand("inspect");
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"/plan - Main Command",
tCol+" Used to access all SubCommands & help",
sCol+" /plan - List subcommands",
sCol+" /plan <subcommand> ? - in depth help"
};
}
@Override

View File

@ -5,6 +5,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.*;
import main.java.com.djrapitops.plan.command.ConditionUtils;
@ -32,9 +34,27 @@ public class AnalyzeCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public AnalyzeCommand(Plan plugin) {
super("analyze, analyse, analysis", CommandType.CONSOLE, Permissions.ANALYZE.getPermission(), Phrase.CMD_USG_ANALYZE.parse());
super("analyze, analyse, analysis, a", CommandType.CONSOLE, Permissions.ANALYZE.getPermission(), Phrase.CMD_USG_ANALYZE.parse());
this.plugin = plugin;
analysisCache = plugin.getAnalysisCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Analysis Command",
tCol+" Used to Refresh analysis cache & Access the result page",
sCol+" /plan status can be used to check status of analysis while it is running.",
sCol+" Aliases: analyze, analyse, analysis, a"
};
}
@Override

View File

@ -5,6 +5,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.*;
@ -41,6 +43,24 @@ public class InspectCommand extends SubCommand {
this.plugin = plugin;
inspectCache = plugin.getInspectCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Inspect command",
tCol+" Used to get a link to User's inspect page.",
sCol+" Own inspect page can be accessed with /plan inspect",
sCol+" Alias: /plan <name>"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
@ -29,9 +31,27 @@ public class ListCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public ListCommand(Plan plugin) {
super("list", CommandType.CONSOLE, Permissions.INSPECT_OTHER.getPermission(), "List to all cached players", "");
super("list, pl", CommandType.CONSOLE, Permissions.INSPECT_OTHER.getPermission(), "List to all cached players", "");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"List command",
tCol+" Used to get a link to players page.",
sCol+" Players page contains links to all cached inspect pages.",
sCol+" Alias: /plan pl"
};
}
@Override

View File

@ -2,6 +2,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
@ -24,6 +26,25 @@ public class ManageCommand extends TreeCommand<Plan> {
*/
public ManageCommand(Plan plugin) {
super(plugin, "manage,m", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE + "", "plan m");
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage command",
tCol+" Used to Manage Database of the plugin.",
sCol+" Alias: /plan m",
sCol+" /plan m - List subcommands",
sCol+" /plan m <subcommand> ? - in depth help"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -33,9 +35,27 @@ public class QuickAnalyzeCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public QuickAnalyzeCommand(Plan plugin) {
super("qanalyze, qanalyse, qanalysis", CommandType.CONSOLE, Permissions.QUICK_ANALYZE.getPermission(), Phrase.CMD_USG_QANALYZE.parse());
super("qanalyze, qanalyse, qanalysis, qa", CommandType.CONSOLE, Permissions.QUICK_ANALYZE.getPermission(), Phrase.CMD_USG_QANALYZE.parse());
this.plugin = plugin;
analysisCache = plugin.getAnalysisCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Quick Analysis command",
tCol+" Used to get in game info about analysis.",
sCol+" Has less info than full Analysis web page.",
sCol+" Aliases: qanalyze, ganalyse, qanalysis, qa"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -37,10 +39,28 @@ public class QuickInspectCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public QuickInspectCommand(Plan plugin) {
super("qinspect", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.QUICK_INSPECT.getPermission(), Phrase.CMD_USG_QINSPECT + "", Phrase.ARG_PLAYER + "");
super("qinspect, qi", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.QUICK_INSPECT.getPermission(), Phrase.CMD_USG_QINSPECT + "", Phrase.ARG_PLAYER + "");
this.plugin = plugin;
inspectCache = plugin.getInspectCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Quick Inspect command",
tCol+" Used to get some inspect info in game.",
sCol+" Has less info than full Inspect web page.",
sCol+" Alias: /plan qi"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -34,6 +36,24 @@ public class RegisterCommand extends SubCommand {
public RegisterCommand(Plan plugin) {
super("register", CommandType.CONSOLE_WITH_ARGUMENTS, "", "Register a user for the webserver", "<password> [name] [access lvl]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Web Register command",
tCol+" Used to register a new user for the webserver.",
sCol+" Registering a user for another player requires "+Permissions.MANAGE_WEB.getPerm()+" permission.",
sCol+" Passwords are hashed with PBKDF2 (64,000 iterations of SHA1) using a cryptographically-random salt."
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import main.java.com.djrapitops.plan.Permissions;
@ -32,6 +34,23 @@ public class SearchCommand extends SubCommand {
public SearchCommand(Plan plugin) {
super("search", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.SEARCH.getPermission(), Phrase.CMD_USG_SEARCH + "", Phrase.ARG_SEARCH + "");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Search command",
tCol+" Used to get a list of Player names that match the given argument.",
sCol+" Example: /plan search 123 - Finds all users with 123 in their name."
};
}
@Override

View File

@ -2,6 +2,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.command.commands.webuser.WebCheckCommand;
@ -20,6 +22,27 @@ public class WebUserCommand extends TreeCommand<Plan> {
public WebUserCommand(Plan plugin, RegisterCommand register) {
super(plugin, "webuser, web", CommandType.CONSOLE, Permissions.MANAGE_WEB.getPerm(), "Manage Webusers", "plan web");
commands.add(register);
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Web User Manage command",
tCol+" Used to manage web users of the plugin",
sCol+" Users have a permission level:",
tCol+" 0 - Access to all pages",
tCol+" 1 - Access to /players & all inspect pages",
tCol+" 2 - Access to own inspect page",
sCol+" Alias: /plan web"
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -32,6 +34,24 @@ public class ManageClearCommand extends SubCommand {
super("clear", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_CLEAR + "", "<DB> [-a]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Clear command",
tCol+" Used to delete ALL data in the active database.",
sCol+" Plugin should be reloaded after successful clear.",
sCol+" Alias: /plan pl"
};
}
@Override
@ -71,6 +91,7 @@ public class ManageClearCommand extends SubCommand {
sender.sendMessage(Phrase.MANAGE_PROCESS_START.parse());
if (database.removeAllData()) {
plugin.getHandler().getDataCache().clear();
sender.sendMessage(Phrase.MANAGE_CLEAR_SUCCESS.toString());
} else {
sender.sendMessage(Phrase.MANAGE_PROCESS_FAIL.toString());

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -32,6 +34,23 @@ public class ManageHotswapCommand extends SubCommand {
super("hotswap", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_HOTSWAP.toString(), "<DB>");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Hotswap command",
tCol+" Used to change database in use on the fly.",
sCol+" Does not change database if connection fails"
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import com.djrapitops.plugin.utilities.player.Fetch;
@ -39,6 +41,24 @@ public class ManageImportCommand extends SubCommand {
public ManageImportCommand(Plan plugin) {
super("import", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_IMPORT.toString(), Phrase.ARG_IMPORT.toString());
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Import command",
tCol+" Used to import data from other sources",
sCol+" Analysis will be disabled during import.",
sCol+" If a lot of users are not in the database, saving may take a long time."
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -35,6 +37,22 @@ public class ManageRemoveCommand extends SubCommand {
super("remove", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_REMOVE.toString(), Phrase.ARG_PLAYER + " [-a]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Remove command",
tCol+" Used to Remove user's data from the active database."
};
}
@Override

View File

@ -1,8 +1,9 @@
package main.java.com.djrapitops.plan.data.listeners;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.player.Fetch;
import com.djrapitops.plugin.utilities.player.Gamemode;
import com.djrapitops.plugin.utilities.player.bukkit.BukkitPlayer;
import com.djrapitops.plugin.utilities.player.IPlayer;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.UserData;
@ -26,6 +27,7 @@ import java.util.UUID;
* Event Listener for PlayerJoin, PlayerQuit and PlayerKickEvents.
*
* @author Rsl1122
* @since 2.0.0
*/
public class PlanPlayerListener implements Listener {
@ -35,8 +37,7 @@ public class PlanPlayerListener implements Listener {
/**
* Class Constructor.
* <p>
* Copies the references to multiple handlers from Current instance of
* handler.
* Copies the references to multiple handlers from Current instance of handler.
*
* @param plugin Current instance of Plan
*/
@ -48,41 +49,49 @@ public class PlanPlayerListener implements Listener {
/**
* PlayerJoinEvent Listener.
* <p>
* If player is a new player, creates a new data in the database for the
* player. Retrieves the UserData, updates and then saves it to the Cache.
* If player is a new player, creates new data for the player.
* <p>
* Adds a LoginInfo to the processingQueue if the user is not new.
*
* @param event The Fired event.
*/
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerLogin(PlayerJoinEvent event) {
Player player = event.getPlayer();
IPlayer iPlayer = Fetch.wrapBukkit(player);
plugin.getNotificationCenter().checkNotifications(iPlayer);
UUID uuid = player.getUniqueId();
handler.startSession(uuid);
Log.debug(uuid + ": PlayerJoinEvent");
plugin.getRunnableFactory().createNew(new AbsRunnable("NewPlayerCheckTask") {
@Override
public void run() {
LoginInfo loginInfo = new LoginInfo(uuid, MiscUtils.getTime(), player.getAddress().getAddress(), player.isBanned(), player.getDisplayName(), Gamemode.wrap(player.getGameMode()), 1);
boolean isNewPlayer = !plugin.getDB().wasSeenBefore(uuid);
if (isNewPlayer) {
UserData newUserData = NewPlayerCreator.createNewPlayer(BukkitPlayer.wrap(player));
UserData newUserData = NewPlayerCreator.createNewPlayer(iPlayer);
loginInfo.process(newUserData);
handler.newPlayer(newUserData);
} else {
handler.addToPool(loginInfo);
}
Log.debug(uuid + ": PlayerJoinEvent_AsyncTask_END, New:" + isNewPlayer);
this.cancel();
}
}).runTaskAsynchronously();
Log.debug(uuid + ": PlayerJoinEvent_END");
}
/**
* PlayerQuitEvent Listener.
* <p>
* Retrieves the current UserData for the Player, updates it, saves the data
* to Database and clears it from cache.
* Adds a LogoutInfo to the processing Queue.
*
* @param event Fired event
*/
@ -100,7 +109,7 @@ public class PlanPlayerListener implements Listener {
/**
* PlayerKickEvent Listener.
* <p>
* Updates current playerdata and saves it to the Database.
* Adds a KickInfo & LogoutInfo to the processing Queue.
*
* @param event Fired event
*/

View File

@ -107,3 +107,4 @@ permissions:
children:
plan.manage: true
plan.staff: true
apf.notify: true