SendOpenSpecialContainer bug?

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

SendOpenSpecialContainer bug?

Post by Yukiko »

Almost every .openpack command or variants thereof I have seen uses SendOpenSpecialContainer to display the contents of a character's backpack. The issue with using this function call to show a player's backpack is that when you do this the backpack on the player's paper doll goes invisible and will not reappear in the paper doll until the player logs out and back in again. Closing and reopening the paper doll has no effect. As any one with any GM experience knows there are occasions when it is necessary to perform a clandestine inspection of a player's pack. If your .openpack or .info command uses SendOpenSpecialContainer I suggest switching it to SendViewContainer. This has the disadvantage of requiring you to be close to the character if you need to manipulate items in their pack but it will not cause their backpack to disappear from their paper doll.

Back to SendOpenSpecialContainer. The docs say:

Code: Select all

Normally only used to show "inaccessable" containers like bankboxes.
If used on normal containers, it allows the character to both view and
change the contents. See SendViewContainer().
This does not explain why the container disappears though. This issue has existed for some time and I cannot remember ever seeing a post about it. So is this a bug with the Core or perhaps a client issue?
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SendOpenSpecialContainer bug?

Post by Yukiko »

Further testing on this, if SendOpenSpecialContainer is used on any container, the container disappears but if you walk out of range of the container and walk back it will be visible.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: SendOpenSpecialContainer bug?

Post by CWO »

From what I remember at least with bankboxes, when they were opened, the container's XYZ was changed to where the player is at. I'm wondering if the core is moving the container to you which makes it remove the container from its original location (and from view) but then putting it back but not sending a command to the client to redraw. Don't mind me though, I'm trying to throw something completely off the top of my head from about 10 years ago and making assumptions :D
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SendOpenSpecialContainer bug?

Post by Yukiko »

Yeah it seems like you might be on the right track. Maybe the UpdateItem function call after SendOpenSpecialContainer would be a temporary fix.

Hmm. On second thought that might not work if the item's X, Y, and Z were changed to a different location. I will have to test this.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SendOpenSpecialContainer bug?

Post by Yukiko »

I performed some tests and here are my results.

UpdateItem had no effect on the disappearing container and backpack. They still remained invisible.

Then I tried UpdateMobile. With UpdateMobile( mobile, UPDATEMOBILE_UPDATE ) they still remain invisible. However with UpdateMobile( mobile, UPDATEMOBILE_RECREATE ) the backpack does not stay invisible but a container on the ground does not become visible.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: SendOpenSpecialContainer bug?

Post by CWO »

so the type of chop-shop solution I would do...

Code: Select all

SendOpenSpecialContainer(who, bag);
If(bag.container.isA(POLCLASS_MOBILE))
  UpdateMobile(bag.container, UPDATEMOBILE_RECREATE)
else
  //Build and send a draw packet to put it back
endif
Have you also tried forcing it by making the item invisible and visible again? Where is the item located when you update it? Was it moved back yet?
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SendOpenSpecialContainer bug?

Post by Yukiko »

I hadn't thought about making the item invisible and visible again after the SendOpenSpecialContainer. That might work. The UpdateMobile call works for the backpack as long as you use the UPDATEMOBILE_RECREATE flag. I'll test the invisible/visible option with a container not equipped on a character.

My tests were with a crate on the ground and an equipped backpack. So I guess updating the mobile literally only updates only the mobile. I had hoped that it would also update items near the mobile as well.

Well, more tests are in order although I originally just wanted to keep the backpack visible to the player whose backpack I had opened and I solved that problem. Now I am curious about how to solve it for non equipped containers.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: SendOpenSpecialContainer bug?

Post by Yukiko »

CWO you are absolutely correct about SendOpenSpecialContainer moving the container, if it is not equipped on a character, to the location of the character invoking the command. For some reason I did not notice that the crate I was targeting was being moved from its original location to my location. But it was me doing the testing. So... you draw your own conclusions. :D

So making the container invisible then visible is a moot point.

At least the hidden backpack is solved! That is the most important thing. Now we staff can snoop on the players without being detected if we need to.
Post Reply