How to get hSrcItem

Results 1 to 22 of 22
  1. #1
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    How to get hSrcItem

    Hi, i'm doing the ItemMove, and allways geterror, and i wanna see what is the hSrcItem get from DBOVirtualServer to put in GameServer, now DBOVirtualServer give me back this.

    hSrcItem 4 Is for jacket.

    I was thinking in how do this automatic, and i understan i can do this.

    Pos+2

    Example.
    EQUIP_SLOT_TYPE_JACKET = 2
    EQUIP_SLOT_TYPE_JACKET + 2 = 4

    And that way i can get hSrcItem, but now, i get the hSrcItem of BagSlots and bagmove and i get this...

    hSrcItem 10 but doesn't exist someone was 8 and is for bag.

    How i can get hSrcItem of the items?

    res->wOpCode = GU_ITEM_MOVE_RES;
    res->wResultCode = GAME_SUCCESS;
    res->hSrcItem = hSrcItem;

    - - - Updated - - -

    I got this.

    Code:
    const int            NTL_MAX_BAGSLOT_COUNT        =  6; // °¡¹æ ½½·ÔÀÇ °³¼ö
    
    
    const int            NTL_MAX_BANKSLOT_COUNT        =  4; // â°í ½½·ÔÀÇ °³¼ö
    
    
    const int            NTL_MAX_GUILD_BANK_COUNT    =  3; // ±æµå â°í °³¼ö
    
    
    const int            NTL_MAX_EQUIP_ITEM_SLOT        = EQUIP_SLOT_TYPE_COUNT;
    
    
    const int            NTL_MAX_ITEM_SLOT            = 16; // ½½·ÔÀÇ ÃÖ´ë Å©±â
    
    
    const int            NTL_MAX_BAG_ITEM_SLOT        = 16; // °¡¹æÀÇ ÃÖ´ë Å©±â
    
    
    const int            NTL_MAX_SCOUTER_ITEM_SLOT    = 16; // ½ºÄ«¿ìÅÍ °¡¹æÀÇ ÃÖ´ë Å©±â
    - - - Updated - - -
    @Arnie36 maybe you can help me?

    UPDATE: I'm bulding all of the function of item to do this D:
    Last edited by Nicolas321; 27-06-14 at 04:18 AM. Reason: UPDATE


  2. #2
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    I'm not sure what your asking, but on server side you should already know what all hSrcItem's are because the server told the client what they are in the first place

  3. #3
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    No he doesn't. The hSrcItem of a item what it? Is the position?

    I thinks are the items who have the bag.

    - - - Updated - - -

    How do you have the sGU_ITEM_MOVE_RES?

    sGU_ITEM_MOVE_RES * res = (sGU_ITEM_MOVE_RES *)packet.GetPacketData();

  4. #4
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    @Arnie36 can you give me one hand, i really don't understand.

    What do you do in here?

    res->hSrcItem = 4;

    Where i get the hSrcItem?? In DBOVirtualServer have this

    Code:
    SERIAL_HANDLE hSerial = pInventory->GetBagItem(0);CNtlSobItem *pSobItem = reinterpret_cast<CNtlSobItem*>( GetNtlSobManager()->GetSobObject(hSerial) ); 
    hSrcItem = pSobItem->GetChildSerial(pRecv->bySrcPos);
    - - - Updated - - -

    UPDATE: In the TXT from DBOVritualServer when i move the jacket i got this.

    Code:
    hSrcItem 4 - Place CONTAINER_BAG1
    hSerial 3
    hDestItem -1 - Place CONTAINER_EQUIP
    - - - Updated - - -
    @Arnie36 i'm asking if you can help me, where is hSrcItem, you said server told to che client, but how i can get the hSrcItem, that is what i want.

    hSrcItem = GetItemFromSerial(Serial of item)

    HOBJET hSrcItem
    Last edited by Nicolas321; 28-06-14 at 04:48 AM.

  5. #5
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    the server told the client what he has with the inventory packet(s)
    how about you make a list with all the information the server sends to the client so you don't have to wonder what the client is sending back at the server

  6. #6
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    Well, i surrender, i don't know how do what are you talking about.

    - - - Updated - - -

    I'm trying something now, i hope works.

    - - - Updated - - -

    Doesn't work :/

    - - - Updated - - -
    @Arnie36 man, i get all of the inventory, now how i can get the SERIAL NUMBER of item, to do hSrcItem.

    I got this.

    GetItems(Place) ---- This get me back all of the items in the packet. Example 14001 and 14002 and 80803
    And this.

    Example i got in the CONTAINER_TYPE_BAG1 i got the items 14001 in pos 0, 17018 in pos 1 and 90004 in pos 4.

    With

    GetItems(CONTAINER_TYPE_BAG1) = get me back, 14001, 17018, 90004.

    Or by pos

    GetItems(Place, Pos) -- Example

    GetItems(7, 2) This give me back, 14004 because i'm using in the jacket the TBLIDX 14004

    Now, can you tell me how i can get the hSrcItem? Please D: i don't know how get the hSrcItem.

  7. #7
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    the list which contains place and pos of an item also should have the SERIAL NUMBER

    in a struct

    struct inventory
    {
    int itemIDX;
    int serialnumber;
    int stackcount;
    char any_information_you_want_to_keep_track_of;
    }

    or in an array(or is it a matrix?)

    int items[20][16][1][1][1][1][1];
    Last edited by Arnie36; 29-06-14 at 01:09 AM.

  8. #8
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    Yes, but i need the

    hSrcItem, for the GU_ITEM_MOVE_RES.

    I do this.

    Code:
    void CClientSession::SendItemMoveRes(CNtlPacket * pPacket, CGameServer * app)
    {
        sUG_ITEM_MOVE_REQ *pRecv = (sUG_ITEM_MOVE_REQ*)pPacket->GetPacketData();
    
    
        CNtlPacket packet(sizeof(sGU_ITEM_MOVE_RES));
        sGU_ITEM_MOVE_RES * res = (sGU_ITEM_MOVE_RES *)packet.GetPacketData();
    
    
        res->wOpCode = GU_ITEM_MOVE_RES;
        res->wResultCode = GAME_SUCCESS;
        // res->hSrcItem = hSrcItem; HOW I GET THIS
        res->bySrcPlace = pRecv->bySrcPlace;
        res->bySrcPos = pRecv->bySrcPos;
        // res->hDestItem = hDestItem; HOW I GET THIS
        res->byDestPlace = pRecv->byDestPlace;
        res->byDestPos = pRecv->byDestPos;
    
    
        packet.SetPacketLen(sizeof(sGU_ITEM_MOVE_RES));
        int rc = g_pApp->Send(this->GetHandle(), &packet);
    }
    I already have SrcPos and SrcPlace i need hItemHandle = hSrcItem.

    GetItems get to me, the TBLIDX, or if are something in that pos in the bag, but how i get the SERIAL, i need SERIAL NUMBER, not the TBLIDX.

  9. #9
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    GetItemSerial(Place, Pos)

  10. #10
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    And how i do the GetItemSerial?

    What i need to do? I don't have GetItemSerial.

  11. #11
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    does the client know the item serial?

  12. #12
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    No, i can't find anywhere i can get the item serial. In nowhere, not even the db, nothing D:

    - - - Updated - - -

    GetItem, i made that function.

  13. #13
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    how did the client get the item?

    and the serial number should be in your database or else your database is not complete

  14. #14
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    I made that function.

    I have the DB with items.

    Code:
    void CClientSession::GetItem(RwInt8 Place, RwInt16, Pos)
    {
    	if (!Pos) {
    		app->db->prepare("SELECT * FROM items WHERE CharID = ? AND Place = ?");
    		app->db->setInt(1, m_iCharID);
    		app->db->setInt(2, Place);
    		app->db->execute();
    		app->db->fetch();
    	}
    	else {
    		app->db->prepare("SELECT * FROM items WHERE CharID = ? AND Place = ? AND Pos = ?");
    		app->db->setInt(1, m_iCharID);
    		app->db->setInt(2, Place);
    		app->db->setInt(3, Pos);
    		app->db->execute();
    		app->db->fetch();
    	}	
    }

  15. #15
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    how did the client get the item?

  16. #16
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    I send the GU_OBJECT_CREATE and in GU_OBJECT_CREATE i don't see any hItem.

    Code:
        CNtlPacket packet(sizeof(sGU_ITEM_CREATE));
        sGU_ITEM_CREATE * res = (sGU_ITEM_CREATE *)packet.GetPacketData();
    
    
        res->wOpCode = GU_ITEM_CREATE;
        res->handle = AcquireSerialId();
        res->sItemData.itemNo = pNewbieTblData->aitem_Tblidx[i];
        res->sItemData.byPlace = CONTAINER_TYPE_EQUIP;
        res->sItemData.byPosition = pNewbieTblData->abyPos[i];
        res->sItemData.byRank = ITEM_RANK_NORMAL;
        res->sItemData.byStackcount = 0;
        res->sItemData.byCurrentDurability = 100;
        res->sItemData.byGrade = ITEM_GRADE_LEVEL_4;
        res->sItemData.itemId = i;
    
    
        packet.SetPacketLen(sizeof(sGU_ITEM_CREATE));
        int rc = g_pApp->Send(this->GetHandle(), &packet);
        // app->UserBroadcastothers(&packet, this);
    The only i saw most close to SerialNumber of Item is this.

    res->sItemData.itemId

    But doesn't work, i use this way for example.

    res->sItemData.itemId = 4

    and hSrcItem i set 4 and doesn't work...

  17. #17
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    AcquireSerialId();

    is your itemserial or handle, this information should be save and should also be in your database along whit the item idx and item options

  18. #18
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    In itemId?

  19. #19
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    res->handle is hSrcItem

    it might not have to be in your database but the server should remember it at least for the session

  20. #20
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    res->handle is for THE SERIAL? i think that was for give the item to who.

  21. #21
    Don't quote me Arnie36 is offline
    MemberRank
    Jun 2006 Join Date
    207Posts

    Re: How to get hSrcItem

    its not a serial but a handle, I guess it just needs to be a unique number

  22. #22
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: How to get hSrcItem

    Work ;D, i think the handle was for to who give the item, now i know, i gonna to create a

    GetItemObject and save the object in the table :D

    - - - Updated - - -

    No, doesn't work, but i made a function to get the handle of id.

    - - - Updated - - -

    And now work.



Advertisement