Skip to content

Commit

Permalink
fix: jrrp
Browse files Browse the repository at this point in the history
修复本地获取jrrp结果始终为114的bug
  • Loading branch information
mystringEmpty committed Feb 15, 2024
1 parent b4d69f4 commit c1af621
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Package Clear
uses: actions/delete-package-versions@v4
with:
package-name: vcpkg-cmake_x64-windows
package-name: vcpkg-cmake-get-vars_x64-windows
package-type: nuget
min-versions-to-keep: 1
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ AttrGetters MsgIndexs{
}},
{"grpAuth", idx_gAuth},
{"game", [](const AttrObject& obj) {
if (AttrVar game{sessions.get_if(*obj)}) {
if (AttrVar game{ sessions.get_if(*obj)} ) {
return obj->at("game") = game;
}
return AttrVar();
Expand Down Expand Up @@ -4059,8 +4059,8 @@ int DiceEvent::InnerOrder() {
}
else if (size_t pos{ attr.find("") }; pos != string::npos) {
string strGenitive = attr.substr(0, pos);
if (PList[fromChat.uid].count(strGenitive)) {
pc = PList[fromChat.uid][strGenitive];
if (pl.count(strGenitive)) {
pc = pl[strGenitive];
set("pc", pc->getName());
attr = attr.substr(pos + 2);
}
Expand Down Expand Up @@ -4168,8 +4168,8 @@ int DiceEvent::InnerOrder() {
'=' || strLowerMessage[intMsgCnt] == ':')intMsgCnt++;
//判定数值修改
if ((strLowerMessage[intMsgCnt] == '-' || strLowerMessage[intMsgCnt] == '+')) {
AttrVar& attr_old{ trans->at("old") = pc->get(attr_name) };
RD Mod(attr_old.to_str() + readDice());
trans->at("old") = pc->get(attr_name);
RD Mod(trans->get_str("old") + readDice());
if (int eno{ Mod.Roll() }; !eno) {
trans->set("action", "+=");
trans->set("expr", Mod.FormCompleteString());
Expand Down
4 changes: 2 additions & 2 deletions Dice/DiceSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void DiceScheduler::end() {

AttrVar DiceToday::getJrrp(long long uid) {
if (UserInfo.count(uid) && UserInfo[uid]->has("jrrp"))
return UserInfo[uid]["jrrp"];
return UserInfo[uid]->get("jrrp");
string frmdata = "QQ=" + to_string(console.DiceMaid) + "&v=20190114" + "&QueryQQ=" + to_string(uid);
string res;
if (Network::POST("http://api.kokona.tech:5555/jrrp", frmdata, "", res)) {
Expand All @@ -191,7 +191,7 @@ AttrVar DiceToday::getJrrp(long long uid) {
AnysTable{ {"res", res} }
), 0);
}
return UserInfo[uid]["jrrp_local"];
return UserInfo[uid]->get("jrrp_local");
}
}

Expand Down

0 comments on commit c1af621

Please sign in to comment.