This commit is contained in:
Moose1301 2022-10-28 22:50:23 -04:00
parent b9bf4c135a
commit b06fd84985
No known key found for this signature in database
GPG Key ID: 8B47DA69B2166FED
5 changed files with 18 additions and 6 deletions

View File

@ -142,7 +142,7 @@
<artifactId>mongo-jackson-codec</artifactId>
<version>3.2.0__0.4</version>
<scope>system</scope>
<systemPath>E:\SSD\GitHub\APIv3/lib/mongo-jackson-mapper-1.4.2.jar</systemPath>
<systemPath>C:\Users\angel\Documents\Code\Java\PlatinumMC\APIv3/lib/mongo-jackson-mapper-1.4.2.jar</systemPath>
</dependency>
<dependency>
<groupId>de.undercouch</groupId>
@ -159,7 +159,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<version>1.18.24</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -1,7 +1,19 @@
package net.frozenorb.apiv3.unsorted.actor;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
public enum ActorType {
WEBSITE, ANSIBLE, STORE, BUNGEE_CORD, SERVER, UNKNOWN
WEBSITE, ANSIBLE, STORE, BUNGEE_CORD(true), SERVER(true), UNKNOWN;
private boolean server;
ActorType() {
server = false;
}
ActorType(boolean server) {
this.server = server;
}
}

View File

@ -189,7 +189,7 @@ public final class GETDumpsType implements Handler<RoutingContext> {
if (customScope.equalsIgnoreCase("me")) {
Actor actor = ctx.get("actor");
if (actor.getType() != ActorType.SERVER) {
if (!actor.getType().isServer()) {
ErrorUtils.respondOther(ctx, 403, "This action can only be performed when requested by a server.", "serverOnly", ImmutableMap.of());
return;
}

View File

@ -36,7 +36,7 @@ public final class POSTServersHeartbeat implements Handler<RoutingContext> {
public void handle(RoutingContext ctx) {
Actor actor = ctx.get("actor");
if (actor.getType() != ActorType.SERVER) {
if (actor.getType().isServer()) {
ErrorUtils.respondOther(ctx, 403, "This action can only be performed when requested by a server.", "serverOnly", ImmutableMap.of());
return;
}

View File

@ -34,7 +34,7 @@ public final class POSTUsersIdLogin implements Handler<RoutingContext> {
String userIp = requestBody.getString("userIp");
Actor actor = ctx.get("actor");
if (actor.getType() != ActorType.SERVER) {
if (!actor.getType().isServer()) {
ErrorUtils.respondOther(ctx, 403, "This action can only be performed when requested by a server.", "serverOnly", ImmutableMap.of());
return;
}