geforkt von SteamWar/BungeeCore
Fix CheckCommand
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
d6961419e6
Commit
d31f3a31d1
@ -239,7 +239,7 @@ public class CheckCommand extends BasicCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArenaMode mode = ArenaMode.getBySchemType(schematic.getSchemtype());
|
ArenaMode mode = ArenaMode.getBySchemType(schematic.getSchemtype().fightType());
|
||||||
SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getId(), 0);
|
SubserverSystem.startTestServer(checker, mode, FightCommand.getMap(checker, mode, "Random"), schematic.getId(), 0);
|
||||||
currentCheckers.put(checker.getUniqueId(), this);
|
currentCheckers.put(checker.getUniqueId(), this);
|
||||||
currentSchems.put(schematic.getId(), this);
|
currentSchems.put(schematic.getId(), this);
|
||||||
|
@ -32,7 +32,6 @@ import java.util.function.Predicate;
|
|||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
|
||||||
public class SchematicNode {
|
public class SchematicNode {
|
||||||
|
|
||||||
private static final Statement createNode = new Statement("INSERT INTO SchematicNode (NodeName, NodeOwner, ParentNode, NodeType, NodeItem) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE NodeName = VALUES(NodeName), ParentNode = VALUES(ParentNode), NodeItem = VALUES(NodeItem), NodeType = VALUES(NodeType), NodeItem = VALUES(NodeItem)");
|
private static final Statement createNode = new Statement("INSERT INTO SchematicNode (NodeName, NodeOwner, ParentNode, NodeType, NodeItem) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE NodeName = VALUES(NodeName), ParentNode = VALUES(ParentNode), NodeItem = VALUES(NodeItem), NodeType = VALUES(NodeType), NodeItem = VALUES(NodeItem)");
|
||||||
private static final Statement getSchematicNode_Null = new Statement("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank, NodeFormat, LastUpdate FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode is NULL");
|
private static final Statement getSchematicNode_Null = new Statement("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank, NodeFormat, LastUpdate FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode is NULL");
|
||||||
private static final Statement getSchematicNode = new Statement("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank, NodeFormat, LastUpdate FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode = ?");
|
private static final Statement getSchematicNode = new Statement("SELECT NodeId, NodeName, NodeOwner, ParentNode, NodeType, NodeItem, NodeRank, NodeFormat, LastUpdate FROM SchematicNode WHERE NodeOwner = ? AND NodeName = ? AND ParentNode = ?");
|
||||||
@ -69,7 +68,7 @@ public class SchematicNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SchematicNode createSchematicNode(int owner, String name, Integer parent, String type, String item) {
|
public static SchematicNode createSchematicNode(int owner, String name, Integer parent, String type, String item) {
|
||||||
if (parent == 0)
|
if (parent != null && parent == 0)
|
||||||
parent = null;
|
parent = null;
|
||||||
createNode.update(name, owner, parent, type, item);
|
createNode.update(name, owner, parent, type, item);
|
||||||
return getSchematicNode(owner, name, parent);
|
return getSchematicNode(owner, name, parent);
|
||||||
@ -86,6 +85,9 @@ public class SchematicNode {
|
|||||||
owner = set.getInt("NodeOwner");
|
owner = set.getInt("NodeOwner");
|
||||||
name = set.getString("NodeName");
|
name = set.getString("NodeName");
|
||||||
parent = set.getInt("ParentNode");
|
parent = set.getInt("ParentNode");
|
||||||
|
if(set.wasNull()) {
|
||||||
|
parent = null;
|
||||||
|
}
|
||||||
item = set.getString("NodeItem");
|
item = set.getString("NodeItem");
|
||||||
type = set.getString("NodeType");
|
type = set.getString("NodeType");
|
||||||
lastUpdate = set.getTimestamp("LastUpdate");
|
lastUpdate = set.getTimestamp("LastUpdate");
|
||||||
@ -409,6 +411,7 @@ public class SchematicNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SchematicNode getParentNode() {
|
public SchematicNode getParentNode() {
|
||||||
|
if(parent == null) return null;
|
||||||
return SchematicNode.getSchematicNode(parent);
|
return SchematicNode.getSchematicNode(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,6 +452,13 @@ public class SchematicNode {
|
|||||||
this.brCache.clear();
|
this.brCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void delete() {
|
||||||
|
if (isDir()) {
|
||||||
|
getSchematicNodeInNode(getId()).forEach(SchematicNode::delete);
|
||||||
|
}
|
||||||
|
deleteNode.update(id);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (!(obj instanceof SchematicNode))
|
if (!(obj instanceof SchematicNode))
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren