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

[Feature] Corpse Overhaul #3938

Merged
merged 24 commits into from
Feb 8, 2024
Merged

[Feature] Corpse Overhaul #3938

merged 24 commits into from
Feb 8, 2024

Conversation

fryguy503
Copy link
Contributor

@fryguy503 fryguy503 commented Jan 9, 2024

Corpse Overhaul

Changelog:

  • Player corpses now have two timers, one specific to the rezability of the corpse and the other to cover the overall rot timer of the player corpse.
  • The rezability timer is based on the online presence of the player/account and is not affected by being offline.
  • The rot timer is not affected by offline/online status and will count to the rot status of the corpse.
  • Corpses can be rezzed multiple times, however only the first rez that yeilds returned xp will be counted. Not other rez will return any xp. This allows for a "Poor mans COTH" as was used many times in the early eras.
  • All Corpse class private/protected member variables are all now prefixed with m_
  • Added Corpses logging category along with many debug logs
  • Removed LoadCharacterCorpseData
  • Removed LoadCharacterCorpseEntity
  • Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
  • All parameters that were prefixed with in_ have been dropped
  • Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
  • Regenerated repository character_corpses
  • Cleaned up many list iterators to use range based for loops
  • Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
  • General code cleanup
  • Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.

This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.

    if ($client->HasItemOnCorpse($item_id)) {
        return 1;
    }
    --corpse
    if self:HasItemOnCorpse(itemid) then
        return true
    end

Testing Completed:

  • Create a Corpse
  • Standard rezzing
  • Ghetto Coth (No Extra XP)
  • Rezzing after graveyard move
  • Divine Rez works as intended
  • No XP Rez (Corpse Call) does not give XP
  • Corpse Burying
  • Cross Instance Graveyard Corpse movement/Rezzing
  • DZ End/Quit Corpse Movement/Rezzing
  • Server Shutdown/Reinit DZ Corpse Movement/Rezzing

@fryguy503 fryguy503 force-pushed the feature/corpse_overhaul branch 3 times, most recently from 0647441 to bd21391 Compare January 14, 2024 16:00
zone/corpse.cpp Outdated Show resolved Hide resolved
zone/zonedb.cpp Outdated Show resolved Hide resolved
zone/client.h Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_packet.cpp Outdated Show resolved Hide resolved
zone/client_process.cpp Outdated Show resolved Hide resolved
zone/corpse.cpp Outdated Show resolved Hide resolved
zone/corpse.cpp Outdated Show resolved Hide resolved
zone/corpse.cpp Outdated Show resolved Hide resolved
zone/spells.cpp Outdated Show resolved Hide resolved
zone/spells.cpp Outdated Show resolved Hide resolved
zone/worldserver.cpp Outdated Show resolved Hide resolved
zone/worldserver.cpp Outdated Show resolved Hide resolved
world/zoneserver.cpp Outdated Show resolved Hide resolved
world/zoneserver.cpp Outdated Show resolved Hide resolved
world/zoneserver.cpp Outdated Show resolved Hide resolved
zone/attack.cpp Outdated Show resolved Hide resolved
zone/attack.cpp Outdated Show resolved Hide resolved
zone/corpse.cpp Outdated Show resolved Hide resolved
@fryguy503 fryguy503 force-pushed the feature/corpse_overhaul branch 2 times, most recently from 3ac5a41 to b671c90 Compare February 5, 2024 21:46
@Akkadius Akkadius marked this pull request as ready for review February 6, 2024 06:16
@Akkadius
Copy link
Member

Akkadius commented Feb 6, 2024

This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.

    if ($client->HasItemOnCorpse($item_id)) {
        return 1;
    }
    --corpse
    if self:HasItemOnCorpse(itemid) then
        return true
    end

Changelog

  • All Corpse class private/protected member variables are all now prefixed with m_
  • Added Corpses logging category along with many debug logs
  • Removed LoadCharacterCorpseData
  • Removed LoadCharacterCorpseEntity
  • Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
  • All parameters that were prefixed with in_ have been dropped
  • Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
  • Regenerated repository character_corpses
  • Cleaned up many list iterators to use range based for loops
  • Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
  • General code cleanup

When a server comes up, query the database for all corpses in an instance and bury them. This will allow players to recover lost corpses due to server down/up from Shadowrest.
@fryguy503
Copy link
Contributor Author

I have verified the following:

  • Create a Corpse
  • Standard rezzing
  • Ghetto Coth (No Extra XP)
  • Rezzing after graveyard move
  • Divine Rez works as intended
  • No XP Rez (Corpse Call) does not give XP
  • Corpse Burying
  • Cross Instance Graveyard Corpse movement/Rezzing
  • DZ End/Quit Corpse Movement/Rezzing
  • Server Shutdown/Reinit DZ Corpse Movement/Rezzing

Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.

@fryguy503 fryguy503 merged commit 772fed5 into master Feb 8, 2024
2 checks passed
@fryguy503 fryguy503 deleted the feature/corpse_overhaul branch February 8, 2024 04:02
@Akkadius Akkadius mentioned this pull request Feb 10, 2024
joligario added a commit to ProjectEQ/peqphpeditor that referenced this pull request Feb 11, 2024
joligario added a commit that referenced this pull request Apr 20, 2024
This fixes corpses "disappearing" by fixing the graveyard check. Prior to the corpse overhaul (#3938), moving corpses to graveyards was assumed successful and automatically removed from the process.

Note: Will open a separate issue for the graveyard timer handling.

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# Testing

Attach images and describe testing done to validate functionality.

Clients tested: RoF2

# Checklist

- [x] I have tested my changes
- [x] I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
- [x] I own the changes of my code and take responsibility for the potential issues that occur
This was referenced Apr 20, 2024
Akkadius pushed a commit that referenced this pull request Apr 21, 2024
This fixes corpses "disappearing" by fixing the graveyard check. Prior to the corpse overhaul (#3938), moving corpses to graveyards was assumed successful and automatically removed from the process.

Note: Will open a separate issue for the graveyard timer handling.

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# Testing

Attach images and describe testing done to validate functionality.

Clients tested: RoF2

# Checklist

- [x] I have tested my changes
- [x] I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
- [x] I own the changes of my code and take responsibility for the potential issues that occur
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.

3 participants