Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | maiervf |
Hello! I’m trying to setup an simple authentication server. All the comunication between server and clients work very well, but I’m having a problem when I try to send an RPC call and right after disconnect the peer.
The connection is closed before the RPC been sent (or before been finished, I dont know for sure) and the client not receive the response from the server. This is simple as that:
@rpc ("any_peer")
func authenticatePlayer(username, password):
var loged = false
var playerId = multiplayer.get_remote_sender_id()
if username == "test" and password == "123":
loged = true
authenticationResult(loged, playerId)
@rpc ("call_local")
func authenticationResult(loged, playerId):
rpc_id(playerId, "authenticationResult", loged)
multiplayer.disconnect_peer(playerId) <- seems like this run before the rpc
At the client, also very simple:
@rpc ("call_local")
func authenticatePlayer(login, password):
rpc_id(1, "authenticatePlayer", login, password)
@rpc ("authority")
func authenticationResult(loged):
print('here we go') <- those 2 lines are never printed
print(loged) <- those 2 lines are never printed
I receive the peer connected/disconnected signal on the client, only the last rpc(authenticationResult) that not arrives. Also no errors on inspector.
Any sugestions on what should I do?
Thanks!