删除道具脚本2

master
duhui 2023-02-13 10:49:38 +08:00
parent 112dfb738a
commit d289b1e594
1 changed files with 8 additions and 1 deletions

View File

@ -338,9 +338,13 @@ public class GmController {
HashMap<String, HashMap<String, Long>> value = entry1.getValue();
for (Map.Entry<String, HashMap<String, Long>> entry2 : value.entrySet()) {
String item = getRemoveReward(entry2.getValue());
if (item == null){
LOGGER.info("删除道具,无可删除道具:{}",entry2.getValue());
continue;
}
String cmd = "general removeitem "+entry2.getKey()+" "+item;
LOGGER.info("删除道具,命令:{}",cmd);
// RPCClient.sendCmd(Integer.parseInt(entry1.getKey()), cmd);
RPCClient.sendCmd(Integer.parseInt(entry1.getKey()), cmd);
LOGGER.info("删除道具,完成");
}
}
@ -358,6 +362,9 @@ public class GmController {
}
buffer.append(entry.getKey()).append("#").append(entry.getValue()).append("|");
}
if (buffer.length() <= 0){
return null;
}
return buffer.substring(0,buffer.length()-1);
}