compressed data tree cleanup, streamlining
This commit is contained in:
parent
f76d3c8b89
commit
b52053f5ea
50 changed files with 560 additions and 598 deletions
|
@ -80,7 +80,6 @@ import common.packet.SPacketSkin;
|
|||
import common.packet.SPacketTimeUpdate;
|
||||
import common.packet.SPacketWorld;
|
||||
import common.potion.PotionEffect;
|
||||
import common.tags.TagLoader;
|
||||
import common.tags.TagObject;
|
||||
import common.util.BlockPos;
|
||||
import common.util.EncryptUtil;
|
||||
|
@ -186,7 +185,7 @@ public final class Server implements IThreadListener {
|
|||
File nfile = new File("server.cdt.tmp");
|
||||
File lfile = new File("server.cdt");
|
||||
try {
|
||||
TagLoader.writeGZip(data, nfile);
|
||||
TagObject.writeGZip(data, nfile);
|
||||
if(lfile.exists())
|
||||
lfile.delete();
|
||||
nfile.renameTo(lfile);
|
||||
|
@ -204,9 +203,9 @@ public final class Server implements IThreadListener {
|
|||
file = new File("server.cdt.tmp");
|
||||
if(file.exists()) {
|
||||
try {
|
||||
TagObject tag = TagLoader.readGZip(file);
|
||||
TagObject tag = TagObject.readGZip(file);
|
||||
TagObject cfg = tag.getObject("Config");
|
||||
for(String key : cfg.getKeySet()) {
|
||||
for(String key : cfg.keySet()) {
|
||||
Config.set(key, cfg.getString(key), false);
|
||||
}
|
||||
UniverseRegistry.fromTags(tag.getObject("Universe"));
|
||||
|
@ -297,7 +296,7 @@ public final class Server implements IThreadListener {
|
|||
File dat = new File(new File("players"), user + ".cdt");
|
||||
|
||||
if(dat.exists() && dat.isFile()) {
|
||||
tag = TagLoader.readGZip(dat);
|
||||
tag = TagObject.readGZip(dat);
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
@ -312,7 +311,7 @@ public final class Server implements IThreadListener {
|
|||
try {
|
||||
File tmp = new File(new File("players"), user + ".cdt.tmp");
|
||||
File dat = new File(new File("players"), user + ".cdt");
|
||||
TagLoader.writeGZip(tag, tmp);
|
||||
TagObject.writeGZip(tag, tmp);
|
||||
if(dat.exists()) {
|
||||
dat.delete();
|
||||
}
|
||||
|
@ -938,7 +937,7 @@ public final class Server implements IThreadListener {
|
|||
File dat = new File(new File("players"), user + ".cdt");
|
||||
|
||||
if(dat.exists() && dat.isFile()) {
|
||||
tag = TagLoader.readGZip(dat);
|
||||
tag = TagObject.readGZip(dat);
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
|
@ -963,7 +962,7 @@ public final class Server implements IThreadListener {
|
|||
conn.writeTags(tag);
|
||||
File tmp = new File(new File("players"), conn.getUser() + ".cdt.tmp");
|
||||
File dat = new File(new File("players"), conn.getUser() + ".cdt");
|
||||
TagLoader.writeGZip(tag, tmp);
|
||||
TagObject.writeGZip(tag, tmp);
|
||||
if(dat.exists()) {
|
||||
dat.delete();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue