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

tweak(ProcessClonePacket): add entityCreationFailed event #3143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kuuzoo
Copy link

@Kuuzoo Kuuzoo commented Feb 8, 2025

Goal of this PR

This PR aims to enhance the server's handling of scenarios where a entity cannot be spawned due to lockdown mode constraints.

How is this PR achieving the goal

This PR introduces a new server event, entityCreationFailed, which is triggered when a entity spawn attempt fails. The event provides detailed information about the failure, including:

---@param entity number The entity handle that failed to be created; Using this handle will not work, as the entity does not exist at this point.
---@param reason 'LockdownMode' | 'OnEntityCreate' | 'EntityValidation' The reason why the entity creation failed.
---@param playerId number The player ID that attempted to create the entity.
AddEventHandler('entityCreationFailed', function(entity, reason, playerId)
  print(('Entity creation failed: %s, player %s, reason %s'):format(entity, playerId, reason));
end);

This PR applies to the following area(s)

Server

Successfully tested on

Game builds: No relation to gamebuilds

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 8, 2025
@Kuuzoo Kuuzoo force-pushed the master branch 2 times, most recently from 2f35ca7 to 2e2b62e Compare February 8, 2025 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant