As a developer, it is currently very hard to accurately get the time taken for a message to go from client to server without using a complex method, such as a master clock and a slave clock. A method like this repeated sends remote events from client and server to keep them in sync, however, this is quite inefficient.
An example of such can be seen here.
Developers may have to account for other factors as well, such as tick() being different on both client and sever (such as time zones). There is the potential this could be easily exploited by the client and if Roblox implemented it, it may be harder for exploiters to break (however, I am aware it is entirely possible that exploiters can just hold back their traffic to appear to have higher ping). So even if its not secure it will be extremely convenient to developers.
Use cases for this includes, but is not limited to:
- Preventing exploits; by being able to get what a client was doing at the exact time they were doing it, and acting an extra layer of anti-exploit reliability (reducing false-positives) as the server will be removing less players inaccurately.
- Hit detection; when a client notifies the server about a shot being fired and between the time it takes for the message to reach the server, other players may have already moved a reasonable distance for a hit detected on the client, to not be detected on the server. This is clearly, not ideal as many people have ping >50ms which is enough to start to cause problems. Essentially, by being able to use ping and storing player positions, the developer is able to get where the players would have been when the client told the server (like how Call Of Duty does it).
Adding this would be extremely convenient as developers will not have to hard code in a master clock and a slave clock on the server and all clients to be able to get the ping of each player which may not even be accurate. It would also remove the need of extra remote events which would reduce the amount of data being sent between clients and server reducing stress on the network and improving performance.
My proposed solution is to add a checkbox on the remote event object. This would only affect the server side. It would appear as such: .OnServerEvent:Connect(function(player, ping, ...)
and would default to false to keep scripts compatible.