• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Tutorial] DevAccount can open and pickup any lockbox.

Initiate Mage
Joined
Dec 12, 2015
Messages
3
Reaction score
11

This tutorial will delete all item in lockbox when pickup


obj_ServerPlayer.cpp


Search
Code:
// lockbox must be empty (yes, we're too lazy to put items to backpack)
    if(lockbox->items.size() > 0)
    {
        PKT_S2C_InventoryOpAns_s n2;
        n2.OpAns = PKT_S2C_InventoryOpAns_s::ANS_Desync;
        gServerLogic.p2pSendToPeer(peerId_, this, &n2, sizeof(n2));
        return;
    }

Replace
Code:
// lockbox must be empty (yes, we're too lazy to put items to backpack)
    if(lockbox->items.size() > 0[COLOR=#ff0000] && !profile_.ProfileData.isDevAccount[/COLOR])
    {
        PKT_S2C_InventoryOpAns_s n2;
        n2.OpAns = PKT_S2C_InventoryOpAns_s::ANS_Desync;
        gServerLogic.p2pSendToPeer(peerId_, this, &n2, sizeof(n2));
        return;
    }

Search
Code:
    // check owner
    if(profile_.CustomerID != lockbox->GetNetworkHelper()->srvObjParams_.CustomerID)
    {
        PKT_S2C_LockboxOpReq_s n2;
        n2.op        = PKT_S2C_LockboxOpReq_s::LBOR_NotOwner;
        n2.lockboxID = toP2pNetId(lockbox->GetNetworkID()); // object is still there so it's safe
        gServerLogic.p2pSendToPeer(peerId_, this, &n2, sizeof(n2));
        return;
    }

Replace
Code:
    // check owner
    if(profile_.CustomerID != lockbox->GetNetworkHelper()->srvObjParams_.CustomerID[COLOR=#ff0000] && !profile_.ProfileData.isDevAccount[/COLOR])
    {
        PKT_S2C_LockboxOpReq_s n2;
        n2.op        = PKT_S2C_LockboxOpReq_s::LBOR_NotOwner;
        n2.lockboxID = toP2pNetId(lockbox->GetNetworkID()); // object is still there so it's safe
        gServerLogic.p2pSendToPeer(peerId_, this, &n2, sizeof(n2));
        return;
    }

ServerGameLogic.cpp

Search
Code:
    if (lockbox->lockboxOwnerId == fromPlr->profile_.CustomerID)
    {
        return lockbox;
    }
    else
    {
        //lockbox->SetLockdown(fromPlr->profile_.CustomerID);


        PKT_S2C_LockboxOpReq_s n2;
        n2.op = PKT_S2C_LockboxOpReq_s::LBOR_NotOwner;
        n2.lockboxID = 0;
        gServerLogic.p2pSendToPeer(fromPlr->peerId_, fromPlr, &n2, sizeof(n2));
        return NULL;
    }

Replace
Code:
    if (lockbox->lockboxOwnerId == fromPlr->profile_.CustomerID[COLOR=#ff0000] || fromPlr->profile_.ProfileData.isDevAccount[/COLOR])
    {
        return lockbox;
    }
    else
    {
        //lockbox->SetLockdown(fromPlr->profile_.CustomerID);


        PKT_S2C_LockboxOpReq_s n2;
        n2.op = PKT_S2C_LockboxOpReq_s::LBOR_NotOwner;
        n2.lockboxID = 0;
        gServerLogic.p2pSendToPeer(fromPlr->peerId_, fromPlr, &n2, sizeof(n2));
        return NULL;
    }

HUDSafelock.cpp

Search
Code:
    if(NumItems > 0)
    {
        Scaleform::GFx::Value var[2];
        var[0].SetString(gLangMngr.getString("HUD_Safelock_LockboxShouldBeEmpty"));
        var[1].SetBoolean(true);
        gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
        return;
    }

Replace
Code:
    if(NumItems > 0[COLOR=#ff0000] && !gUserProfile.ProfileData.isDevAccount[/COLOR])
    {
        Scaleform::GFx::Value var[2];
        var[0].SetString(gLangMngr.getString("HUD_Safelock_LockboxShouldBeEmpty"));
        var[1].SetBoolean(true);
        gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
        return;
    }
 
Back
Top