Finalising position protection.
This commit is contained in:
parent
1b0b72afa1
commit
8405680f42
|
@ -1,5 +1,6 @@
|
||||||
package org.samo_lego.simpleauth;
|
package org.samo_lego.simpleauth;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import net.fabricmc.api.DedicatedServerModInitializer;
|
import net.fabricmc.api.DedicatedServerModInitializer;
|
||||||
import net.fabricmc.fabric.api.event.player.*;
|
import net.fabricmc.fabric.api.event.player.*;
|
||||||
import net.fabricmc.fabric.api.event.server.ServerStopCallback;
|
import net.fabricmc.fabric.api.event.server.ServerStopCallback;
|
||||||
|
@ -13,6 +14,7 @@ import net.minecraft.text.Text;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.iq80.leveldb.WriteBatch;
|
||||||
import org.samo_lego.simpleauth.commands.*;
|
import org.samo_lego.simpleauth.commands.*;
|
||||||
import org.samo_lego.simpleauth.event.AuthEventHandler;
|
import org.samo_lego.simpleauth.event.AuthEventHandler;
|
||||||
import org.samo_lego.simpleauth.event.entity.player.*;
|
import org.samo_lego.simpleauth.event.entity.player.*;
|
||||||
|
@ -23,10 +25,12 @@ import org.samo_lego.simpleauth.storage.PlayerCache;
|
||||||
import org.samo_lego.simpleauth.storage.SimpleAuthDatabase;
|
import org.samo_lego.simpleauth.storage.SimpleAuthDatabase;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
import static org.iq80.leveldb.impl.Iq80DBFactory.bytes;
|
||||||
import static org.samo_lego.simpleauth.utils.CarpetHelper.isPlayerCarpetFake;
|
import static org.samo_lego.simpleauth.utils.CarpetHelper.isPlayerCarpetFake;
|
||||||
import static org.samo_lego.simpleauth.utils.UuidConverter.convertUuid;
|
import static org.samo_lego.simpleauth.utils.UuidConverter.convertUuid;
|
||||||
|
|
||||||
|
@ -98,6 +102,32 @@ public class SimpleAuth implements DedicatedServerModInitializer {
|
||||||
|
|
||||||
private static void onStopServer() {
|
private static void onStopServer() {
|
||||||
LOGGER.info("[SimpleAuth] Shutting down SimpleAuth.");
|
LOGGER.info("[SimpleAuth] Shutting down SimpleAuth.");
|
||||||
|
|
||||||
|
WriteBatch batch = db.levelDBStore.createWriteBatch();
|
||||||
|
// Writing coords of de-authenticated players to database
|
||||||
|
deauthenticatedUsers.forEach((uuid, playerCache) -> {
|
||||||
|
JsonObject data = new JsonObject();
|
||||||
|
data.addProperty("password", playerCache.password);
|
||||||
|
|
||||||
|
JsonObject lastLocation = new JsonObject();
|
||||||
|
lastLocation.addProperty("dimId", playerCache.lastDimId);
|
||||||
|
lastLocation.addProperty("x", playerCache.lastX);
|
||||||
|
lastLocation.addProperty("y", playerCache.lastY);
|
||||||
|
lastLocation.addProperty("z", playerCache.lastZ);
|
||||||
|
|
||||||
|
data.addProperty("lastLocation", lastLocation.toString());
|
||||||
|
|
||||||
|
batch.put(bytes("UUID:" + uuid), bytes("data:" + data.toString()));
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
// Writing and closing batch
|
||||||
|
db.levelDBStore.write(batch);
|
||||||
|
batch.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
LOGGER.error("[SimpleAuth] Error saving player data! " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Closing DB connection
|
||||||
db.close();
|
db.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +161,7 @@ public class SimpleAuth implements DedicatedServerModInitializer {
|
||||||
// Marking player as not authenticated, (re)setting login tries to zero
|
// Marking player as not authenticated, (re)setting login tries to zero
|
||||||
String uuid = convertUuid(player);
|
String uuid = convertUuid(player);
|
||||||
SimpleAuth.deauthenticatedUsers.put(uuid, new PlayerCache(uuid, player));
|
SimpleAuth.deauthenticatedUsers.put(uuid, new PlayerCache(uuid, player));
|
||||||
|
|
||||||
// Teleporting player to spawn to hide its position
|
// Teleporting player to spawn to hide its position
|
||||||
if(config.main.spawnOnJoin)
|
if(config.main.spawnOnJoin)
|
||||||
teleportPlayer(player, true);
|
teleportPlayer(player, true);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.samo_lego.simpleauth.commands;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
|
import net.minecraft.command.arguments.BlockPosArgumentType;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
|
@ -50,7 +51,6 @@ public class AuthCommand {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then(literal("setSpawn")
|
.then(literal("setSpawn")
|
||||||
.then(argument("here", word())
|
|
||||||
.executes( ctx -> setSpawn(
|
.executes( ctx -> setSpawn(
|
||||||
ctx.getSource(),
|
ctx.getSource(),
|
||||||
Objects.requireNonNull(ctx.getSource().getEntity()).dimension.getRawId(),
|
Objects.requireNonNull(ctx.getSource().getEntity()).dimension.getRawId(),
|
||||||
|
@ -58,23 +58,19 @@ public class AuthCommand {
|
||||||
ctx.getSource().getEntity().getY(),
|
ctx.getSource().getEntity().getY(),
|
||||||
ctx.getSource().getEntity().getZ()
|
ctx.getSource().getEntity().getZ()
|
||||||
))
|
))
|
||||||
)
|
.then(argument("dimension id", integer())
|
||||||
.then(argument("dimensionId", integer())
|
.then(argument("position", BlockPosArgumentType.blockPos())
|
||||||
.then(argument("x", integer())
|
.executes(ctx -> setSpawn(
|
||||||
.then(argument("y", integer())
|
|
||||||
.then(argument("z", integer())
|
|
||||||
.executes( ctx -> setSpawn(
|
|
||||||
ctx.getSource(),
|
ctx.getSource(),
|
||||||
getInteger(ctx, "dimensionId"),
|
getInteger(ctx, "dimension id"),
|
||||||
getInteger(ctx, "x"),
|
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getX(),
|
||||||
getInteger(ctx, "y"),
|
// +1 to not spawn player in ground
|
||||||
getInteger(ctx, "z")
|
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getY() + 1,
|
||||||
|
BlockPosArgumentType.getLoadedBlockPos(ctx, "position").getZ()
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
)
|
|
||||||
.then(literal("remove")
|
.then(literal("remove")
|
||||||
.then(argument("uuid", word())
|
.then(argument("uuid", word())
|
||||||
.executes( ctx -> removeAccount(
|
.executes( ctx -> removeAccount(
|
||||||
|
|
|
@ -75,14 +75,14 @@ public class AuthEventHandler {
|
||||||
// Player joining the server
|
// Player joining the server
|
||||||
public static void onPlayerJoin(ServerPlayerEntity player) {
|
public static void onPlayerJoin(ServerPlayerEntity player) {
|
||||||
// If player is fake auth is not needed
|
// If player is fake auth is not needed
|
||||||
if(isPlayerFake(player))
|
if (isPlayerFake(player))
|
||||||
return;
|
return;
|
||||||
// Checking if session is still valid
|
// Checking if session is still valid
|
||||||
String uuid = convertUuid(player);
|
String uuid = convertUuid(player);
|
||||||
PlayerCache playerCache = deauthenticatedUsers.getOrDefault(uuid, null);
|
PlayerCache playerCache = deauthenticatedUsers.getOrDefault(uuid, null);
|
||||||
|
|
||||||
|
if (playerCache != null) {
|
||||||
if (
|
if (
|
||||||
playerCache != null &&
|
|
||||||
playerCache.wasAuthenticated &&
|
playerCache.wasAuthenticated &&
|
||||||
playerCache.validUntil >= System.currentTimeMillis() &&
|
playerCache.validUntil >= System.currentTimeMillis() &&
|
||||||
playerCache.lastIp.equals(player.getIp())
|
playerCache.lastIp.equals(player.getIp())
|
||||||
|
@ -90,8 +90,15 @@ public class AuthEventHandler {
|
||||||
deauthenticatedUsers.remove(uuid); // Makes player authenticated
|
deauthenticatedUsers.remove(uuid); // Makes player authenticated
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Invalidating session
|
||||||
|
playerCache.wasAuthenticated = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
deauthenticatePlayer(player);
|
deauthenticatePlayer(player);
|
||||||
|
|
||||||
|
if(config.main.spawnOnJoin)
|
||||||
|
teleportPlayer(player, true);
|
||||||
|
|
||||||
// Tries to rescue player from nether portal
|
// Tries to rescue player from nether portal
|
||||||
if(config.main.tryPortalRescue && player.getBlockState().getBlock().equals(Blocks.NETHER_PORTAL)) {
|
if(config.main.tryPortalRescue && player.getBlockState().getBlock().equals(Blocks.NETHER_PORTAL)) {
|
||||||
boolean wasSuccessful = false;
|
boolean wasSuccessful = false;
|
||||||
|
@ -174,6 +181,7 @@ public class AuthEventHandler {
|
||||||
PlayerCache playerCache = deauthenticatedUsers.get(convertUuid(player));
|
PlayerCache playerCache = deauthenticatedUsers.get(convertUuid(player));
|
||||||
if(playerCache == null)
|
if(playerCache == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
playerCache.wasAuthenticated = true;
|
playerCache.wasAuthenticated = true;
|
||||||
// Setting the session expire time
|
// Setting the session expire time
|
||||||
playerCache.validUntil = System.currentTimeMillis() + config.main.sessionTimeoutTime * 1000;
|
playerCache.validUntil = System.currentTimeMillis() + config.main.sessionTimeoutTime * 1000;
|
||||||
|
|
|
@ -6,13 +6,10 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.text.Text;
|
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
|
||||||
import org.samo_lego.simpleauth.event.entity.player.ChatCallback;
|
import org.samo_lego.simpleauth.event.entity.player.ChatCallback;
|
||||||
import org.samo_lego.simpleauth.event.entity.player.PlayerMoveCallback;
|
import org.samo_lego.simpleauth.event.entity.player.PlayerMoveCallback;
|
||||||
import org.samo_lego.simpleauth.event.item.TakeItemCallback;
|
import org.samo_lego.simpleauth.event.item.TakeItemCallback;
|
||||||
import org.samo_lego.simpleauth.storage.PlayerCache;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
@ -21,9 +18,6 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import static net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action.SWAP_HELD_ITEMS;
|
import static net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket.Action.SWAP_HELD_ITEMS;
|
||||||
import static org.samo_lego.simpleauth.SimpleAuth.config;
|
|
||||||
import static org.samo_lego.simpleauth.SimpleAuth.deauthenticatedUsers;
|
|
||||||
import static org.samo_lego.simpleauth.utils.UuidConverter.convertUuid;
|
|
||||||
|
|
||||||
@Mixin(ServerPlayNetworkHandler.class)
|
@Mixin(ServerPlayNetworkHandler.class)
|
||||||
public abstract class MixinServerPlayNetworkHandler {
|
public abstract class MixinServerPlayNetworkHandler {
|
||||||
|
@ -86,48 +80,4 @@ public abstract class MixinServerPlayNetworkHandler {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(
|
|
||||||
method="disconnect(Lnet/minecraft/text/Text;)V",
|
|
||||||
at = @At(value = "HEAD"),
|
|
||||||
cancellable = true
|
|
||||||
)
|
|
||||||
// If player is disconnected because of sth (e.g. wrong password)
|
|
||||||
// its position is set back to previous (e.g. not spawn)
|
|
||||||
private void disconnect(Text reason, CallbackInfo ci) {
|
|
||||||
if(config.main.spawnOnJoin) {
|
|
||||||
PlayerCache cache = deauthenticatedUsers.get(convertUuid(player));
|
|
||||||
// Puts player to last cached position
|
|
||||||
this.player.teleport(
|
|
||||||
this.server.getWorld(DimensionType.byRawId(cache.lastDimId)),
|
|
||||||
cache.lastX,
|
|
||||||
cache.lastY,
|
|
||||||
cache.lastZ,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(
|
|
||||||
method="onDisconnected(Lnet/minecraft/text/Text;)V",
|
|
||||||
at = @At(value = "HEAD"),
|
|
||||||
cancellable = true
|
|
||||||
)
|
|
||||||
// If player is disconnected because of sth (e.g. wrong password)
|
|
||||||
// its position is set back to previous (e.g. not spawn)
|
|
||||||
private void onDisconnected(Text reason, CallbackInfo ci) {
|
|
||||||
if(config.main.spawnOnJoin) {
|
|
||||||
PlayerCache cache = deauthenticatedUsers.get(convertUuid(player));
|
|
||||||
// Puts player to last cached position
|
|
||||||
this.player.teleport(
|
|
||||||
this.server.getWorld(DimensionType.byRawId(cache.lastDimId)),
|
|
||||||
cache.lastX,
|
|
||||||
cache.lastY,
|
|
||||||
cache.lastZ,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class AuthConfig {
|
||||||
public double x;
|
public double x;
|
||||||
public double y;
|
public double y;
|
||||||
public double z;
|
public double z;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
public static class LangConfig {
|
public static class LangConfig {
|
||||||
public String enterPassword = "§6You need to enter your password!";
|
public String enterPassword = "§6You need to enter your password!";
|
||||||
|
@ -91,7 +91,7 @@ public class AuthConfig {
|
||||||
public String minPasswordChars = "§6Password needs to be at least %d characters long!";
|
public String minPasswordChars = "§6Password needs to be at least %d characters long!";
|
||||||
public String disallowedUsername = "§6Invalid username characters! Allowed character regex: %s";
|
public String disallowedUsername = "§6Invalid username characters! Allowed character regex: %s";
|
||||||
public String playerAlreadyOnline = "§cPlayer %s is already online!";
|
public String playerAlreadyOnline = "§cPlayer %s is already online!";
|
||||||
public String worldSpawnSet = "";
|
public String worldSpawnSet = "§aSpawn for logging in was set successfully.";
|
||||||
}
|
}
|
||||||
public static class ExperimentalConfig {
|
public static class ExperimentalConfig {
|
||||||
// Prevents player being kicked because another player with the same name has joined the server
|
// Prevents player being kicked because another player with the same name has joined the server
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package org.samo_lego.simpleauth.storage;
|
package org.samo_lego.simpleauth.storage;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
|
||||||
import static org.samo_lego.simpleauth.SimpleAuth.config;
|
import static org.samo_lego.simpleauth.SimpleAuth.config;
|
||||||
|
@ -20,12 +22,13 @@ public class PlayerCache {
|
||||||
public double lastY;
|
public double lastY;
|
||||||
public double lastZ;
|
public double lastZ;
|
||||||
|
|
||||||
private static final JsonParser parser = new JsonParser();
|
private static final Gson gson = new Gson();
|
||||||
|
|
||||||
|
|
||||||
public PlayerCache(String uuid, ServerPlayerEntity player) {
|
public PlayerCache(String uuid, ServerPlayerEntity player) {
|
||||||
if(db.isClosed())
|
if(db.isClosed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(player != null) {
|
if(player != null) {
|
||||||
this.lastIp = player.getIp();
|
this.lastIp = player.getIp();
|
||||||
|
|
||||||
|
@ -45,18 +48,47 @@ public class PlayerCache {
|
||||||
this.lastZ = config.worldSpawn.z;
|
this.lastZ = config.worldSpawn.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.wasAuthenticated = false;
|
|
||||||
this.loginTries = 0;
|
|
||||||
|
|
||||||
|
|
||||||
if(db.isUserRegistered(uuid)) {
|
if(db.isUserRegistered(uuid)) {
|
||||||
this.isRegistered = true;
|
String data = db.getData(uuid);
|
||||||
JsonObject json = parser.parse(db.getData(uuid)).getAsJsonObject();
|
|
||||||
|
// Getting (hashed) password
|
||||||
|
JsonObject json = gson.fromJson(data, JsonObject.class);
|
||||||
this.password = json.get("password").getAsString();
|
this.password = json.get("password").getAsString();
|
||||||
|
|
||||||
|
// If coordinates are same as the one from world spawn
|
||||||
|
// we should check the DB for saved coords
|
||||||
|
if(config.main.spawnOnJoin) {
|
||||||
|
try {
|
||||||
|
JsonElement lastLoc = json.get("lastLocation");
|
||||||
|
if (
|
||||||
|
lastLoc != null &&
|
||||||
|
this.lastDimId == config.worldSpawn.dimensionId &&
|
||||||
|
this.lastX == config.worldSpawn.x &&
|
||||||
|
this.lastY == config.worldSpawn.y &&
|
||||||
|
this.lastZ == config.worldSpawn.z
|
||||||
|
) {
|
||||||
|
// Getting DB coords
|
||||||
|
JsonObject lastLocation = gson.fromJson(lastLoc.getAsString(), JsonObject.class);
|
||||||
|
this.lastDimId = lastLocation.get("dimId").getAsInt();
|
||||||
|
this.lastX = lastLocation.get("x").getAsDouble();
|
||||||
|
this.lastY = lastLocation.get("y").getAsDouble();
|
||||||
|
this.lastZ = lastLocation.get("z").getAsDouble();
|
||||||
|
|
||||||
|
// Removing location data from DB
|
||||||
|
json.remove("lastLocation");
|
||||||
|
db.updateUserData(uuid, json.toString());
|
||||||
|
}
|
||||||
|
} catch (JsonSyntaxException ignored) {
|
||||||
|
// Player didn't have any coords in db to tp to
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.isRegistered = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.isRegistered = false;
|
this.isRegistered = false;
|
||||||
this.password = "";
|
this.password = "";
|
||||||
}
|
}
|
||||||
|
this.wasAuthenticated = false;
|
||||||
|
this.loginTries = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import static org.iq80.leveldb.impl.Iq80DBFactory.factory;
|
||||||
|
|
||||||
public class SimpleAuthDatabase {
|
public class SimpleAuthDatabase {
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
private DB levelDBStore;
|
public DB levelDBStore;
|
||||||
|
|
||||||
// Connects to the DB
|
// Connects to the DB
|
||||||
public void openConnection() {
|
public void openConnection() {
|
||||||
|
@ -81,7 +81,7 @@ public class SimpleAuthDatabase {
|
||||||
// Updates the password of the user
|
// Updates the password of the user
|
||||||
public void updateUserData(String uuid, String data) {
|
public void updateUserData(String uuid, String data) {
|
||||||
try {
|
try {
|
||||||
levelDBStore.put(bytes("UUID:" + uuid),bytes("data:" + data));
|
levelDBStore.put(bytes("UUID:" + uuid), bytes("data:" + data));
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
LOGGER.error("[SimpleAuth] " + e.getMessage());
|
LOGGER.error("[SimpleAuth] " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ public class SimpleAuthDatabase {
|
||||||
// Gets the hashed password from DB
|
// Gets the hashed password from DB
|
||||||
public String getData(String uuid){
|
public String getData(String uuid){
|
||||||
try {
|
try {
|
||||||
if(this.isUserRegistered(uuid)) // Gets password from db and removes "password:" prefix from it
|
if(this.isUserRegistered(uuid)) // Gets password from db and removes "data:" prefix from it
|
||||||
return new String(levelDBStore.get(bytes("UUID:" + uuid))).substring(5);
|
return new String(levelDBStore.get(bytes("UUID:" + uuid))).substring(5);
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
LOGGER.error("[SimpleAuth] Error getting password: " + e.getMessage());
|
LOGGER.error("[SimpleAuth] Error getting password: " + e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue