Skip to content

Commit

Permalink
chore: oobe register
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Aug 14, 2022
1 parent 6c9e453 commit 80be8d3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public static void askUserToLogin(CommandSender sender) {
sender.sendMessage(""+ChatColor.GREEN+"[Minehub] "+ChatColor.RESET+"Minehub ServerAgent가 로그인 되어있지 않습니다.");
sender.sendMessage(""+ChatColor.LIGHT_PURPLE + "/minehub "+ChatColor.AQUA+"login "+ChatColor.RESET+"명령어를 실행 해 로그인하세요.");
}

public static void askUserToRegister(CommandSender sender) {
sender.sendMessage(""+ChatColor.GREEN+"[Minehub] "+ChatColor.RESET+"이 서버가 Minehub RSM 시스템에 등록되어있지 않습니다.");
sender.sendMessage(""+ChatColor.LIGHT_PURPLE + "/minehub "+ChatColor.AQUA+"register "+ChatColor.RESET+"명령어를 실행 해 등록하세요.");
}
}
12 changes: 10 additions & 2 deletions src/main/java/kr/minehub/servers/agent/core/BukkitEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ public class BukkitEvent implements Listener {
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if (player.isOp()) {
if (!Main.core.authorization.isAuthorized()) {
OOBELogin.requestUserLogin(player);
AgentCore core = Main.core;
if (core != null) {
if (!core.authorization.isAuthorized()) {
OOBELogin.requestUserLogin(player);
} else {
if (core.server == null || !core.server.isRegistered()) {
OOBELogin.askUserToRegister(player);
}
}
}

}
}

Expand Down
17 changes: 16 additions & 1 deletion src/main/java/kr/minehub/servers/agent/flows/OOBELogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,27 @@ public static void askUserToLogin(CommandSender sender) {
TextComponent message = new TextComponent();

TextComponent link = new TextComponent(ChatColor.LIGHT_PURPLE+"/minehub "+ChatColor.AQUA+"login");
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("클릭하여 Stella IT Accounts 로 로그인 하세요.")));
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("클릭하여 Stella IT Accounts 로 로그인 합니다.")));
link.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/minehub login"));

message.addExtra(link);
message.addExtra(ChatColor.RESET + " 명령어를 실행하거나 클릭 해 로그인 하세요.");

sender.spigot().sendMessage(message);
}

public static void askUserToRegister(CommandSender sender) {
sender.sendMessage(""+ChatColor.GREEN+"[Minehub] "+ChatColor.RESET+"이 서버가 Minehub RSM 시스템에 등록되어있지 않습니다.");

TextComponent message = new TextComponent();

TextComponent link = new TextComponent(ChatColor.LIGHT_PURPLE+"/minehub "+ChatColor.AQUA+"register");
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("클릭하여 이 서버를 등록합니다.")));
link.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/minehub register"));

message.addExtra(link);
message.addExtra(ChatColor.RESET + " 명령어를 실행하거나 클릭 해 로그인 하세요.");

sender.spigot().sendMessage(message);
}
}

0 comments on commit 80be8d3

Please sign in to comment.