Skip to content

Commit

Permalink
Merge pull request #94 from aoliaoaoaojiao/master
Browse files Browse the repository at this point in the history
fix poco not id bug
  • Loading branch information
ZhouYixun authored Jul 1, 2023
2 parents 32d0255 + 1245583 commit 3839bff
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 3839bff

Please sign in to comment.