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

Core/Quest: Quests related to events must be removed when the event ends #23259

Conversation

kuskmen
Copy link

@kuskmen kuskmen commented May 8, 2019

Changes proposed:

  • Removes all quests related to not active events from player's quest log.
    Target branch(es): 3.3.5/master
  • 3.3.5
  • master

Issues addressed: Closes #23123

Tests performed:
.event start 1
.quest add 11955
.event stop 1
relog twice

Known issues and TODO list: (add/remove lines as needed)

  • PlayerScript::OnLogin fires query that removes the quest for a character and only after second login quest is removed.
  • Kinda worried about performance issues, I mean it seems to me that this script might turn out to be overkill, open for suggestions.

Yanislav Vasilev added 2 commits May 8, 2019 23:44
@ccrs
Copy link
Member

ccrs commented May 8, 2019

I'd just integrate this into quest load/save system
and add a logic related to event ending -> remove current online players quests

@kuskmen
Copy link
Author

kuskmen commented May 9, 2019

I'd just integrate this into quest load/save system
and add a logic related to event ending -> remove current online players quests

Can you elaborate more, I am still not at the point where I can understand without giving more specific instructions :/

Where is this quest load/save system and how can I iterate over all online players?

@Kittnz
Copy link
Member

Kittnz commented May 9, 2019

This seems like a custom thing, i can't remember event quest getting removed when the event ended.

@Jildor
Copy link
Contributor

Jildor commented May 9, 2019

I don't know if this is blizz or not, but, onLogin seems bad idea for performance.
Maybe do a cleanup on startup server if a conf option is enable?

@jackpoz
Copy link
Member

jackpoz commented May 11, 2019

onLogin seems bad idea for performance.

well it depends on what code is being run and what impact it has

@ghost
Copy link

ghost commented May 12, 2019

This seems like a custom thing, i can't remember event quest getting removed when the event ended.

Fair point, neither can I (or is this a Mandela Effect, that we remember this incorrectly?).

@Killyana
Copy link
Member

When an event starts quests related to this event are reset, and the player can do this quests again.
So if he keep a quest from a chain it doesn't make cense to reward this quest then take the qeust that starts this chain.

@ghost
Copy link

ghost commented May 12, 2019

When an event starts quests related to this event are reset, and the player can do this quests again.
So if he keep a quest from a chain it doesn't make sense to reward this quest then take the quest that starts this chain.

Fair point, I didn't notice that the outcome would be that the event quest would be rewarded when removed.


enum GameEvents : uint16
{
GAME_EVENT_MIDSUMMER_FIRE_FESTIVAL = 1,
Copy link
Member

Choose a reason for hiding this comment

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

maybe a flag in the db would be better

public:
GameEventQuestCleanupScript() : PlayerScript("GameEventQuestCleanupScript") { }

void OnLogin(Player* player, bool /*firstLogin*/) override
Copy link
Member

@jackpoz jackpoz Aug 2, 2019

Choose a reason for hiding this comment

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

if we choose to keep the OnLogin() PlayerScript (note that each PlayerScript has a lot of hooks and even if empty, they add up), I would like you to profile a bit this code and find the most performant way to achieve the same result.
Maybe iterating the active player quests first, then check the game event mgr ? or maybe that's slow ? I have no clue.

Copy link
Member

Choose a reason for hiding this comment

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

any follow up on this ?

@ghost
Copy link

ghost commented Apr 7, 2020

@kuskmen : I hope you will be able to look into this PR of yours, now that there are some holidays ahead.

@kuskmen
Copy link
Author

kuskmen commented Apr 7, 2020

@illfated hehe quite some holidays ahead I admit, I am gonna have to re-read all the comments and see what this stage was left off. If you guys say we still need this I can do it asap.

@msoky
Copy link
Contributor

msoky commented Aug 8, 2020

@kuskmen could you check if there is sometnig needed to finish it?

@kuskmen
Copy link
Author

kuskmen commented Aug 14, 2020

I think I read somewhere that this is not blizzlike behaviour so I thought it should be canceled? Am I wrong?

@ghost
Copy link

ghost commented Aug 14, 2020

I am thinking maybe it would be better to move it first to the https://github.com/TrinityCore/TrinityCoreCustomChanges repository, let users play with it there for a while, then get it back here on 3.3.5 when it gets some more feedback after actual usage. What do you others think, is that a fair suggestion?

@jackpoz
Copy link
Member

jackpoz commented Sep 18, 2020

Closing this PR as it seems abandoned. Feel free to ask here to reopen it if anyone would like to work on it.

@jackpoz jackpoz closed this Sep 18, 2020
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

8 participants