ok now that i see how u intend to use those values, the answer is (respectfully): no, that's not good enough. Why? because let's say this game is played on LAN where it is reasonable to assume that rtt can be consistent for a given TCP connection (as u said that the game would be using TCP);
then if one player1's RTT is always approx 10ms and p2 is always approx 40ms, then player1 will always win, i'd wish i were player 1 ?;
..and playing on WAN is not going to be any better where winning will be based on whoever's random connection gives them the best rtt; that would not be fair play either;
the standard way that most sites do in this case is to check an amount of a user input data received within a time window:
for example, this is how the well known ebay site works ?:
With 6 or less seconds left (time window) to a closing auction, bids come in (user inputs) and the winner is the one who bid the highest (amount) before or during the closing time window (note: the winner is not the one who enters his/her bid the fastest)
so u could do something similar with yr rpc server:
- u could count all rpc calls (amount of button clicks per user: user inputs & amount) received within a time frame (time window)
- then whoever entered the most of clicks in this t-window wins
this way when a user has clicked, the generated rpc will be queued (and this gives a fair chance to both players);
so u should only count inputs received in this t-window until when the queue is empty (this way the only clock that you will use is the server clock to govern both players and the server itself like ebay ? )
remember: such game should be about giving each player a fair chance to win not a random chance nor favouring grease ?
u could then make your game interesting with various modes:
- menu mode 1: player wins if 10 clicks in the last 10ms
- mode2: player wins if 2 cars sent to server before time ends
- mode3: server buys beer if players draw
- …
Btw, network lag will always be an issue where it exists but at least u don't use it to decide in your calculations who loses or wins..
I hope that clears it a bit
have fun ?