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

Update resourcemanager.cpp #425

Merged
merged 2 commits into from
Feb 16, 2023
Merged

Update resourcemanager.cpp #425

merged 2 commits into from
Feb 16, 2023

Conversation

Mrpox
Copy link
Contributor

@Mrpox Mrpox commented Feb 16, 2023

Adding some missing code to make function HTTP.download and HTTP.downloadImage work.
Files were not able to be found in virtual directory "/downloads"

I do believe its 100% needed if ever to build a updater.

HTTP.download and HTTP.downloadImage now works.
Files can be found in virtual direcotry "/downloads"
@mehah
Copy link
Owner

mehah commented Feb 16, 2023

Could you check these errors: d32016a

  • 'g_http': undeclared identifier
  • 'dfile': cannot be used before it is initialized
    thx

Fixed following errors:'g_http': undeclared identifier and 'dfile': cannot be used before it is initialized thx
@Mrpox
Copy link
Contributor Author

Mrpox commented Feb 16, 2023

Could you check these errors: d32016a

  • 'g_http': undeclared identifier

  • 'dfile': cannot be used before it is initialized

thx

Fixed

@mehah mehah merged commit e6bb4e0 into mehah:main Feb 16, 2023
dudantas pushed a commit that referenced this pull request Nov 17, 2023
This commit implements the Loyalty System based on the code from pull request #425 (Thanks @marcosvf132). The Loyalty System functionality is inspired by the loyalty system in Tibia (https://tibia.fandom.com/wiki/Loyalty_System).

Enhances the loyalty system with new configuration options, accurate tracking of premium days, and support for customizable bonuses. The Loyalty System introduces several new configuration keys that can be customized:

• loyaltyEnabled: Determines whether the loyalty system is enabled or not (default: true).
• loyaltyPointsPerCreationDay: Sets the number of loyalty points awarded per day of account creation (default: 1).
• loyaltyPointsPerPremiumDaySpent: Sets the number of loyalty points awarded per premium day spent (default: 0).
• loyaltyPointsPerPremiumDayPurchased: Sets the number of loyalty points awarded per premium day purchased (default: 0).
• loyaltyBonusPercentageMultiplier: Allows for customization of loyalty bonus strength (default: 1.0).

By default, the loyaltyPointsPerCreationDay is set to 1, providing 1 loyalty point per day since the account was created. This conservative default setting ensures a slow accumulation of loyalty points, similar to the original Tibia loyalty system. Server administrators can adjust these settings as needed.

To accurately track premium days spent, a new column was added to the accounts table, which stores the total number of premium days purchased on the account.

The implementation includes support for awarding loyalty points at the moment of VIP purchase. If a server uses a different mechanism for VIP, they can adapt the loyalty system accordingly.

The loyaltyBonusPercentageMultiplier allows administrators to adjust the strength of bonuses. The default settings are relatively mild, so this option provides flexibility. For example, to award a 10 skill bonus at around magic level or skill 120, the multiplier should be set to 4.0.

To ensure accurate calculations, a new library 'absl' was introduced. This enables precise calculation of bonuses as loyalty points are multiplied by the bonus percentage. This is necessary because only the current level's "tries" (or mana spent) are tracked, and calculations may exceed the limits of uint64_t.
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.

2 participants