Giter Club home page Giter Club logo

Comments (3)

Moligaloo avatar Moligaloo commented on August 27, 2024

What' wrong with this assertion ?

from qsanguosha.

rimy avatar rimy commented on August 27, 2024

我有 log,但是我不知道怎么在这上传文件,先贴出一部分

cat -n 20110906.log|tail -n 50

3463 sgs111: setEmotion sgs112:killer
3464 sgs111: setEmotion sgs114:victim
3465 sgs111: moveCard 35:sgs114@hand->@
3466 sgs111: log #Jink:sgs114->:35::
3467 sgs111: playCardEffect jink:M
3468 sgs111: #sgs112 phase discard
3469 sgs111: #sgs112 phase finish
3470 sgs111: #sgs112 phase not_active
3471 sgs111: #sgs113 phase start
3472 sgs111: #sgs113 phase judge
3473 sgs111: #sgs113 phase draw
3474 sgs111: drawNCards sgs113:2
3475 sgs111: moveNCards 1:sgs113@special->sgs113
3476 sgs111: moveNCards 1:sgs113@special->sgs113
3477 sgs111: moveNCards 1:sgs113@special->sgs113
3478 sgs111: moveNCards 1:sgs113@special->sgs113
3479 sgs111: moveNCards 1:sgs113@special->sgs113
3480 sgs111: moveNCards 1:sgs113@special->sgs113
3481 sgs111: moveNCards 1:sgs113@special->sgs113
3482 sgs111: moveNCards 1:sgs113->sgs113@special
3483 sgs111: moveNCards 1:sgs113->sgs113@special
3484 sgs111: moveNCards 1:sgs113->sgs113@special
3485 sgs111: moveNCards 1:sgs113->sgs113@special
3486 sgs111: moveNCards 1:sgs113->sgs113@special
3487 sgs111: moveNCards 1:sgs113->sgs113@special
3488 sgs111: moveNCards 1:sgs113->sgs113@special
3489 sgs111: log #QixingExchange:sgs113->::7:
3490 sgs111: #sgs113 phase play
3491 sgs111: log #UseCard:sgs113->sgs118:158::
3492 sgs111: playCardEffect fire_attack:M
3493 sgs111: moveCard 158:sgs113@hand->@
3494 sgs111: askForNullification fire_attack:sgs113->sgs118
3495 sgs111: showCard sgs118:32
3496 sgs111: moveCard 170:sgs113@hand->@
3497 sgs111: log #Damage:sgs113->sgs118::1:fire_nature
3498 sgs111: #sgs118 hp 3
3499 sgs111: hpChange sgs118:-1F
3500 sgs111: #sgs113 phase discard
3501 sgs111: #sgs113 phase finish
3502 sgs111: #sgs113 phase not_active
3503 sgs111: #sgs111 phase start
3504 sgs111: #sgs111 phase judge
3505 sgs111: #sgs111 phase draw
3506 sgs111: drawCards 161+13
3507 sgs111: #sgs111 phase play
3508 sgs111: activate sgs111
3509 sgs111: addHistory GuhuoCard
3510 sgs111: playSkillEffect guhuo:-1
3511 sgs111: log #GuhuoNoTarget:sgs111->::peach:
3512 ASSERT: "!pile_name.isEmpty()" in file src/room.cpp, line 2172

src/room.cpp 当时的代码为

:2135 void Room::doMove(const CardMoveStruct &move, const QSet<ServerPlayer *> &scope){
// avoid useless operation
if(move.from == move.to && move.from_place == move.to_place)
return;

const Card *card = Sanguosha->getCard(move.card_id);
if(move.from){
    if(move.from_place == Player::Special){
        QString pile_name = move.from->getPileName(move.card_id);
        Q_ASSERT(!pile_name.isEmpty());
        QString pile_str = QString("%1:%2-%3")
                           .arg(move.from->objectName()).arg(pile_name).arg(move.card_id);

        if(move.open)
            broadcastInvoke("pile", pile_str);
        else{
            foreach(ServerPlayer *p, scope)
                p->invoke("pile", pile_str);
        }
    }

    move.from->removeCard(card, move.from_place);
}else{
    switch(move.from_place){
    case Player::DiscardedPile: discard_pile->removeOne(move.card_id); break;
    case Player::DrawPile: draw_pile->removeOne(move.card_id); break;
    case Player::Special: table_cards.removeOne(move.card_id); break;
    default:
        break;
    }
}

if(move.to){
    move.to->addCard(card, move.to_place);

    if(move.to_place == Player::Special){
        QString pile_name = move.to->getPileName(move.card_id);

:2172 Q_ASSERT(!pile_name.isEmpty()); // 这里的
QString pile_str = QString("%1:%2+%3")
.arg(move.to->objectName()).arg(pile_name).arg(move.card_id);

        if(move.open)
            broadcastInvoke("pile", pile_str);
        else{
            foreach(ServerPlayer *p, scope)
                p->invoke("pile", pile_str);
        }
    }
}else{
    switch(move.to_place){
    case Player::DiscardedPile: discard_pile->prepend(move.card_id); break;
    case Player::DrawPile: draw_pile->prepend(move.card_id); break;
    case Player::Special: table_cards.append(move.card_id); break;
    default:
        break;
    }
}

setCardMapping(move.card_id, move.to, move.to_place);

QString move_str = move.toString();
if(!move.open){
    foreach(ServerPlayer *player, scope){
        player->invoke("moveCard", move_str);
    }
}else{
    broadcastInvoke("moveCard", move_str);
}

if(move.from){
    CardMoveStar move_star = &move;
    QVariant data = QVariant::fromValue(move_star);
    thread->trigger(CardLost, move.from, data);
}

Sanguosha->getCard(move.card_id)->onMove(move);

:2211 }

from qsanguosha.

Moligaloo avatar Moligaloo commented on August 27, 2024

于吉的蛊惑的 bug,会导致崩溃,已经修复

from qsanguosha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.