Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
优化 部分逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
TKaxv-7S committed Jun 26, 2024
1 parent c4c201a commit 053c2b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ private static void receiveFarmTaskAward() {
if ("SUCCESS".equals(memo)) {
JSONObject signList = jo.getJSONObject("signList");
sign(signList);
Thread.sleep(2000);
JSONArray jaFarmTaskList = jo.getJSONArray("farmTaskList");
for (int i = 0; i < jaFarmTaskList.length(); i++) {
jo = jaFarmTaskList.getJSONObject(i);
Expand All @@ -825,10 +826,11 @@ private static void receiveFarmTaskAward() {
int awardCount = jo.getInt("awardCount");
if (awardCount + foodStock > foodStockLimit) {
unreceiveTaskAward++;
Log.record("领取" + awardCount + "克饲料后将超过[" + foodStockLimit + "克]上限,已终止领取");
break;
Log.record("领取" + awardCount + "克饲料后将超过[" + foodStockLimit + "克]上限,终止领取");
return;
}
s = AntFarmRpcCall.receiveFarmTaskAward(jo.getString("taskId"));
Thread.sleep(5000);
jo = new JSONObject(s);
memo = jo.getString("memo");
if ("SUCCESS".equals(memo)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ private JSONObject collectUserEnergy(String userId) {
boolean isCollectEnergy = collectEnergy.getValue() && !dontCollectMap.containsKey(userId);

if (isSelf) {
if ("CAN_PLAY".equals(userHomeObject.optString("whackMoleStatus"))) {
String whackMoleStatus = userHomeObject.optString("whackMoleStatus");
if ("CAN_PLAY".equals(whackMoleStatus) || "CAN_INITIATIVE_PLAY".equals(whackMoleStatus) || "NEED_MORE_FRIENDS".equals(whackMoleStatus)) {
whackMole();
}
updateDoubleTime(userHomeObject);
Expand Down Expand Up @@ -459,10 +460,6 @@ private JSONObject collectUserEnergy(String userId) {

if (!TaskCommon.IS_ENERGY_TIME) {
if (isSelf) {
String whackMoleStatus = userHomeObject.optString("whackMoleStatus");
if ("CAN_INITIATIVE_PLAY".equals(whackMoleStatus) || "NEED_MORE_FRIENDS".equals(whackMoleStatus)) {
whackMole();
}
if (totalCertCount.getValue()) {
JSONObject userBaseInfo = userHomeObject.getJSONObject("userBaseInfo");
int totalCertCount = userBaseInfo.optInt("totalCertCount", 0);
Expand Down Expand Up @@ -891,7 +888,7 @@ private void collectUserBatchEnergy(String userId, final List<Long> bubbleIdList
String resultCode = jo.getString("resultCode");
if (!"SUCCESS".equalsIgnoreCase(resultCode)) {
if ("PARAM_ILLEGAL2".equals(resultCode)) {
Log.record("[" + UserIdMap.getNameById(userId) + "]" + "能量已被收取,取消重试 错误信息:" + jo.getString("resultDesc"));
Log.record("[" + UserIdMap.getNameById(userId) + "]" + "能量已被收取,取消重试 错误:" + jo.getString("resultDesc"));
return;
}
Log.record("[" + UserIdMap.getNameById(userId) + "]" + jo.getString("resultDesc"));
Expand Down

0 comments on commit 053c2b4

Please sign in to comment.