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 Jul 24, 2024
1 parent 7a44b70 commit b416270
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,12 @@ private void rankCoinDonate(Queue<String> shopIds) {
}
}

private void openShop(String seatId, String userId, Queue<String> shopIds) {
String shopId = shopIds.peek();
private void openShop(String seatId, String userId, String shopId) {
String s = AntStallRpcCall.shopOpen(seatId, userId, shopId);
try {
JSONObject jo = new JSONObject(s);
if ("SUCCESS".equals(jo.getString("resultCode"))) {
if ("SUCCESS".equals(jo.optString("resultCode"))) {
Log.farm("蚂蚁新村⛪在[" + UserIdMap.getMaskName(userId) + "]家摆摊");
shopIds.poll();
}
} catch (Throwable t) {
Log.i(TAG, "openShop err:");
Expand All @@ -452,9 +450,11 @@ private void openShop(String seatId, String userId, Queue<String> shopIds) {

private void friendHomeOpen(List<Seat> seats, Queue<String> shopIds) {
Collections.sort(seats, (e1, e2) -> e2.hot - e1.hot);
int idx = 0;
while (seats.size() > idx && !shopIds.isEmpty()) {
Seat seat = seats.get(idx);
for (Seat seat : seats) {
String shopId = shopIds.poll();
if (shopId == null) {
return;
}
String userId = seat.userId;
try {
String s = AntStallRpcCall.friendHome(userId);
Expand All @@ -463,11 +463,11 @@ private void friendHomeOpen(List<Seat> seats, Queue<String> shopIds) {
JSONObject seatsMap = jo.getJSONObject("seatsMap");
JSONObject guest = seatsMap.getJSONObject("GUEST_01");
if (guest.getBoolean("canOpenShop")) {
openShop(guest.getString("seatId"), userId, shopIds);
openShop(guest.getString("seatId"), userId, shopId);
} else {
guest = seatsMap.getJSONObject("GUEST_02");
if (guest.getBoolean("canOpenShop")) {
openShop(guest.getString("seatId"), userId, shopIds);
openShop(guest.getString("seatId"), userId, shopId);
}
}
} else {
Expand All @@ -477,7 +477,6 @@ private void friendHomeOpen(List<Seat> seats, Queue<String> shopIds) {
} catch (Throwable t) {
Log.printStackTrace(TAG, t);
}
idx++;
}
}

Expand Down Expand Up @@ -1053,7 +1052,7 @@ public interface StallTicketType {
}

public interface StallThrowManureType {

int THROW = 0;
int DONT_THROW = 1;

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_html_viewer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent">

<tkaxv7s.xposed.sesame.ui.MyWebView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:id="@+id/mwv_webview" />

<ProgressBar
Expand Down

0 comments on commit b416270

Please sign in to comment.