Skip to content

Commit

Permalink
fix poco not id bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aoliaoaoaojiao committed Jul 1, 2023
1 parent 32d0255 commit 1245583
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ public String sendAndReceive(JSONObject jsonObject) throws SonicRespException {
rData.flip();
String pocoResult = new String(rData.array(), StandardCharsets.UTF_8);
int subStartIndex = pocoResult.indexOf("\"result\"");

String pocoPrefix = pocoResult.substring(0, subStartIndex) + "}";

if (PocoTool.checkPocoRpcResultID(pocoPrefix, jsonObject.getString("id"))) {
// when cocos is integrated there will be no id
// String pocoPrefix = pocoResult.substring(0, subStartIndex) + "}";
// if (PocoTool.checkPocoRpcResultID(pocoPrefix, jsonObject.getString("id"))) {
return "{" + pocoResult.substring(subStartIndex);
} else {
throw new SonicRespException("id not found!");
}
// } else {
// throw new SonicRespException("id not found!");
// }
}
}
} catch (Exception e) {
Expand Down

0 comments on commit 1245583

Please sign in to comment.