Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating /permit logic to be closer to retail by default #3138

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

gmriggs
Copy link
Collaborator

@gmriggs gmriggs commented Aug 20, 2020

Currently in ACE, when a player uses /permit to grant access to another player to loot their corpse, this permission remains in effect until it automatically expires after 1 hour, the permitter removes the permission, or the permittee logs out.

In retail, after the permittee opened a locked corpse of the permitter, their permission for other locked corpses of the permitter was revoked at that point.

There are a few details with this, thank you very much to the community for having a discussion about this in Discord for figuring out the details:

  • When a permittee opens/closes the locked corpse of a permitter, the corpse does not become available for anyone to access afterwards. Thus, it differs from the corpse owner opening/closing their corpse in this way. When a corpse owner opens/closes their corpse, it is then available for anyone to open afterwards.

  • However, when a permittee opens/closes a locked corpse of a permitter, even though the permitter is then removed from the permittee's LootPermissions table, the permittee still has access to repeatedly open/close the corpse they gained access to. With this combination of factors, the 'permitteeOpened' table was added to Corpse

  • The LootPermissions table remains stored on the permittees, same as it was before in ACE, which matches retail. If the permitter logs out, the permittee continues to have access to open 1 locked corpse. If the permittee logs out, they lose their granted permissions, same as in retail. Reference: http://acpedia.org/wiki/Death_and_Corpse_Commands

A new server option has also been added, permit_corpse_all, which defaults to false, as per retail. If the server operator wishes to restore previous behavior in ACE, where /permit grants access to all corpses instead of 1 corpse, this can be optionally set to True.

This PR also adds some logic that was possibly missing to Corpse.Close() for player corpses. After a corpse owner loots their own corpse (opener == victimId), the corpse should then supposedly become available for anyone to open afterwards.

TODO: when LootPermissions expires, a message was sent to the permittee that they no longer have access to loot the corpses of permitter. This would require some kind of LootPermissions_Heartbeat on the permittees. Find out if this message was sent only if the permissions expired naturally, or if it was also sent after successfully opening a permitted corpse.

This PR was tested programmatically via unit testing

@gmriggs gmriggs merged commit facc1a6 into ACEmulator:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants