Compare commits
No commits in common. "dda73e3cccff2a2027e505c0f3c277c5a5a1e961" and "1ff00557bb2621debdfc7632958cd3db00f4f090" have entirely different histories.
dda73e3ccc
...
1ff00557bb
3 changed files with 1 additions and 73 deletions
|
@ -195,44 +195,4 @@ public class TPAudioCMD extends BaseCommand {
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "Playback stopped!");
|
sender.sendMessage(ChatColor.GRAY + "Playback stopped!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subcommand("stopchannel")
|
|
||||||
@Description("")
|
|
||||||
public void onStopChannel(CommandSender sender, String selector, AudioType type) {
|
|
||||||
List<Player> players = new ArrayList<>();
|
|
||||||
Player target = Bukkit.getPlayer(selector);
|
|
||||||
if (target != null) {
|
|
||||||
if (!PinManager.hasPin(target.getUniqueId())) {
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "The player is not connected to the client.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
players.add(target);
|
|
||||||
} else {
|
|
||||||
SpigotPlayerSelector sel = new SpigotPlayerSelector(selector);
|
|
||||||
|
|
||||||
if (sel.getArgument("region").length() != 0) {
|
|
||||||
if (!ThemeParkAudio.isRegionSupport()) {
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "Region support is not available.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String regionID = sel.getArgument("region");
|
|
||||||
new PlayInRegionHandler(regionID, "", sel.getPlayers(sender).stream().map(Entity::getUniqueId).collect(Collectors.toList()));
|
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "Playback stopped in region " + regionID + "!");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
players.addAll(sel.getPlayers(sender));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == AudioType.RADIO && !ThemeParkAudio.getInstance().getConfig().getBoolean("radio")) {
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "The radio is disabled, so it can't be played on.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AudioMessage.of(type, "").broadcastSelection(players, PinManager::hasPin);
|
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.GRAY + "Playback stopped!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
package tech.sbdevelopment.themeparkaudio.socket.messages;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
|
|
||||||
import java.time.ZonedDateTime;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
public class ActionFotoMessage extends AbstractMessage {
|
|
||||||
private final String attractionId;
|
|
||||||
private final String image;
|
|
||||||
private final ZonedDateTime timestamp = ZonedDateTime.now();
|
|
||||||
|
|
||||||
protected ActionFotoMessage(String attractionId, String image) {
|
|
||||||
super(MessageTask.ACTIONFOTO);
|
|
||||||
this.attractionId = attractionId;
|
|
||||||
this.image = image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ActionFotoMessage of(String attractionId, String image) {
|
|
||||||
return new ActionFotoMessage(attractionId, image);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JSONObject extendJson() {
|
|
||||||
JSONObject data = new JSONObject();
|
|
||||||
data.put("attractionId", attractionId);
|
|
||||||
data.put("image", image);
|
|
||||||
data.put("timestamp", timestamp.toInstant().toString());
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
package tech.sbdevelopment.themeparkaudio.socket.messages;
|
package tech.sbdevelopment.themeparkaudio.socket.messages;
|
||||||
|
|
||||||
public enum MessageTask {
|
public enum MessageTask {
|
||||||
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP, ACTIONFOTO
|
AUTHENTICATION, LOGOUT, LIGHT, MUSIC, SFX, RADIO, PING, STOP
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue