Skip to content

Client Rpc invoked on the wrong client  #2651

@adham1177

Description

@adham1177

This template is for issues not covered by the other issue categories.
public void Bridge(int cardId , ulong number)
{
Debug.Log("Reached server 2");
ClientRpcParams clientRpcParams = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new List { 1 } } };
RevealOpponentCardClientRpc(cardId , clientRpcParams);
}
[ClientRpc]
public void RevealOpponentCardClientRpc(int cardId, ClientRpcParams clientRpcParams)
{
Debug.Log("Reached Client");
clientController.RevealOpponentCard(cardId);
}

When experimenting with these two functions, the "Bridge" function appears to be invoked twice at the server. Additionally, the "RevealOpponentCardClientRpc" should ideally be invoked twice at the client with ID 1, as a clientRpcParams with ID 1 is sent. However, there seems to be a discrepancy where the "RevealOpponentCardClientRpc" is executed once for client ID 1 and once for client ID 0. This behavior raises the question of why this is occurring. Can anyone provide insight into the possible reasons behind this phenomenon?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions