Package com.ultikits.ultitools.commands
Class CloudLoginCommand
java.lang.Object
com.ultikits.ultitools.abstracts.command.BaseCommandExecutor
com.ultikits.ultitools.commands.CloudLoginCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor
@CmdExecutor(description="UltiCloud Authentication Commands",
alias="ulticloud",
requireOp=true)
public class CloudLoginCommand
extends BaseCommandExecutor
Links this server to UltiCloud with a device code (protocol v2).
Usage:
/ulticloud login — Link this server to UltiCloud
/ulticloud logout — Unlink this server and revoke its credential
/ulticloud status — Show link and connection status
/ulticloud reconnect — Retry the UltiCloud connection now
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classRenders the device login's outcomes to the sender that ran/ulticloud login. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final StringSaid when/ulticloud reconnectfinds the connection stopped by a server-ID mismatch (contract answer 21): the server is still linked, but only a restart or a new login leaves that state.(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleHelp(org.bukkit.command.CommandSender sender) Handles the help command.private static booleanisRemoteSender(org.bukkit.command.CommandSender sender) voidlogin(org.bukkit.command.CommandSender sender) Starts the device login.voidlogout(org.bukkit.command.CommandSender sender) voidreconnect(org.bukkit.command.CommandSender sender) private static booleanrefusePanelAuthentication(org.bukkit.command.CommandSender sender) Backstop for synchronous aliases and nested panel commands.private static voidsay(org.bukkit.command.CommandSender sender, org.bukkit.ChatColor colour, String key, Object... values) private static voidvoidstatus(org.bukkit.command.CommandSender sender) Methods inherited from class com.ultikits.ultitools.abstracts.command.BaseCommandExecutor
addValidator, buildMethodParams, createDefaultValidatorChain, executeCommand, getHelpCommand, getMappings, matchMethod, onCommand, onTabComplete, parseParameters, parseParameterValue, removeValidator, suggest, validateParameterCount
-
Field Details
-
UNLINKING_KEY
- See Also:
-
REVOKED_KEY
- See Also:
-
LINK_AGAIN_KEY
- See Also:
-
REVOKE_FAILED_KEY
- See Also:
-
REVOKE_IN_PANEL_KEY
- See Also:
-
CANCELLED_KEY
- See Also:
-
NOT_LINKED_KEY
- See Also:
-
STOPPED_KEY
- See Also:
-
RECONNECT_STARTED_KEY
- See Also:
-
RECONNECT_STATUS_KEY
- See Also:
-
ALREADY_CONNECTED_KEY
- See Also:
-
ALREADY_CONNECTING_KEY
- See Also:
-
UPGRADE_REQUIRED_KEY
- See Also:
-
RECONNECT_NOT_LINKED_KEY
- See Also:
-
RECONNECT_RATE_LIMITED_KEY
- See Also:
-
RECONNECT_SERVER_ID_MISMATCH_KEY
Said when/ulticloud reconnectfinds the connection stopped by a server-ID mismatch (contract answer 21): the server is still linked, but only a restart or a new login leaves that state.- See Also:
-
-
Constructor Details
-
CloudLoginCommand
public CloudLoginCommand()
-
-
Method Details
-
login
public void login(org.bukkit.command.CommandSender sender) Starts the device login. Deliberately not@RunAsync(#740): since 6.3.0 a synchronous body on the primary thread runs inside the dispatch (BaseCommandExecutor, #541), so the first line reaches the sender before the dispatch returns -- the moment RCON sends its reply. The network work runs on the login session's own executor (insideCloudAuthManager.login(CloudAuthManager.DeviceLoginListener)), so this body never blocks the server thread.- Parameters:
sender- the console, RCON, or another console-class sender
-
logout
public void logout(org.bukkit.command.CommandSender sender) -
refusePanelAuthentication
private static boolean refusePanelAuthentication(org.bukkit.command.CommandSender sender) Backstop for synchronous aliases and nested panel commands. The dispatcher refuses direct forms with command_blocked; here the console-only refusal is normal command output. Player eligibility remains the existing command validator's responsibility. -
status
public void status(org.bukkit.command.CommandSender sender) -
reconnect
public void reconnect(org.bukkit.command.CommandSender sender) -
handleHelp
protected void handleHelp(org.bukkit.command.CommandSender sender) Description copied from class:BaseCommandExecutorHandles the help command. Override to provide custom help.- Specified by:
handleHelpin classBaseCommandExecutor- Parameters:
sender- the command sender
-
isRemoteSender
private static boolean isRemoteSender(org.bukkit.command.CommandSender sender) - Returns:
truefor RCON -- checked explicitly, becauseRemoteConsoleCommandSenderis not aConsoleCommandSender-- and for any other sender that is neither the console nor a player
-
say
-
sendLine
-