修复:GlobalDataManager 部分语法错误
This commit is contained in:
parent
af29cbe4f0
commit
9585f1162d
@ -316,19 +316,34 @@ public class GlobalDataManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (String name : variables.keySet()) {
|
/**
|
||||||
// 获取数据
|
* 根据正序排列获取所有变量
|
||||||
HashMap<String, Object> value = Main.getConnection().getValueLast(Main.getTablePrefix() + "_plugindata", "name", name, "variable", "upgrade");
|
* 新的变量会覆盖旧的变量
|
||||||
|
*/
|
||||||
|
LinkedList<HashMap<String, Object>> list = Main.getConnection().getValues(Main.getTablePrefix() + "_plugindata", "id", -1, false, "name", "variable", "upgrade");
|
||||||
|
// 循环变量
|
||||||
|
for (HashMap<String, Object> value : list) {
|
||||||
|
Object name = value.get("name");
|
||||||
try {
|
try {
|
||||||
// 检查更新服务器的名称是与本服不同
|
// 如果变量存在
|
||||||
if (!value.get("upgrade").toString().equals(variables.get(name).getUpgradeUID())) {
|
if (variables.containsKey(name)) {
|
||||||
if (value.get("variable").toString().equals("null")) {
|
// 如果变量不是由本服更新
|
||||||
variables.remove(name);
|
if (!value.get("upgrade").equals(variables.get(name).getUpgradeUID())) {
|
||||||
}
|
// 如果变量是空
|
||||||
else {
|
if (value.get("variable").equals("null")) {
|
||||||
variables.get(name).setVariable(value.get("variable").toString());
|
// 删除变量
|
||||||
|
variables.remove(name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 更新变量
|
||||||
|
variables.get(name).setVariable(value.get("variable").toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 如果变量存在则下载到本地
|
||||||
|
else if (!value.get("variable").equals("null")) {
|
||||||
|
variables.put(value.get("name").toString(), new SQLVariable(value.get("name").toString(), value.get("variable").toString(), value.get("upgrade").toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
// ÒƳý
|
// ÒƳý
|
||||||
|
Loading…
Reference in New Issue
Block a user