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

Cache Battle Creation #7

Closed
Toxocious opened this issue Apr 3, 2022 · 1 comment
Closed

Cache Battle Creation #7

Toxocious opened this issue Apr 3, 2022 · 1 comment
Labels
battles Issues regarding the battle system refactor Desirable refactoring of the feature/script in the issue

Comments

@Toxocious
Copy link
Owner

Description

When a battle is created, cache unique data of the foe. Upon the battle being restarted, do a quick comparison of the battle creation cache to the unique data of the foe, and if the data is the same, use the cached data instead of performing additional (and unnecessary) database queries of the foe.

Details

Currently, a simple check of the foe's roster hash should suffice.

if ( $_SESSION['Absolute']['Battle']['Foe']['Roster_Hash'] === $Foe['Roster_Hash'] )
{
    // Use the existing session data to restart the battle.
}
else
{
    // Use the data stored in $Foe to restart the battle.
}
@Toxocious Toxocious added battles Issues regarding the battle system refactor Desirable refactoring of the feature/script in the issue labels Apr 3, 2022
@Toxocious
Copy link
Owner Author

Closing as manual implementation isn't necessary with the move to Smogon's Showdown Sim (#18)

@Toxocious Toxocious closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
battles Issues regarding the battle system refactor Desirable refactoring of the feature/script in the issue
Projects
Status: Done
Development

No branches or pull requests

1 participant