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(net): support dynamic server endpoints using handover #2625

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

PichotM
Copy link
Contributor

@PichotM PichotM commented Jul 8, 2024

Goal of this PR

Allow the server to pass a specific endpoint using deferrals to a specific player.

How is this PR achieving the goal

  • Fetching handover json data and overriding the server's endpoints if an endpoint value exists in handover

This PR applies to the following area(s)

FiveM & RedM

Successfully tested on

Tested passing a custom endpoint

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.

Documentation about handover https://docs-backend.fivem.net/docs/scripting-manual/nui-development/loading-screens/

-- Server script
AddEventHandler('playerConnecting', function(_, _, deferrals)
    local source = source

    deferrals.handover({
        endpoints = { "127.0.0.1" }
    })
end)

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Jul 8, 2024
@prikolium-cfx
Copy link
Contributor

That's good feature and I like it, but issues that I can see now is that player will need to restart his game twice. First time because of game build change, and second time because of pureLevel change. Am I right?

@PichotM
Copy link
Contributor Author

PichotM commented Jul 23, 2024

That's good feature and I like it, but issues that I can see now is that player will need to restart his game twice. First time because of game build change, and second time because of pureLevel change. Am I right?

It will, except if you already are on the right build
I don't believe we can come up with a solution without changing the whole logic of the change-build stuff and doing it way later just like the second pure level check

@PichotM PichotM changed the title feat(net): support dynamic pureLevel and server endpoints feat(net): support dynamic server endpoints using handover Jul 24, 2024
@PichotM
Copy link
Contributor Author

PichotM commented Jul 24, 2024

PR updated to only support dynamic endpoints
(custom pure level has been dropped)

@prikolium-cfx prikolium-cfx added ready-to-merge This PR is enqueued for merging and removed triage Needs a preliminary assessment to determine the urgency and required action labels Jul 24, 2024
@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Jul 24, 2024
@PsychoShock
Copy link
Contributor

Doc will also be updated with the newest PR goal.

@prikolium-cfx prikolium-cfx merged commit d7646b1 into citizenfx:master Jul 29, 2024
10 of 18 checks passed
@racistnoob
Copy link

This might need looked into. Rarely some players just don't receive a pure mode switch pop-up and can load into a pure mode enabled server while their client isn't in pure mode.

Possibly reproducible by attempting to spam connect to a server and restarting fivem until you get connected without a pure mode switch pop-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants