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

[Enhancement] - Optimize decay #54

Merged
merged 15 commits into from Jan 6, 2022

Conversation

beats-dh
Copy link
Collaborator

@beats-dh beats-dh commented Sep 29, 2021

Co-Authored-By: Jakub @SaiyansKing jakubkubina@hotmail.com
From: https://github.com/opentibiabr/optimized_forgottenserver/tree/master

Reworked the decay, so the problems with the CPU spike are over, as well as other problems with the decay, like some items resetting the duration when equip/deequip.

New functions:
Game::stopDecay(item)
Container::stopDecaying()
DepotChest::isRemoved()
DepotLocker::isRemoved()
Inbox::isRemoved()
Item::stopDecaying()

From function:
decreaseDuration(time)
To:
setDurationTimestamp(timestamp)

New file decay.cpp/h
Decay::startDecay(item, duration)
Decay::stopDecay(item, timestamp)
Decay::checkDecay()

New attribute: ITEM_ATTRIBUTE_DURATION_TIMESTAMP

@beats-dh beats-dh changed the title Optimized new decay algorithm [Enhancement] - Optimize decay Oct 4, 2021
@Costallat Costallat force-pushed the master branch 27 times, most recently from 40b5a98 to 88b2e44 Compare October 6, 2021 02:27
@dudantas dudantas marked this pull request as draft November 2, 2021 21:10
src/creatures/creature.cpp Outdated Show resolved Hide resolved
src/game/game.cpp Outdated Show resolved Hide resolved
src/game/game.cpp Outdated Show resolved Hide resolved
beats-dh and others added 13 commits December 7, 2021 02:03
Co-Authored-By: Jakub <38609240+SaiyansKing@users.noreply.github.com>

fix location decay.cpp
Co-Authored-By: Jakub <38609240+SaiyansKing@users.noreply.github.com>
Co-Authored-By: Jakub <38609240+SaiyansKing@users.noreply.github.com>
Co-Authored-By: Jakub <38609240+SaiyansKing@users.noreply.github.com>
Co-Authored-By: Jakub <38609240+SaiyansKing@users.noreply.github.com>
Co-Authored-By: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
UPDATE
@beats-dh beats-dh force-pushed the Optimized-new-decay-algorithm branch from bb98e96 to cfeddb7 Compare December 7, 2021 06:07
@dudantas dudantas marked this pull request as ready for review January 5, 2022 23:08
@opentibiabr opentibiabr deleted a comment from sonarcloud bot Jan 5, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jan 5, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 45 Code Smells

0.0% 0.0% Coverage
6.6% 6.6% Duplication

@dudantas dudantas merged commit fd6e7fb into opentibiabr:master Jan 6, 2022
@beats-dh beats-dh deleted the Optimized-new-decay-algorithm branch January 6, 2022 22:18
luan pushed a commit that referenced this pull request Jul 11, 2023
Co-Authored-By: Jakub @SaiyansKing jakubkubina@hotmail.com
From: https://github.com/opentibiabr/optimized_forgottenserver/tree/master

Reworked the decay, so the problems with the CPU spike are over, as well as other problems with the decay, like some items resetting the duration when equip/deequip.

New functions:
Game::stopDecay(item)
Container::stopDecaying()
DepotChest::isRemoved()
DepotLocker::isRemoved()
Inbox::isRemoved()
Item::stopDecaying()

From function:
decreaseDuration(time)
To:
setDurationTimestamp(timestamp)

New file decay.cpp/h
Decay::startDecay(item, duration)
Decay::stopDecay(item, timestamp)
Decay::checkDecay()

New attribute: ITEM_ATTRIBUTE_DURATION_TIMESTAMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants