How fast do Syncvars synchronize?

I’m making an online 2-player Trading Card game.

At the start of the actual cardgame scene, the GameController sends an Rpc to both clients, asking them to send it their playerName and decklists, which are both saved locally as a simple string.

My Question is basically, when

myGui.SetPlayerData(resourceContainer.GetPlayerData());

is in the code, right below

clientController.RpcClientSendPlayerData();

will the function GetPlayerData() already return the data that is sent by the clients when RpcClientSendPlayerData is called?

Are Syncvards synched immidiately? Or will program wait until everything is synched before calling RpcClientSendPlayerData ?

Code Extracts:

(GameController, Server-only)

    clientController.RpcClientSendPlayerData();
    myGui.SetPlayerData(ResourceContainer.GetPlayerData());

(ClientController)

[ClientRpc]
public void RpcClientSendPlayerData()
{
    localPlayer.CmdPlayerSendPlayerData();
}

(Script on the local player, local player authority)

[Command]
public void CmdPlayerSendPlayerData()
{
        resourceContainer.SetPlayerData("host", myName, myDeckString);
}

(ResourceContainer)

[SyncVar]
string hostName;
[SyncVar]
string hostDeckString;

public void SetPlayerData(string player, string playerName, string deckString)
{
    if (player == "host")
    {
        hostName = playerName;
        hostDeckString = deckString;
    }
}

Thanks in advance!

I have barely worked with the new networking system. However syncvars are just “syntactical sugar”. Unity actually creates RPC methods to sync the content of those variables when you set them. So in your case i would say; no, you won’t see the update unless you have a damn fast connection and a slow PC ^^.

To address your question “How fast do Syncvars synchronize?”, well, how fast does a car go? The answer is: it depends on the car and on the road it drives on ^^.

However you can specify a “hook” in your syncvar attribute. Basically just the name of a method that should be executed whenever the value of the syncvar has changed on the client.

Something like that:

[SyncVar(hook="OnHostNameChanged")]
string hostName;

void OnHostNameChanged()
{
    // "hostName" has just received an update
}