LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
301 stars 603 forks source link

🐛 GM entity visible without being physically present and or connected #2837

Open HaxPrime opened 2 years ago

HaxPrime commented 2 years ago

Steps to reproduce

I can't reliably reproduce this error.

Sometimes GM entities will appear in the jeuno moghouse to players when in fact the GM account is offline and has been for many hours. Others times the GM entity will be online and appear in the jeuno moghouse to players.

Expected behavior

GM entity should not be in unexpected position.

Screenshots

Auron_2022 09 25_045440 In this screenshot I was offline from the server for a few hours when this player reported it. Kurma_2022 09 29_094054 Here I was online but in Port Jeuno when the player reported this. hax_ffxi_2022 09 29_10 41 19

842-d0ffc4c9-829b-4400-b3a7-1ec995a7133e.png)

CatsEyeXI commented 2 years ago

worth noting that while this was happening i checked our accounts_sessions table and didn't see an entry for this GM char present.

CatsEyeXI commented 2 years ago

some more info, appears to only be happening inside mog houses, and only with GM characters. I can confirm that I had been standing in this position maybe 30 mins earlier...

Also, we have our login server on a reboot timer (1 hr)... not sure if this could be exacerbating the issue. image image

CatsEyeXI commented 2 years ago

image

CatsEyeXI commented 2 years ago

Appears to no longer be limited to GM's

image

WinterSolstice8 commented 2 years ago

Is Ramsay a GM, or someone who can instant logout?

CatsEyeXI commented 2 years ago

No, they aren't.

On Mon, Oct 10, 2022 at 11:36 AM WinterSolstice8 @.***> wrote:

Is Ramsay a GM, or someone who can instant logout?

— Reply to this email directly, view it on GitHub https://github.com/LandSandBoat/server/issues/2837#issuecomment-1273496613, or unsubscribe https://github.com/notifications/unsubscribe-auth/APSKOWKBSSZCXD7NPAONFHTWCQZWJANCNFSM6AAAAAAQZ6DXBM . You are receiving this because you commented.Message ID: @.***>

WinterSolstice8 commented 1 year ago
void CLuaBaseEntity::setGMHidden(bool isHidden)
{
    XI_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC);

    auto* PChar         = static_cast<CCharEntity*>(m_PBaseEntity);
    PChar->m_isGMHidden = isHidden;

    if (PChar->loc.zone)
    {
        if (PChar->m_isGMHidden)
        {
            PChar->loc.zone->UpdateCharPacket(PChar, ENTITY_DESPAWN, UPDATE_NONE);
        }
        else
        {
            PChar->loc.zone->UpdateCharPacket(PChar, ENTITY_SPAWN, UPDATE_NONE);
        }
    }
}

I think this is caused by unhiding in the moghouse. It injects a spawn packet to everyone in range (which would be everyone in the moghouse since everyone is "nearby" in that tiny room)

Perhaps a check for

        else if(PChar->m_moghouseID == 0)
        {
            PChar->loc.zone->UpdateCharPacket(PChar, ENTITY_SPAWN, UPDATE_NONE);
        }

could solve this?