How to communicate from clients to server?

Hello it’s my first time asking a question and I don’t really speak english, so I’m sorry if there’s some errors in my thread!

To explain the context;

I have 2 players connected on a LAN server with mirror (1 client and 1 client-server), they are in a minecart and need to push a button to make it accelerates. There’s a system of timing (they need to push each has their turn, if not it will decelerates).

My problem;

I don’t know how to make it. My idea is to send from each client an information to server that they are pushing and if so what’s their player number (it’s important for the timing, I already have their player number no problem), then the server would updates the speed of the minecart and just send it to the clients to make them moves their minecart

Any help would be appreciated, thanks for the effort!

Have a good day.

You need a networking solution to do the communication (or write one yourself). Here are a couple free ones that might be useful:

Darkrift

or

PhotonUnity