Support rpc()
and rset()
even the client is not connected to a server
#2728
Labels
rpc()
and rset()
even the client is not connected to a server
#2728
Describe the project you are working on
A multiplayer game where the client can also play offline, but connect to the server if it's online
Describe the problem or limitation you are having in your project
When I use the
remotesync
keyword and I'm the client I can't userpc
unless I'm connected to an actual server.A simple implementation would look like:
Client -> Users GUI
Server -> Remote server
Sometimes the server is offline, and in this case the user should still be able to play, just not be able to see other players.
If the server comes back online then I can sync everything up.
In general the syncing is the hardest part here, but it's important for my use case.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Currently I have to check if the user is connected before using
rpc
otherwise it won't work even withremotesync
The above will fail if the user is not connected to a server.
Because of this the following is required:
Where
Network.is_online()
looks like:This is cumbersome because it means duplication of hundreds of lines of code in the project.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Allow
rpc
forremotesync
even when the user has no connection to server.If this enhancement will not be used often, can it be worked around with a few lines of script?
See below...
I don't want to have each client become a host, although there might be a way for a client to switch between host and client modes based on a possible server connection.
Is there a reason why this should be core and not an add-on in the asset library?
This is GDscript core.
See also
The text was updated successfully, but these errors were encountered: