• 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.

[Share] Offline Vend (Split source)

Newbie Spellweaver
Joined
Jan 14, 2021
Messages
33
Reaction score
18
C++:
Find : GLAgentServer.cpp
    
    Find:  related and change it like below
        DropOutPC ( pChar->m_dwGaeaID );
    Change:
        DropOutPC ( pChar->m_dwGaeaID, true );

    Find: related and  change it like below
        DropOutPC ( dwGaeaID );
    Change:
        DropOutPC ( dwGaeaID, true );

    Find:
        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID )
    Change:
        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID, bool bForce )
                //offline vend
        if ( pPChar->m_sPMarket.IsOpen() )
        if ( pPChar->m_sPMarket.IsPremiumMarket() && !bForce/*&& !pPChar->m_bOffVend*/ )
        {
            //pPChar->m_bOffVend = true;
            return E_FAIL;
        }

        if ( pPChar->m_sPMarket.IsOpen() )    pPChar->m_sPMarket.DoMarketClose();
C++:
Find GLAgentServerMsg.cpp

    find: related and change it like below
        HRESULT DropOutPC ( DWORD dwGaeaID );
    change:
        HRESULT DropOutPC ( DWORD dwGaeaID, bool bForce = false );
C++:
FIND GLAgentServerMsg.CPP

        find: related and change it like below

           case NET_MSG_REQ_ATTENDANCE:

    change:

        case NET_MSG_REQ_ATTENDANCE:
        case NET_MSG_GCTRL_PMARKET_OPEN_AGT:

C++:
FIND GLCharAG.CPP

        find: related and change it like below
            m_fDeathTimer( 0.0f )

           change:
            m_fDeathTimer( 0.0f ),
            m_bOffVend ( false )


        find: related and change it like below
            HRESULT GLCharAG::MsgReqQboxOption( NET_MSG_GENERIC* nmg )
            {
                GLMSG::SNET_QBOX_OPTION_REQ_AG* pNetMsg = (GLMSG::SNET_QBOX_OPTION_REQ_AG*)nmg;

                GLMSG::SNET_QBOX_OPTION_REQ_FLD NetMsgFld;
                NetMsgFld.dwPartyID   = m_dwPartyID;
                NetMsgFld.bQBoxEnable = pNetMsg->bQBoxEnable;
                GLAgentServer::GetInstance().SENDTOALLCHANNEL ( &NetMsgFld );

                return S_OK;
            }
            
        change:
            HRESULT GLCharAG::MsgReqQboxOption( NET_MSG_GENERIC* nmg )
            {
                GLMSG::SNET_QBOX_OPTION_REQ_AG* pNetMsg = (GLMSG::SNET_QBOX_OPTION_REQ_AG*)nmg;

                GLMSG::SNET_QBOX_OPTION_REQ_FLD NetMsgFld;
                NetMsgFld.dwPartyID   = m_dwPartyID;
                NetMsgFld.bQBoxEnable = pNetMsg->bQBoxEnable;
                GLAgentServer::GetInstance().SENDTOALLCHANNEL ( &NetMsgFld );

                return S_OK;
            }

            HRESULT    GLCharAG::MsgPMarketOpen( NET_MSG_GENERIC* nmg )
            {
                GLMSG::SNETPC_PMARKET_OPENCLOSE_AGT* pNetMsg = (GLMSG::SNETPC_PMARKET_OPENCLOSE_AGT*)nmg;
                pNetMsg->bOPEN ? m_sPMarket.DoMarketOpen() : m_sPMarket.DoMarketClose();
                if ( pNetMsg->bOPEN )    m_sPMarket.SetSaleType ( pNetMsg->bPremium ? GLPrivateMarket::EM_SALE_TYPE_PREMIUM : GLPrivateMarket::EM_SALE_TYPE_NORMAL );

                return S_OK;
            }

        find: related and change it like below
            case NET_MSG_REQ_ATTENDANCE:                MsgReqAttendance(nmg); break
        change:
            case NET_MSG_REQ_ATTENDANCE:                MsgReqAttendance(nmg); break;
            case NET_MSG_GCTRL_PMARKET_OPEN_AGT:        MsgPMarketOpen(nmg); break;
