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

feat(gamestate/server): serverEntityCreated event #2947

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3269,7 +3269,21 @@ auto ServerGameState::CreateEntityFromTree(sync::NetObjEntityType type, const st
{
std::unique_lock entitiesByIdLock(m_entitiesByIdMutex);
m_entitiesById[id] = entity;
}
}

const auto evComponent = m_instance->GetComponent<fx::ResourceManager>()->GetComponent<fx::ResourceEventManagerComponent>();

/*NETEV serverEntityCreated SERVER
/#*
* A server-side event that is triggered when an entity has been created by a server-side script.
*
* Unlike "entityCreated" the newly created entity may not yet have an assigned network owner.
*
* @param entity - The created entity handle.
#/
declare function serverEntityCreated(handle: number): void;
*/
evComponent->QueueEvent2("serverEntityCreated", { }, MakeScriptHandle(entity));

return entity;
}
Expand Down
Loading