Bump to 0.8-SNAPSHOT

This commit is contained in:
Telesphoreo 2022-03-03 19:51:07 -06:00
parent e258e27814
commit 14fb24a380
4 changed files with 13 additions and 16 deletions

View File

@ -38,7 +38,7 @@ dependencies {
} }
group = "dev.plex" group = "dev.plex"
version = "0.7-SNAPSHOT" version = "0.8-SNAPSHOT"
description = "Plex" description = "Plex"
shadowJar { shadowJar {

View File

@ -29,19 +29,19 @@ public class Admin
/** /**
* Returns if the admin has command spy or not * Returns if the admin has command spy or not
* <br> * <br>
* Contains a #isCommandSpy and #setCommandSpy by lombok * Contains a #isCommandSpy and #setCommandSpy by Lombok
*/ */
private boolean commandSpy = true; private boolean commandSpy = false;
/** /**
* Returns if the admin has staff chat toggled or not * Returns if the admin has admin chat toggled or not
* <br> * <br>
* Contains a #isStaffChat and #setStaffChat by lombok * Contains a #isAdminChat and #setAdminChat by Lombok
*/ */
private boolean staffChat = false; private boolean adminChat = false;
/** /**
* Creates an admin with the startig ADMIN rank * Creates an admin with the ADMIN rank as the default rank
* *
* @param uuid * @param uuid
* @see UUID * @see UUID
@ -52,6 +52,4 @@ public class Admin
this.uuid = uuid; this.uuid = uuid;
this.rank = Rank.ADMIN; this.rank = Rank.ADMIN;
} }
} }

View File

@ -5,6 +5,7 @@ import com.google.common.collect.Maps;
import dev.morphia.Datastore; import dev.morphia.Datastore;
import dev.morphia.query.Query; import dev.morphia.query.Query;
import dev.plex.Plex; import dev.plex.Plex;
import dev.plex.PlexBase;
import dev.plex.player.PlexPlayer; import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.storage.StorageType; import dev.plex.storage.StorageType;
@ -23,7 +24,7 @@ import java.util.stream.Collectors;
* @see Admin * @see Admin
*/ */
public class AdminList public class AdminList extends PlexBase
{ {
/** /**
* Key/Value storage, where the key is the unique ID of the admin * Key/Value storage, where the key is the unique ID of the admin
@ -59,15 +60,15 @@ public class AdminList
public List<String> getAllAdmins() public List<String> getAllAdmins()
{ {
List<String> admins = Lists.newArrayList(); List<String> admins = Lists.newArrayList();
if (Plex.get().getStorageType() == StorageType.MONGODB) if (plugin.getStorageType() == StorageType.MONGODB)
{ {
Datastore store = Plex.get().getMongoConnection().getDatastore(); Datastore store = plugin.getMongoConnection().getDatastore();
Query<PlexPlayer> query = store.find(PlexPlayer.class); Query<PlexPlayer> query = store.find(PlexPlayer.class);
admins.addAll(query.stream().filter(plexPlayer -> plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN)).map(PlexPlayer::getName).collect(Collectors.toList())); admins.addAll(query.stream().filter(plexPlayer -> plexPlayer.getRankFromString().isAtLeast(Rank.ADMIN)).map(PlexPlayer::getName).collect(Collectors.toList()));
} }
else else
{ {
try (Connection con = Plex.get().getSqlConnection().getCon()) try (Connection con = plugin.getSqlConnection().getCon())
{ {
PreparedStatement statement = con.prepareStatement("SELECT * FROM `players` WHERE rank IN(?, ?, ?)"); PreparedStatement statement = con.prepareStatement("SELECT * FROM `players` WHERE rank IN(?, ?, ?)");
statement.setString(1, Rank.ADMIN.name().toLowerCase()); statement.setString(1, Rank.ADMIN.name().toLowerCase());
@ -79,7 +80,6 @@ public class AdminList
{ {
admins.add(set.getString("name")); admins.add(set.getString("name"));
} }
} }
catch (SQLException throwables) catch (SQLException throwables)
{ {
@ -88,5 +88,4 @@ public class AdminList
} }
return admins; return admins;
} }
} }

View File

@ -26,7 +26,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY) @CommandPermissions(level = Rank.OP, source = RequiredCommandSource.ANY)
@CommandParameters(name = "admin", usage = "/<command> <add | remove | setrank | list> [player] [rank]", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins") @CommandParameters(name = "admin", usage = "/<command> <add <player> | remove <player> | setrank <player> <rank> | list>", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins")
public class AdminCMD extends PlexCommand public class AdminCMD extends PlexCommand
{ {
//TODO: Better return messages //TODO: Better return messages