C++:
Find :GLCharAG.h

Find:
#include "./GLContrlCharJoinMsg.h"
Change
#include "./GLContrlCharJoinMsg.h"
#include "./GLPrivateMarket.h"

Find
    DWORD                m_dwNextFieldSvr;           

change:
    DWORD                m_dwNextFieldSvr;

    bool                m_bOffVend;
    GLPrivateMarket        m_sPMarket;

Find:
    HRESULT MsgReqAttendance( NET_MSG_GENERIC* nmg );
Change
    HRESULT MsgReqAttendance( NET_MSG_GENERIC* nmg );
    HRESULT    MsgPMarketOpen ( NET_MSG_GENERIC* nmg );
C++:
FIND GLCharPMarketMsg.cpp

Find:
    GLMSG::SNETPC_PMARKET_OPEN_BRD NetMsgBRD;
    NetMsgBRD.dwGaeaID = m_dwGaeaID;
    StringCchCopy ( NetMsgBRD.szPMarketTitle, CHAT_MSG_SIZE+1, m_sPMarket.GetTitle().c_str() );
    SendMsgViewAround ( (NET_MSG_GENERIC *) &NetMsgBRD );

Add below:
    m_sPMarket.SetSaleType ( (GLPrivateMarket::EM_SALE_TYPE) pITEM->sSuitOp.wReModelNum );

    GLMSG::SNETPC_PMARKET_OPENCLOSE_AGT NetMsg;
    NetMsg.bPremium = m_sPMarket.IsPremiumMarket();
    NetMsg.bOPEN = true;
    GLGaeaServer::GetInstance().SENDTOAGENT ( m_dwClientID, &NetMsg );

Find:
    GLGaeaServer::GetInstance().SENDTOCLIENT ( m_dwClientID, (NET_MSG_GENERIC*) &NetMsgBRD );

Add below:
    GLMSG::SNETPC_PMARKET_OPENCLOSE_AGT NetMsg;
    NetMsg.bOPEN = false;
    GLGaeaServer::GetInstance().SENDTOAGENT ( m_dwClientID, &NetMsg );
C++:
FIND GLContrlPrivateMarket.h
Find:
    struct SNETPC_PMARKET_SEARCH_ITEM_RESULT_REQ
    {
        NET_MSG_GENERIC        nmg;
        DWORD                dwPageNum;

        SNETPC_PMARKET_SEARCH_ITEM_RESULT_REQ () :
            dwPageNum(0)
        {
            nmg.dwSize = sizeof(*this);
            nmg.nType = NET_MSG_GCTRL_PMARKET_SEARCH_ITEM_RESULT_REQ;
            GASSERT(nmg.dwSize<=NET_DATA_BUFSIZE);
        }
    };

Add Below :

    struct SNETPC_PMARKET_OPENCLOSE_AGT
    {
        NET_MSG_GENERIC        nmg;
        bool                bOPEN;
        bool                bPremium;

        SNETPC_PMARKET_OPENCLOSE_AGT () :
            bPremium ( false ),
            bOPEN ( false )
        {
            nmg.dwSize = sizeof(*this);
            nmg.nType = NET_MSG_GCTRL_PMARKET_OPEN_AGT;
            GASSERT(nmg.dwSize<=NET_DATA_BUFSIZE);
        }
    };
C++:
Find GLGaeaServer.cpp

Find:
BOOL GLGaeaServer::DropOutPC ( DWORD dwGaeaPcID )

Change:
BOOL GLGaeaServer::DropOutPC ( DWORD dwGaeaPcID, bool bForce )

Find:
    if ( pPC->m_sPMarket.IsOpen() )

