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

API: Add hooks ED_Alloc() and ED_Free() #227

Merged
merged 9 commits into from
Oct 24, 2021

Conversation

DarthMan
Copy link
Contributor

Since people do not seem to care, I tried to add the hook myself, I am not sure if all is good but this should be.
So please control my work and merge it to the repository as soon as possible, because I need in emergency those hooks for some plugins I'm coding.
Also, if possible please:

  • Merge "Con_Printf" hook on ReHLDS repo.
  • Merge the other reapi hooks on reapi repo.
  • Make a public release for the two updated binaries.

Thanks!

@DarthMan
Copy link
Contributor Author

DarthMan commented Oct 22, 2021

EDIT: I removed the lines that I believe caused compilation errors from rehlds_api.h.

@SergeyShorokhov SergeyShorokhov changed the title API: Add hooks ED_Alloc and ED_Free API: Add hooks ED_Alloc() and ED_Free() Oct 23, 2021
@SergeyShorokhov SergeyShorokhov self-requested a review October 23, 2021 10:58
@SergeyShorokhov SergeyShorokhov added the Type: 🚀 enhancement Improvement or addition of a new feature. label Oct 23, 2021
@SergeyShorokhov
Copy link
Member

@DarthMan resolve conflicts please

@DarthMan
Copy link
Contributor Author

DarthMan commented Oct 23, 2021

@DarthMan resolve conflicts please

Sorry, I am not home for a few days, can't do anything about it now. But it's all about the SV_EmitPings and the SV_Connect whatever additions to the files, I guess.

@SergeyShorokhov
Copy link
Member

@DarthMan I got you. No problem, I'll update it myself.

@DarthMan
Copy link
Contributor Author

@DarthMan I got you. No problem, I'll update it myself.

Sure, sounds good.

@SergeyShorokhov SergeyShorokhov force-pushed the HOOK-ED_Alloc-and-ED_Free branch from 85b29dc to 8e421a1 Compare October 24, 2021 11:57
@SergeyShorokhov SergeyShorokhov merged commit 866295f into rehlds:master Oct 24, 2021
@SergeyShorokhov
Copy link
Member

Can someone explain to me what is the practical meaning of the ED_Alloc hook for AMXX? We can't prevent the call, and we can't influence the entity at the moment of creation.

@DarthMan
Copy link
Contributor Author

@wopox1337 it's called when an entity is created. I use it in a plugin as post to add entity to array list, then on ED_Free post I check if it's in the array list, then I remove it from there if so. It's very usefull, as this way I can make sure that the entity id was valid before the entity got removed, and is not just a random number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: 🚀 enhancement Improvement or addition of a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants