Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Ingame error, ZPostRequest on OnStageLeave

Experienced Elementalist
Joined
Jul 4, 2008
Messages
224
Reaction score
47
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.

cG9N2US - Ingame error, ZPostRequest on OnStageLeave - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Jun 14, 2015
Messages
123
Reaction score
20
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
 
Upvote 0
Experienced Elementalist
Joined
Jul 4, 2008
Messages
224
Reaction score
47
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:
Upvote 0
Junior Spellweaver
Joined
Jun 14, 2015
Messages
123
Reaction score
20
Yeah having one big solution w/ all the projs can be pretty nice 8)

So, did you FIGURE OUT THE PROBLEM, friend?
 
Upvote 0
Experienced Elementalist
Joined
Jul 4, 2008
Messages
224
Reaction score
47
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.
 
Upvote 0
Junior Spellweaver
Joined
Jun 14, 2015
Messages
123
Reaction score
20
> 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
 
Upvote 0
Back
Top