");
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
diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java
index 5ac186290..08367a022 100644
--- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java
+++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageImportCommand.java
@@ -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
diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java
index e5796468e..c8ec111f4 100644
--- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java
+++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageRemoveCommand.java
@@ -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
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
index c7baf997f..48ce0197c 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
@@ -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.
*
- * 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.
*
- * 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.
+ *
+ * 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.
*
- * 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.
*
- * Updates current playerdata and saves it to the Database.
+ * Adds a KickInfo & LogoutInfo to the processing Queue.
*
* @param event Fired event
*/
diff --git a/Plan/src/main/resources/plugin.yml b/Plan/src/main/resources/plugin.yml
index 1d827e17c..dd3010eb7 100644
--- a/Plan/src/main/resources/plugin.yml
+++ b/Plan/src/main/resources/plugin.yml
@@ -106,4 +106,5 @@ permissions:
plan.*:
children:
plan.manage: true
- plan.staff: true
\ No newline at end of file
+ plan.staff: true
+ apf.notify: true
\ No newline at end of file