Skip to content

Conversation

@Vitroze
Copy link
Contributor

@Vitroze Vitroze commented Jun 8, 2025

The PlayerFullyConnected hook has been added to enable developers to ensure that the client receives the net. It will run only when the client is loaded.

Admittedly, on the wiki, there are solutions already proposed for PlayerInitialSpawn, but the addition of this hook will make it possible to use a single hook instead of each developer creating his own hook or function.

@noaccessl
Copy link
Contributor

Have you taken into consideration those who may forcefully attempt to remove that client-side hook in which you make the client send a net-message to the server that will mark that client as fully connected?

You can use https://wiki.facepunch.com/gmod/gameevent/OnRequestFullUpdate for the purpose you've intended. The Early Networking Example can be developed further in that direction.

@Vitroze
Copy link
Contributor Author

Vitroze commented Jun 9, 2025

Have you taken into consideration those who may forcefully attempt to remove that client-side hook in which you make the client send a net-message to the server that will mark that client as fully connected?

You can use https://wiki.facepunch.com/gmod/gameevent/OnRequestFullUpdate for the purpose you've intended. The Early Networking Example can be developed further in that direction.

Hello,
Thank you for reporting the problem. Now it's fixed, I've removed all client-server relationships in my program to avoid this kind of problem.

@Astralcircle
Copy link
Contributor

Looks very hacky and like something that should rather be implemented by the engine

@robotboy655 robotboy655 added the Addition The pull request adds new functionality. label Jun 25, 2025
@RaphaelIT7
Copy link
Contributor

The PlayerFullyConnected hook has been added to enable developers to ensure that the client receives the net

The client will already receive net messages reliably/net messages being lost in PlayerInitialSpawn doesn't seem to be a thing, though sending net messages in PlayerInitialSpawn can cause them to be received before the client has received any entities.
So, this instead would be useful to send net messages that depend on entities clientside/when the client needs to be fully loaded & had had received everything.

Currently OnRequestFullUpdate might be unreliable for servers because of Facepunch/garrysmod-issues#6465

I'd say that right now the first implementation with InitPostEntity & the client -> server networking would currently be the most reliable method until the issue with OnRequestFullUpdate would be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Addition The pull request adds new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants