Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
mystringEmpty committed Dec 17, 2024
1 parent b375861 commit 4be4d33
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Dice/BlackListManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ void DDBlackManager::verify(const fifo_json& pJson, long long operatorQQ)
if (mark.type == "local" || mark.type == "other" || mark.isSource(console.DiceMaid)) {
if (credit > 0)console.log(
getName(operatorQQ) + "已通知" + getMsg("strSelfName") + "不良记录(未采用):\n!warning" +
pJson.dump()), 1, printSTNow();
pJson.dump(), 1, printSTNow());
return;
}
}
Expand Down Expand Up @@ -1218,7 +1218,7 @@ void DDBlackManager::verify(const fifo_json& pJson, long long operatorQQ)
}
if (mark.fromGID.first && (groupset(mark.fromGID.first, "忽略") > 0 || groupset(mark.fromGID.first, "协议无效") > 0 || ExceptGroups.count(mark.fromGID.first)))return;
insert(mark);
console.log(getName(operatorQQ) + "已通知" + getMsg("strSelfName") + "不良记录" + to_string(vBlackList.size() - 1) + ":\n!warning" + pJson.dump()), 1, printSTNow();
console.log(getName(operatorQQ) + "已通知" + getMsg("strSelfName") + "不良记录" + to_string(vBlackList.size() - 1) + ":\n!warning" + pJson.dump(), 1, printSTNow());
}
else
{
Expand Down Expand Up @@ -1249,7 +1249,7 @@ void DDBlackManager::verify(const fifo_json& pJson, long long operatorQQ)
if (mark.danger != old_mark.danger && credit < 3) {
mark.danger = old_mark.danger;
}
if(update(mark,index,credit))console.log(getName(operatorQQ) + "已更新" + getMsg("strSelfName") + "不良记录" + to_string(index) + ":\n!warning" + pJson.dump()), 1, printSTNow();
if(update(mark,index,credit))console.log(getName(operatorQQ) + "已更新" + getMsg("strSelfName") + "不良记录" + to_string(index) + ":\n!warning" + pJson.dump(), 1, printSTNow());
}
}

Expand Down
5 changes: 5 additions & 0 deletions Dice/DiceAttrVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ ByteS AttrVar::to_bytes()const {
case Type::Integer:
case Type::Number:
case Type::ID:
case Type::GBTable:
case Type::Table:
case Type::Set:
return {};
Expand Down Expand Up @@ -567,6 +568,8 @@ string AttrVar::print()const {
case Type::U8String:
return text;
break;
case Type::GBTable:
return {};
case Type::Table:
return table->print();
break;
Expand Down Expand Up @@ -785,6 +788,7 @@ fifo_json AttrVar::to_json()const {
break;
case Type::Set:
return ::to_json(*flags);
case Type::GBTable:
case Type::Function:
return {};
}
Expand Down Expand Up @@ -1070,6 +1074,7 @@ void from_json(const fifo_json& j, AttrVars& vars) {
void AttrVar::writeb(std::ofstream& fout) const {
switch (type) {
case Type::Nil:
case Type::GBTable:
fwrite(fout, (char)0);
break;
case Type::Boolean:
Expand Down
4 changes: 3 additions & 1 deletion Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4260,7 +4260,9 @@ int DiceEvent::InnerOrder() {
strAttr = readAttrName();
if (pc->countExp(strAttr)) {
strMainDice += pc->getExp(strAttr);
if (!pc->has("&" + strAttr) && pc->get(strAttr).type == AttrVar::Type::Integer)strMainDice += 'a';
}
else if (auto val{ pc->get(strAttr) };val.type == AttrVar::Type::Integer) {
strMainDice += val.to_str();
}
else {
strReason = strAttr;
Expand Down
2 changes: 1 addition & 1 deletion Dice/DiceLua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ bool lua_call_task(const AttrVars& task) {
// 转换为UTF8
string filename(GBKtoUTF8(file));
#else
string filename(luaFile);
string filename(file);
#endif
if (lua_pcall(L, 0, 0, 0)) {
string pErrorMsg = lua_to_u8string_from_native(L, -1);
Expand Down
8 changes: 4 additions & 4 deletions Dice/DiceSchedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ void DiceScheduler::push_job(const char* job_name, bool isSelf, const AttrVars&
}
//将任务加入等待队列
void DiceScheduler::add_job_for(unsigned int waited, const AttrObject& job) {
std::unique_lock<std::mutex> lock_queue(mtJobWaited);
std::lock_guard<std::mutex> lock_queue(mtJobWaited);
queueJobWaited.emplace(time(nullptr) + waited, job);
}
void DiceScheduler::add_job_for(unsigned int waited, const char* job_name) {
std::unique_lock<std::mutex> lock_queue(mtJobWaited);
std::lock_guard<std::mutex> lock_queue(mtJobWaited);
queueJobWaited.emplace(time(nullptr) + waited, AttrVars{ { "cmd" , job_name } });
}

void DiceScheduler::add_job_until(time_t cloc, const AttrObject& job) {
std::unique_lock<std::mutex> lock_queue(mtJobWaited);
std::lock_guard<std::mutex> lock_queue(mtJobWaited);
queueJobWaited.emplace(cloc, job);
}
void DiceScheduler::add_job_until(time_t cloc, const char* job_name) {
std::unique_lock<std::mutex> lock_queue(mtJobWaited);
std::lock_guard<std::mutex> lock_queue(mtJobWaited);
queueJobWaited.emplace(cloc, AttrVars{ { "cmd" , job_name } });
}

Expand Down

0 comments on commit 4be4d33

Please sign in to comment.