Ingame error, ZPostRequest on OnStageLeave

Results 1 to 6 of 6
  1. #1
    Account Upgraded | Title Enabled! exercitus is offline
    MemberRank
    Jul 2008 Join Date
    247Posts

    Ingame error, ZPostRequest on OnStageLeave

    Hello. I have a small problem with a piece of code I have: When I call ZPostRequestEquipItem from ZGameClient::OnStageLeave, it shows a messagebox in game saying "You are not allowed to equip this item" after I exit a room..

    As you mightve guessed, I'm trying to (re)equip an item when the player leaves a room. Is there any other function that allows me to do this besides ZPostRequest, or should I perhaps place it somewhere else?

    Any help would be appreciated.

    Last edited by exercitus; 02-08-17 at 11:46 PM.


  2. #2
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: Ingame error, ZPostRequest on OnStageLeave

    Figure out why they're not allowed to equip it and resolve the issue? Seems like only three cases can generate MERR_CANNOT_EQUIP_ITEM as far as I can see: The item not being in the player's inventory/item list, the item's parts not being suitable for the requested slot, or the DB query failing, so I don't think it'll be that hard to figure out

  3. #3
    Account Upgraded | Title Enabled! exercitus is offline
    MemberRank
    Jul 2008 Join Date
    247Posts

    Re: Ingame error, ZPostRequest on OnStageLeave

    Quote Originally Posted by Keristrasza View Post
    Figure out why they're not allowed to equip it and resolve the issue? Seems like only three cases can generate MERR_CANNOT_EQUIP_ITEM as far as I can see: The item not being in the player's inventory/item list, the item's parts not being suitable for the requested slot, or the DB query failing, so I don't think it'll be that hard to figure out
    Thanks for responding. Visual Studio didn't find any references to MERR_CANNOT_EQUIP_ITEM nor to error code 20003. Could you tell me where you found those 3 cases?



    Edit/
    I only looked for it in the Gunz solution, turns out it's in MatchServer. Thank you, I'll take a look.
    Last edited by exercitus; 03-08-17 at 11:22 PM.

  4. #4
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: Ingame error, ZPostRequest on OnStageLeave

    Yeah having one big solution w/ all the projs can be pretty nice 8)

    So, did you FIGURE OUT THE PROBLEM, friend?

  5. #5
    Account Upgraded | Title Enabled! exercitus is offline
    MemberRank
    Jul 2008 Join Date
    247Posts

    Re: Ingame error, ZPostRequest on OnStageLeave

    Quote Originally Posted by Keristrasza View Post
    Yeah having one big solution w/ all the projs can be pretty nice 8)

    So, did you FIGURE OUT THE PROBLEM, friend?
    Yes, the item is not in the inventory (pItem == nullptr). I believe this has to do with the way ZPostRequestTakeoffItem and ZPostRequestEquipItem work.

    I am re-implementing room tags that have been released on RZ to get used to the GunZ Source. What I'm currently coding are room tags using this release as reference.) I believe this code is faulty; while it seems to work, it actually does not do what you expect it to.

    I'm not too knowledgable on clientsided/serversides, but my hunch is that it only removes the item clientsided (the return false statement). Serversided, TakeoffItem actually only takes off the item after you leave the room, not before as you would expect. This creates the illusion that the code is working properly.

    I tested this by trying it out with, and without the ZPRTakeoffItem. Even if ZPRTakeoffItem is not called, when joining the room, the player will not have that item equipped. The roomtag seems to work fine.

    However, the difference is seen only when you leave the room. Without ZPRTakeoffItem, the player will still have the ''removed'' item equipped. With calling ZPRTakeoffItem, the item will actually be unequipped.

    However, I still get an "Not in inventory" error. This means that between when ZPREquipItem is called on OnStageLeave, the item is not in the inventory. Ergo, ZPRTakeoffItem has not taken off the item yet.

    In short, this is the order that takes place:

    1. Player joins room
    2. ZCharacterItem::EquipItem is called. ZPRTakeoffItem is called.
    3. ZCharItem::EquipItem returns false (room modifier)
    4. Player is in the room
    5. Player leaves room
    6. OnStageLeave is called, ZPREquipItem is called.
    7. OnStageLeave returns
    8. ZPREquipItem returns with error: item not in inventory.
    9. ZPRTakeoffItem returns and removes item to inventory.

  6. #6
    Valued Member Keristrasza is offline
    MemberRank
    Jun 2015 Join Date
    128Posts

    Re: Ingame error, ZPostRequest on OnStageLeave

    > What I'm currently coding are room tags using this release as reference.

    That post doesn't even say where to place the changes and you haven't mentioned what you're actually trying to do or posted any code, so it's very unclear o.O I'm GUESSING you're trying to unequip stuff when the player joins a room with a roomtag, and then re-equipping when they leave?

    > Even if ZPRTakeoffItem is not called, when joining the room, the player will not have that item equipped.

    Doesn't that just mean it was never equipped in the first place?

    Anyway, you should probably test that you're correct about any of this by looking at the data instead of just forming successive guesses



Advertisement