Change:
    if ( pPC->m_sPMarket.IsOpen() )
    {
        //offline vend
        /*dmk14 offline vend new code*/
        if ( pPC->m_sPMarket.IsPremiumMarket () && !bForce )

Find
    DropOutPC(dwGaea);

Change
    DropOutPC(dwGaea,true);
C++:
Find GLGaeaServer.h

Find
    BOOL DropOutPC ( DWORD dwGaeaID );
    
Change   
    BOOL DropOutPC ( DWORD dwGaeaID, bool bForce = false );
C++:
Find GLGaeaServerMsg.cpp

Find:
    if( pTarChar->m_bDisTrade )                    return FALSE;
Change
    if( pTarChar->m_bDisTrade )                    return FALSE;
    if( pTarChar->m_sPMarket.IsOpen() )            return FALSE;

Find all and change
    DropOutPC(pChar->m_dwGaeaID);
Change
    DropOutPC(pChar->m_dwGaeaID,true);
C++:
Find GLogicEx.h

Find
    BOOL                m_bPassenger;
Add below   
    bool                m_bOffVend;

Find
    m_bSafeZone(false),
Add below   
    m_bOffVend ( false )
C++:
Find GLogixExPC.cpp

Find
    DISABLEALLLANDEFF();
Add Below
    m_bOffVend = false;
C++:
Find GLPrivateMarket.cpp


Find
    GLPrivateMarket::GLPrivateMarket(void) :
    m_bOPEN(false)
Change
GLPrivateMarket::GLPrivateMarket(void) :
    m_bOPEN(false),
    m_emSale(EM_SALE_TYPE_NORMAL)

Find
{
    m_bOPEN = false;
    m_strTITLE.clear();
    m_mapSALE.clear();
    m_invenSALE.DeleteItemAll();

    m_mapSearchItem.clear();
}
change
{
    m_bOPEN = false;
    m_strTITLE.clear();
    m_emSale = EM_SALE_TYPE_NORMAL;   
    m_mapSALE.clear();
    m_invenSALE.DeleteItemAll();
    m_mapSearchItem.clear();

}

Find
SSALEITEM* GLPrivateMarket::GetItem ( SNATIVEID sSALEPOS )
{
    MAPITEM_ITER pos = m_mapSALE.find ( sSALEPOS.dwID );
    if ( pos==m_mapSALE.end() )                        return NULL;

    return &(*pos).second;
}

Change
SSALEITEM* GLPrivateMarket::GetItem ( SNATIVEID sSALEPOS )
{
    MAPITEM_ITER pos = m_mapSALE.find ( sSALEPOS.dwID );
    if ( pos==m_mapSALE.end() )                        return NULL;

    return &(*pos).second;
}

void GLPrivateMarket::SetSaleType ( EM_SALE_TYPE emSale )
{
    if ( m_emSale >= EM_SALE_TYPE_SIZE ) return;

    m_emSale = emSale;
}
C++:
Find GLPrivateMarket.h

Find
    {
        EM_SALE_INVEN_X    = 6,
        EM_SALE_INVEN_Y    = 4,
        EMMAX_SALE_NUM    = EM_SALE_INVEN_X * EM_SALE_INVEN_Y
    };
Change
    {
        EM_SALE_INVEN_X    = 6,
        EM_SALE_INVEN_Y    = 4,
        EMMAX_SALE_NUM    = EM_SALE_INVEN_X * EM_SALE_INVEN_Y
    };

    enum EM_SALE_TYPE
    {
        EM_SALE_TYPE_NORMAL = 0,
        EM_SALE_TYPE_PREMIUM = 1,
        EM_SALE_TYPE_SIZE = 2,
    };

Find
    GLInventory    m_invenSALE;
Change
    GLInventory    m_invenSALE;
    EM_SALE_TYPE m_emSale;   
Find
public:
    void SetTITLE ( std::string strTITLE );
    bool SetSaleState ( SNATIVEID sSALEPOS, DWORD dwNUM, bool bSOLD );

Change
public:
    void SetTITLE ( std::string strTITLE );
    bool SetSaleState ( SNATIVEID sSALEPOS, DWORD dwNUM, bool bSOLD );

    void SetSaleType ( EM_SALE_TYPE emSale );
    bool IsPremiumMarket () { return m_emSale == EM_SALE_TYPE_PREMIUM; }
C++:
Find s_CAgentServerMsg.cpp

Find
    case NET_MSG_DROPCHAR_TOAGENT:
Add Below
    case NET_MSG_GCTRL_PMARKET_OPEN_AGT:


Find s_NetGlobal.h
Find
    NET_MSG_GCTRL_PMARKET_ITEM_UPDATE_BRD= (NET_MSG_GCTRL + 717),
Add Below
    NET_MSG_GCTRL_PMARKET_OPEN_AGT        = (NET_MSG_GCTRL + 718),

Someone look for this
Sharing is caring.

NO SUPPORT WILL BE GIVEN.
 
Banned
Banned
Joined
Mar 21, 2013
Messages
225
Reaction score
18
i think GLAgentServerMsg.cpp code is for GLAgentServer.h

C++:
  find: related and change it like below
 
        HRESULT DropOutPC ( DWORD dwGaeaID );
    change:
        HRESULT DropOutPC ( DWORD dwGaeaID, bool bForce = false );
It is
 
Newbie Spellweaver
Joined
Jul 2, 2023
Messages
70
Reaction score
10
Hello, please show a details how does this work? Is it use with the same store permit card?
 
Banned
Banned
Joined
Mar 21, 2013
Messages
225
Reaction score
18
doesn't work on me maybe there are some missing codes. But thanks for sharing tho!

doesn't work on me maybe there are some missing codes. But thanks for sharing tho!

For other source released here with an offline vend feature check this:
 
Joined
Mar 12, 2011
Messages
607
Reaction score
49
if you got an error in GLAgentServer.cpp
try this:
C++:
Find:
        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID )
            
