split server

This commit is contained in:
Sen 2025-05-03 18:01:17 +02:00
parent b0dc368ef7
commit 3ab017888b
25 changed files with 458 additions and 482 deletions

View file

@ -36,14 +36,12 @@ import game.world.Converter.SaveVersion;
public class Region {
public static class FolderInfo {
public final long time;
public final String user;
public final long lastPlayed;
public final SaveVersion legacy;
public final String version;
public FolderInfo(long time, String user, long lastPlayed, SaveVersion legacy, String version) {
public FolderInfo(long time, long lastPlayed, SaveVersion legacy, String version) {
this.time = time;
this.user = user;
this.lastPlayed = lastPlayed;
this.legacy = legacy;
this.version = version;
@ -666,7 +664,7 @@ public class Region {
killed = true;
}
public static void saveWorldInfo(File worldDir, long time, String owner) {
public static void saveWorldInfo(File worldDir, long time) {
NBTTagCompound data = new NBTTagCompound();
data.setLong("Time", time);
data.setLong("LastAccess", System.currentTimeMillis());
@ -692,8 +690,6 @@ public class Region {
}
data.setTag("Config", cfg);
data.setTag("Universe", UniverseRegistry.saveNbt());
if(owner != null)
data.setString("Owner", owner);
if(worldDir != null)
worldDir.mkdirs();
File nfile = new File(worldDir, "level.nbt.tmp");
@ -731,12 +727,10 @@ public class Region {
UniverseRegistry.loadNbt(tag.getCompoundTag("Universe"));
// tag.getInteger("Version");
long lastPlayed = tag.getLong("LastAccess");
String user = tag.hasKey("Owner", 8) ? tag.getString("Owner") : null;
user = user != null && user.isEmpty() ? null : user;
String version = tag.hasKey("Version", 8) ? tag.getString("Version") : null;
version = version != null && version.isEmpty() ? null : version;
long time = tag.hasKey("Time", 4) ? tag.getLong("Time") : World.START_TIME;
return new FolderInfo(time, user, lastPlayed, null, version);
return new FolderInfo(time, lastPlayed, null, version);
}
catch(Exception e) {
Log.JNI.error(e, "Fehler beim Lesen von " + file);