Skip to content

Commit f18a710

Browse files
committed
控制台补丁
修复了大小写问题导致的bug
1 parent 75584ab commit f18a710

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Dice/DiceEvent.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ class FromMsg {
504504
}
505505
}
506506
int MasterSet() {
507-
std::string strOption = readPara();
507+
std::string strOption = readUntilSpace();
508508
if (strOption.empty()) {
509509
reply("有什么事么" + getName(fromQQ));
510510
return -1;
@@ -974,7 +974,7 @@ class FromMsg {
974974
else if (strLowerMessage.substr(intMsgCnt, 5) == "admin")
975975
{
976976
intMsgCnt += 5;
977-
return AdminEvent(readPara());
977+
return AdminEvent(readUntilSpace());
978978
}
979979
else if (strLowerMessage.substr(intMsgCnt, 5) == "coc7d" || strLowerMessage.substr(intMsgCnt, 4) == "cocd")
980980
{
@@ -3344,6 +3344,15 @@ class FromMsg {
33443344
void readSkipSpace() {
33453345
while (isspace(static_cast<unsigned char>(strLowerMessage[intMsgCnt])))intMsgCnt++;
33463346
}
3347+
string readUntilSpace() {
3348+
string strPara;
3349+
readSkipSpace();
3350+
while (!isspace(static_cast<unsigned char>(strLowerMessage[intMsgCnt])) && intMsgCnt != strLowerMessage.length()) {
3351+
strPara += strMsg[intMsgCnt];
3352+
intMsgCnt++;
3353+
}
3354+
return strPara;
3355+
}
33473356
string readRest() {
33483357
readSkipSpace();
33493358
return strMsg.substr(intMsgCnt);

0 commit comments

Comments
 (0)