-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
chore(Core/AllMapScript) Update structure #19979
Conversation
I don't know why the tests fail. Because the compilation finished 100% without problems. |
is the CALL_ENABLED_HOOKS missing in other files too? maybe the refactoring was not complete |
In PlayerScript, I saw that it was modified, but not in this file, perhaps other files need to be modified. |
We could make a pull request to finish working on all of them, there would be no problem. It would take more time, I suppose, and some additional testing. Perhaps it would be better to divide the work and do it little by little, in case something had to be reverted. Also, if the change is very big, it is more difficult to test. |
Unless your comment refers to hooks inside these files, but which belong to other scripts, then yes, I would probably have to modify them, but I really could use an example, or someone else to help me by committing a commit on this same pull request. |
What I'm saying is that if without this macro all the other hooks are not
working, probably we should fix them all. But I'd like to ask the original
author because I'm not sure what's the problem here and I don't want to
make assumptions
@Winfidonarleyan @walkline ?
|
Sounds perfect to me. Let's wait for your reply then. |
I don't know why not work. Anyway, I don't like this system with selected hooks. |
The implementation should be fully backwards compatible, e.g. enabling all hooks of a script if the enable-vector was not provided. Also I would have expected that the AllMapScript should still have worked before this PR, as the changes are not necessary for it to work? It's just an optimization |
Here is the original PR: #18672, where you can find details about the problem it aims to solve. As @sudlud mentioned, the change is backward compatible, and AllMapScript should work as it is. However, without this change, it would remain unoptimized. I’m not sure why the CI is crashing, and I can’t debug it at the moment. If someone could provide a crash log, that would be helpful. |
Besides the CI crashing, why do you think @pangolp is experiencing this issue? If the old hooks are not working anymore, this is definitely a critical problem. Can someone double check and confirm this please? @Winfidonarleyan why you don't like it? What's your opinion? |
I don’t think there are any other issues, and I believe @pangolp used the wrong title (specifically the “fix” part) for this PR, as it is not addressing any bugs. |
Seems @pangolp is stating that without the new macro, the hooks are not being called at all. Which sounds like a bug to me. But I might misunderstood it |
You can use the CFPVE module, where we use the hook, and you'll see that it doesn't work, unless this change is made. https://github.com/pangolp/mod-cfpve |
That doesn't mean, the title of the pull request, maybe it's wrong. But before this change, the hook didn't work for me and I leave you the module to try it yourself or invoke it, to see if it works for you in any module of your own. |
@Yehonal @Winfidonarleyan @walkline @sudlud When I started working on this part of the code specifically class CfAllMapScript : public AllMapScript
{
public:
CfAllMapScript() : AllMapScript("CfAllMapScript") { }
void OnDestroyInstance(MapInstanced* /*mapInstanced*/, Map* map) override
{
QueryResult result = CharacterDatabase.Query("SELECT `factionID` FROM `mod_crossfaction_pve` WHERE `instanceID`={}", map->GetInstanceId());
if (result)
{
CharacterDatabase.DirectExecute("DELETE FROM `mod_crossfaction_pve` WHERE `instanceID`={}", map->GetInstanceId());
}
}
}; Notice that it was not running. So reviewing the file, I saw that the structure of Don't focus on the content of the module, because it is a temporary solution to a very specific bug that the crossfaction currently has, but there must be better ways to solve it, however, for now, we came up with that one. And on the other hand, the title may not be correct, so if someone wants to adapt it, they can do so without problems, so that it is more representative of the problem I am trying to present and correct. I look forward to any modifications and comments you make on this topic. Thanks in advance. |
In parallel, I would also like to know why the tests failed, why a compilation error, it seems that it is not. The fault seems to be elsewhere. @Helias, can you run the tests again please?, thank you. |
done 👍 |
I do understand what you are doing here. What I do not understand is if
these hooks were broken, most likely also the other ones that are not using
the new CALL_ENABLED_HOOKS might be broken.
This PR aims to fix a issue with a specific bug for your specific case, but
our interest as AC devs here is to also understand if this is a general
problem or not
Can someone test it? Also, it would be great to understand the exact reason
why it was not working if people are stating that the changes were backward
compatible.
I don't like to close this case and have possibly fixed/considered half of
the problem and forget about the remaing
…On Mon, Sep 16, 2024, 15:56 Stefano Borzì ***@***.***> wrote:
done 👍
—
Reply to this email directly, view it on GitHub
<#19979 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABD5FAKIHKCLX3BZPHRNRTZW3PQTAVCNFSM6AAAAABOIF53TWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJSHE4TSMZVG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
That seems fine to me. I am available to help with the solution. |
@PkllonG did you check your script before PR? So we know if there was actually an issue with allmapscript. |
Does it work without this pull request or did you have to use it to make it work? |
@pangolp the script you provided works fine on a35f0c4 (current master before this PR). so @PkllonG and myself have verified that there has been no general issue to AllMapScript. did you probably forget this on your first test runs:
(because that's an issue i just ran into while testing your AllMapScript.) |
It is included and I always used it, but hey, if they tried the hook and it worked, it would have been my problem I guess. void CfpveScripts()
{
new CfPlayerScript();
new CfAllMapScript();
new CfServerScript();
} |
Ok, thanks for checking. so, considering this, I have another question before approve/merge this PR: Is the new CALL_ENABLED_HOOKS intended to be used everywhere? If so, this PR might still be worth merging anyway to keep the code up to date, but at the same time, there should be no priority in converting all the other hooks for now What do you think |
I'm could keep working on this pull request. I just need to be told what to do, we change the title and we add more commits. I'm not in a hurry to merge it, it's not critical. But he needed some example maybe to finish the work, although I'll try to investigate something on my own. This is the first time I have made a change of this style. |
@Yehonal as @walkline mentioned, the enable-hooks-mechanic originated in #18627. the majority of scripts has been converted already (see referenced PRs in #18627) and there have been no issues so far that I know of. so the only remaining issue in this PR imo is the failing CI, maybe @pangolp can please merge latest master to ensure everything’s up to date? |
What is interesting is the module CI isn't crashing |
I'm going to check. But I think there's work to be done here anyway. I will also review the pull request that you mention. |
I'm going to review this as well. Thank you. |
😅 |
Yes, please, I tried it and it didn't work for me. That's why I created this pull request. |
I already tested it, it works, see my message above. @pangolp please do not tell several people to test the same thing again and again |
I didn't do it on purpose. Again, since I use a translator, sometimes I can't follow the threads of the conversations or I forget, because I have to use the translator again. The person offered, and I said yes. But I didn't do it with bad intentions. You could put a tested label if not, and people would already know that it was tested. |
The only bad thing is that I can't fix the failure in the tests. |
Does anyone know why this change is not passing the tests to try to fix it? Because it doesn't seem to be a compilation issue. |
This PR is in a stalemate. The CI is crashing on start up but (to my knowledge) we can't see the crash log produced. I have personally tested this PR and no crash is produced when starting up the server. We, however, cannot merge it with a broken CI. |
The question would be how to solve this problem... |
If the hook works and since we can't correct the problem in the tests, I think we should close this. |
It's crashing because you forgot to add AllMapScript here -
|
If that happens, I will travel personally and give you a hug haha. |
Co-authored-by: Anton Popovichenko <[email protected]>
Changes Proposed:
This PR proposes changes to:
Issues Addressed:
Tests Performed:
This PR has been:
How to Test the Changes:
How to Test AzerothCore PRs
When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].
You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:
http://www.azerothcore.org/wiki/How-to-test-a-PR
REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).
For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.