🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Getting SignalR trip time

Started by
0 comments, last by Angus Hollands 9 years, 6 months ago

I'm making a signalr game where the clients cast spells that take time. A progress bar is displayed on the client while the command is sent to the server via signalr. The server will start a timer, but I want the timer time to be the action time minus the trip time so when the timer is finished on the server and I send the result back to the client, it's timer will be finishing up.

I can't see how to find the trip time of the signalr call though. Does anyone know how to do this OR how I can get something like this?

Advertisement

I'm not sure why you need to determine the trip time. Essentially, the client should start a timer - fixed at a constant "good enough value" to cover the RTT + calculation time, and the server should attempt to return any results as fast as possible. The client will simply wait until the timer elapses, then poll a queue for the returned result, apply and discard it.

You don't need to have the result arrive "exactly" on time, unless there is some-how potential for cheating.

This topic is closed to new replies.

Advertisement