-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
145 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
velocity/src/main/java/com/alessiodp/parties/velocity/commands/sub/VelocityCommandDebug.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.alessiodp.parties.velocity.commands.sub; | ||
|
||
import com.alessiodp.core.common.ADPPlugin; | ||
import com.alessiodp.core.common.commands.utils.ADPMainCommand; | ||
import com.alessiodp.core.common.user.User; | ||
import com.alessiodp.parties.common.PartiesPlugin; | ||
import com.alessiodp.parties.common.commands.sub.CommandDebug; | ||
import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; | ||
import com.alessiodp.parties.velocity.configuration.data.VelocityMessages; | ||
import com.alessiodp.parties.velocity.messaging.VelocityPartiesMessageDispatcher; | ||
|
||
import java.util.UUID; | ||
|
||
public class VelocityCommandDebug extends CommandDebug { | ||
public VelocityCommandDebug(ADPPlugin plugin, ADPMainCommand mainCommand) { | ||
super(plugin, mainCommand); | ||
} | ||
|
||
public static void handleDebugBungeecord(PartiesPlugin plugin, UUID temporaryUuid, UUID receiver, boolean replyToPlayer, String sourceServer) { | ||
PartyPlayerImpl player = plugin.getDatabaseManager().getPlayer(temporaryUuid); | ||
User userReceiver = receiver != null ? plugin.getPlayer(receiver) : null; | ||
|
||
if (player != null) { | ||
TemporaryPartyPlayer temporaryPlayer = new TemporaryPartyPlayer(plugin, player.getPlayerUUID()); | ||
temporaryPlayer.setPersistent(false); | ||
plugin.getDatabaseManager().updatePlayer(temporaryPlayer); // Remove the player | ||
|
||
if (userReceiver != null) | ||
((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendDebugBungeecordReply(userReceiver, true, replyToPlayer); | ||
|
||
if (userReceiver != null && replyToPlayer) | ||
userReceiver.sendMessage(VelocityMessages.ADDCMD_DEBUG_BUNGEECORD_SYNC | ||
.replace("%server%", sourceServer), true); | ||
else | ||
plugin.getLoggerManager().log(VelocityMessages.ADDCMD_DEBUG_BUNGEECORD_SYNC | ||
.replace("%server%", sourceServer)); | ||
} else { | ||
if (userReceiver != null) | ||
((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendDebugBungeecordReply(userReceiver, false, replyToPlayer); | ||
|
||
if (userReceiver != null && replyToPlayer) | ||
userReceiver.sendMessage(VelocityMessages.ADDCMD_DEBUG_BUNGEECORD_NOT_SYNC | ||
.replace("%server%", sourceServer), true); | ||
else | ||
plugin.getLoggerManager().log(VelocityMessages.ADDCMD_DEBUG_BUNGEECORD_NOT_SYNC | ||
.replace("%server%", sourceServer)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.