Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 47 forks source link

[Bug] Successful spell after character Logout. #1153

Closed canerksk closed 6 months ago

canerksk commented 1 year ago

This problem has been around for a long time. The character first casts a spell and then continues casting the spell after exiting the game. In fact, if the spell he casts is teleport, it may cause him to instantly fall out of the game.

eg fix;

void CClient::CharDisconnect()
{
    ADDTOCALLSTACK("CClient::CharDisconnect");
    // Disconnect the CChar from the client.
    // Even tho the CClient might stay active.
    if ( !m_pChar )
        return;
    int64 iLingerTime = g_Cfg.m_iClientLingerTime / MSECS_PER_SEC;

    Announce(false);
    bool fCanInstaLogOut = CanInstantLogOut();

    m_pChar->Skill_Cleanup(); <-- or
    //m_pChar->Spell_CastFail(true or false); <--

...
...

The codes here are purely examples. Although many have been tested, some may need to be rewritten.

xwerswoodx commented 1 year ago

I checked that, there is no bug at all, it's because seems like you have a linger time in sphere.ini, the character keep staying on the server for a while (depends on your linger time setting in sphere.ini) so the spells can successfully completed in this time, also other players can attack the player while in linger time. If you set that 0, the character directly leave from server and the spell not successfully completed, but the timer will start again when you login back and complete the spell if he can. This is default behaviour.

xwerswoodx commented 1 year ago

I put to be confirmed back to check tp if there is a bug about it.

Edit: Yes there is a bug for TP ignore linger time for disconnected clients.

xwerswoodx commented 7 months ago

It should be fixed already, we made a some disconnected check for spells before. It can be nice if you give a feedback.

xwerswoodx commented 6 months ago

As there is no feedback for a long time, I am closing this issue, as it works fine for me. If you think this issue still exists, you can contact us on discord to re-open this issue, or create new issue for it.