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

Extended TimeLimit format (quest DB) #8116

Merged
merged 3 commits into from Mar 25, 2024
Merged

Conversation

Atemo
Copy link
Contributor

@Atemo Atemo commented Jan 26, 2024

  • Addressed Issue(s): -
  • Server Mode: Both
  • Description of Pull Request:

Extended TimeLimit format to support expiration time on a given day of the week.

Example

  - Id: 9419
    Title: Attack Sky Fortress Invading Prontera
    # The quest expires 3 days after being taken at 4am.
    TimeLimit: 3d 4h
  - Id: 5965
    Title: "[Standby] Devil's Special"
    # The quest expires every Monday at 4am.
    TimeLimit: Monday 4h

Note

TimeLimit should be reworked to be more user friendly - but this is not the meaning of this PR.

@Atemo Atemo added component:database A fault that lies within the database of rAthena mode:renewal A fault that exists within the renewal mode mode:prerenewal A fault that exists within the pre-renewal mode status:code-review Pull Request that requires reviewing from other developers before being pushed to master labels Jan 26, 2024
Copy link
Contributor

@aleos89 aleos89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this concept could use a revitalization since new formats keep being introduced!

@@ -453,7 +458,28 @@ static int split_exact_quest_time(char* modif_p, int* day, int* hour, int* minut
modif_p++;
while (modif_p[0] >= '0' && modif_p[0] <= '9')
modif_p++;
if (modif_p[0] == 's') {
if (modif_p[0] == 'S' && modif_p[1] == 'u' && modif_p[2] == 'n' && modif_p[3] == 'd' && modif_p[4] == 'a' && modif_p[5] == 'y') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use constant lookup?

/* days of the week */
export_constant(SUNDAY);
export_constant(MONDAY);
export_constant(TUESDAY);
export_constant(WEDNESDAY);
export_constant(THURSDAY);
export_constant(FRIDAY);
export_constant(SATURDAY);

If not then at least check strlen and use strncasecmp please.

@Atemo Atemo merged commit ed2d03d into rathena:master Mar 25, 2024
29 checks passed
@Atemo Atemo deleted the update/quest_db branch March 25, 2024 18:09
@Atemo Atemo removed the status:code-review Pull Request that requires reviewing from other developers before being pushed to master label Mar 25, 2024
Lemongrass3110 pushed a commit to Atemo/rathena that referenced this pull request Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:database A fault that lies within the database of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants