0 votes

Godot version:
3.0

OS/device including version:
Windows 10

Issue description:
Hello all.
I'm a new Godot user and I'm experimenting the multiplayer API.

I didn't make a lobby like in most of the demos. So the server is always running, and clients connect to it.
When a client connects, a new entity is created for him and authority is granted.
This entity have some sync vars.
So far so good.

But when a second client connects, it immediately receives the state sync of the previous client entity even before the entities are created in this new client, resulting in errors...

Is there a way to ignore incoming packets if the client is in a "joining game" state?
Or buffer the packets and deliver to the target entity when it's instantiated?

Steps to reproduce:
I've made a little separation of concerns so far, so there is a MasterNetwork scene and a SlaveNetwork scene... Some files were divided in BaseClass/MasterClass/SlaveClass also.

I don't know if this is the best approach for Godot multiplayer development, but it's working so far. I would appreciate some feedback on this. Let me know if I'm not being Godotish, in terms of using the engine the way it's meant to be used.

https://github.com/gabrjt/godot-network

Download the project, open the server and client projects with 3 different Godot editors. (I use symlinks to keep them synchronized).
Don't forget to change the remote debugger port for each editor, and set the main scenes properly (NetworkMaster for server, NetworkSlave for clients)
Play them all.

Thanks!

asked Feb 14, 2018 in Engine by gabrjt (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.