Skip to content

Commit

Permalink
fix blacklist
Browse files Browse the repository at this point in the history
改变常量{FormFeed}的意义,以满足现实需要
使用列表展示blackqq和blackgroup,以免长度根本不可能被发出去
  • Loading branch information
mystringEmpty committed Aug 7, 2020
1 parent 55a1094 commit 0748e49
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
10 changes: 8 additions & 2 deletions Dice/BlackListManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,10 @@ void DDBlackManager::add_black_group(long long llgroup, FromMsg* msg)
DDBlackMark mark{0, llgroup};
mark.danger = 1;
mark.note = msg->strVar["note"];
if (!mark.note.empty())mark.danger = 2;
if (!mark.note.empty()) {
mark.danger = 2;
mark.type = "other";
}
if (mark.danger < get_qq_danger(llgroup))
{
msg->reply(GlobalMsg["strSelfName"] + "已拉黑群" + to_string(llgroup) + "");
Expand All @@ -1074,7 +1077,10 @@ void DDBlackManager::add_black_qq(long long llqq, FromMsg* msg)
DDBlackMark mark{llqq, 0};
mark.danger = 1;
mark.note = msg->strVar["note"];
if (!mark.note.empty())mark.danger = 2;
if (!mark.note.empty()) {
mark.danger = 2;
mark.type = "other";
}
if (mark.danger < get_qq_danger(llqq))
{
msg->reply(GlobalMsg["strSelfName"] + "已拉黑用户" + printQQ(llqq) + "");
Expand Down
15 changes: 7 additions & 8 deletions Dice/DiceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,11 @@ int FromMsg::AdminEvent(const string& strOption)
{
if (llTargetID == 0)
{
strReply = "当前黑名单群列表:";
for (auto [each, danger] : blacklist->mGroupDanger)
{
strReply += "\n" + to_string(each);
ResList res;
for (auto [each, danger] : blacklist->mGroupDanger) {
res << printGroup(each) + ":" + to_string(danger);
}
reply();
reply(res.show(), false);
return 1;
}
strVar["time"] = printSTNow();
Expand Down Expand Up @@ -621,12 +620,12 @@ int FromMsg::AdminEvent(const string& strOption)
{
if (llTargetID == 0)
{
strReply = "当前黑名单用户列表:";
ResList res;
for (auto [each, danger] : blacklist->mQQDanger)
{
strReply += "\n" + printQQ(each);
res << printQQ(each) + ":" + to_string(danger);
}
reply();
reply(res.show(), false);
return 1;
}
strVar["time"] = printSTNow();
Expand Down
2 changes: 2 additions & 0 deletions Dice/GlobalVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ const std::map<std::string, std::string, less_ci> HelpDoc = {
"draw",
"抽牌:.draw [牌堆名称] ([抽牌数量])\t//抽到的牌不放回,抽牌数量不能超过牌堆数量\n当前内置牌堆:硬币/性别/\n调查员职业/调查员背景/英雄天赋/煤气灯/个人描述/思想信念/重要之人/重要之人理由/意义非凡之地/宝贵之物/调查员特点/即时症状/总结症状/恐惧症状/狂躁症状/\n阵营/哈罗花色/冒险点子/\n人偶暗示/人偶宝物/人偶记忆碎片/人偶依恋/\nAMGC/AMGC身材/AMGC专精/AMGC武器/AMGC套装/AMGC才能/AMGC特技1/AMGC特技2/AMGC特技3\n/塔罗牌/正逆/塔罗牌占卜/单张塔罗牌/圣三角牌阵/四要素牌阵/小十字牌阵/六芒星牌阵/凯尔特十字牌阵\n.help审判正位(牌+方向)可获取塔罗牌解读\n扩展牌堆:{扩展牌堆}"
},
{ "扩展牌堆","{list_extern_deck}" },
{ "全牌堆列表","{list_all_deck}" },
{"先攻", "&ri"},
{"ri", "先攻(群聊限定):.ri([加值])([昵称])\n.ri -1 某pc\t//自动记入先攻列表\n.ri +5 boss"},
{"先攻列表", "&init"},
Expand Down
6 changes: 3 additions & 3 deletions Dice/MsgFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
using std::string;

std::map<string, string> GlobalChar{
{"FormFeed","\f"},
{"FormFeed","\f"},
};

std::map<string, GobalTex> strFuncs{
{"master_QQ",print_master},
{"扩展牌堆",list_extern_deck},
{"全牌堆列表",list_deck},
{"list_extern_deck",list_extern_deck},
{"list_all_deck",list_deck},
};

std::string format(std::string str, const std::initializer_list<const std::string>& replace_str)
Expand Down

0 comments on commit 0748e49

Please sign in to comment.