ClienRPC from Server to clients and to itself included.

Hello I am upgrading my old network to the new unet.

The server is authorative server and doesn’t use any networkmanager. (What I mean is the input of a player goes to server, and server moves the character and send the input back to ALL players)
Right now it is working. I can listen the server.

Now I have problem at the character controlling part. Since it is an authorative server, the server owns all objects.

So I spawn it via NetworkServer.Spawn ( Client part is not finished ).
Now I have these function

    [ClientRpc]
    void RpcTest()
    {
        Debug.Log("Test");
    }

    [ClientRpc]
    void RpcOnMovementCalled(Vector3 receivedMoveVelocity) {
     
        networkReceiveMoveVelocity.x = Mathf.Clamp(receivedMoveVelocity.x, -1, 1);
        networkReceiveMoveVelocity.y = Mathf.Clamp(receivedMoveVelocity.y, -1, 1);
     
        if (nIdentity.isServer)
        {
            // we tell to clients they should update the position of the player first.
            RpcOnSyncPosCalled(transform.position, true);
        }
    }

Both doesn’t get fired on the server. Example if I try to execute RpcTest() it doesn’t print anything in the console. How can I do it? I don’t want make duplicated functions. Are there alternates? ( Let us first just ignore RpcOnMovementCalled() )

No solution for me or did you not understand me?
Just need something like RPCMode.All in UNet

I don’t know if there is something similar to RPCMode.All, but as a simple workaround you could just use the ClientRPC to forward a function call.
For instance, you could create a usual function which includes the stuff you want to execute on both server and clients.
On your server you just call this function so you have it executed on the server.
In addition, on the server, you can call a ClientRPC. Within the ClientRPC function you just include a function call pointing to the same function you have executed on the server before. As a result, the function is executed on both the server and all clients. However, of course, the execution on the clients will be a bit later due to the ClientRPC transmission delay. You could also pass a bool parameter to the function in order to detect if it was called by the server or by the ClientRPC.

// On server
DoSomething(true);
RpcDoSomething();

void DoSomething(bool fromServer)
{
  // put some code here
}

[ClientRpc]
void RpcDoSomething()
{
  DoSomething(false);
}