Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Latency  (Read 1927 times)

0 Members and 1 Guest are viewing this topic.

Daffern

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Latency
« on: March 02, 2014, 02:55:34 pm »
Hi everyone. Im currently trying to make a multiplayer action game, and i figured it would be a good thing to measure latency somehow in order to place bulllets for example. Is there a way to measure latency in sfml?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Latency
« Reply #1 on: March 02, 2014, 03:00:11 pm »
No, but its relatively simple. Send a ping request from the client to the server and then time how long it takes for the server to respond with a pong. Of course you need to code on the server side to respond to ping commands with a pong response.  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Daffern

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: Latency
« Reply #2 on: March 03, 2014, 11:46:51 pm »
This is probably what i will do, Thanks!  :)