Replace:

        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID, bool bForce )  //eRRRR
{
    PGLCHARAG pPChar = GetChar(dwGaeaID);
    if ( !pPChar )    return E_FAIL;
    // offline vend logic
    if ( pPChar->m_sPMarket.IsOpen() )
    if ( pPChar->m_sPMarket.IsPremiumMarket() && !pPChar->m_bOffVend )
    {
        pPChar->m_bOffVend = true;
        return E_FAIL;
    }

    if ( pPChar->m_sPMarket.IsOpen() )    pPChar->m_sPMarket.DoMarketClose();
 
Newbie Spellweaver
Joined
Jul 2, 2023
Messages
70
Reaction score
10
if you got an error in GLAgentServer.cpp
try this:
C++:
Find:
        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID )
           
Replace:

        HRESULT GLAgentServer::DropOutPC ( DWORD dwGaeaID, bool bForce )  //eRRRR
{
    PGLCHARAG pPChar = GetChar(dwGaeaID);
    if ( !pPChar )    return E_FAIL;
    // offline vend logic
    if ( pPChar->m_sPMarket.IsOpen() )
    if ( pPChar->m_sPMarket.IsPremiumMarket() && !pPChar->m_bOffVend )
    {
        pPChar->m_bOffVend = true;
        return E_FAIL;
    }

    if ( pPChar->m_sPMarket.IsOpen() )    pPChar->m_sPMarket.DoMarketClose();
Hi how does the offline vend work?
 
Newbie Spellweaver
Joined
Apr 3, 2020
Messages
47
Reaction score
0
Based on the code above to turn on the PremiumMarket you need to set the remodel to 1.

Could be wrong. That's enough internet for today
on item editor sir ?
 
Banned
Banned
Joined
May 28, 2010
Messages
184
Reaction score
33
after you merge with no Error
find Store Business Permit on ItemEditor
then 2nd Page Set Remodel 0 set to 1
0 Normal ( Not OFflien Vend )
1 Premium ( Offline Vend ) ( Server list / or Exit Game / Anything you do, even force close )

Sencore Offline Vend <3
 
Banned
Banned
Joined
May 7, 2019
Messages
132
Reaction score
44
Is this offline vend having issue with duplicate item? Some code issue that not saving data while offline?
 
Newbie Spellweaver
Joined
Aug 27, 2022
Messages
27
Reaction score
4
Anyone can help me? this error?
 

Attachments

  • 396661535_326087536798645_8744830796323694638_ - [Share] Offline Vend (Split source) - RaGEZONE Forums
    396661535_326087536798645_8744830796323694638_n.png
    23 KB · Views: 73
Back
Top