Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sat, 18 Mar 2006 03:26:18 -0600,    group: microsoft.public.win32.programmer.directx.networking        back       


timers??   
How do timers work in Multiplayer. For example, If i have a timer in 
a the game to switch turns between players. Is there anything that 
needs to be done differently that one would do localy( as in C# 
timers for applications). I am not asking for code but some idea on 
how does one implement it practically so as not get problems with 
timers over Inetrnet. everybody has to see the same time left 
correctly in seconds. how does one synchronize. does it have to be 
on the server only?
Any words of wisdom?
Thanks :)
=======================
The Dude next door.

-- 
----------------------------------------------
Posted with NewsLeecher v3.0 Final
 * Binary Usenet Leeching Made Easy
 * http://www.newsleecher.com/?usenet
----------------------------------------------
date: Sat, 18 Mar 2006 03:26:18 -0600   author:   SUPERDU ()

RE: timers??   
"SUPERDU¼" wrote:

> How do timers work in Multiplayer. For example, If i have a timer in 
> a the game to switch turns between players. Is there anything that 
> needs to be done differently that one would do localy( as in C# 


Multiplayer is very different from single-player. If you have a server, you 
should make sure that the server verifies all data coming from each player, 
and breaks ties and enforces rules; else there will be cheating.

When it comes to synchronized timers, a typical solution is that each client 
attempts to measure the round trip time between the server and the client 
(RTT) and divide this by 2 to get an estimate of one-way latency. One way of 
doing that is to send your current time to the server, and have the server 
send it back; when you get it back, you compare your current time to the 
returned value, and divide the difference by two. There are more advanced 
systems, that take variance, server processing time, etc into account, too.

Once you have the server transmission latency measurement, the server can 
send a message saying "time T happens in 7200 milliseconds" and you can 
subtract the transmission latency (say, 100 milliseconds) to know that that 
time will be about 7100 milliseconds from when you received the message.

However, you can never be 100% sure that it's accurate, so your design has 
to account for the fact that someone might be late (or early). Be forgiving 
of small discrepancies, and disallow large discrepancies.
date: Mon, 24 Apr 2006 22:29:01 -0700   author:   Jon Watte, Microsoft DirectX MVP

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us