-
Notifications
You must be signed in to change notification settings - Fork 629
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
🔨 EntityId
tracking structure
#6167
Comments
I'm not sure if it's even possible to stop people from taking references/pointers to objects. We wouldn't even want std::optional. We'd need:
|
Does this mean we'll move all entities out of Zone->ZoneEntities? Unknown. |
Creation/lookup/removal of these tokens needs to be constant time. It needs to proliferate into Lua |
Partially related to: #5065 |
A small place we could road-test this is |
We also already have someone's attempt at this: // TODO:it is possible to make this structure part of the class, instead of the current ID and Targid, but without the Clean method
struct EntityID_t
{
void clean()
{
id = 0;
targid = 0;
}
uint32 id;
uint16 targid;
}; |
Partially here: #6392 |
I affirm:
Describe the feature
A recurring theme of the server is the caching/looking up of pointers to invalid/gone entities. As much as I like to harp on about the abuse of DEs, invalid pointers to Pets and Trusts are still possible, so it is a legitimate problem. We need a mechanism to safely hold references to entities that might no longer exist when you try to look them up.
TODO: A global (per process) tracker of entities.
TODO: Lookup mechanism.
TODO: On entity destruction, look up your own lookup entry and invalidate it.
The text was updated successfully, but these errors were encountered: