| 08-17-2006, 12:31 PM | #1 | |
Quote:
I've been wondering how the guy did this. If you only run the sync functions for 1 player wouldnt that cause a desync? Also, how does he meassure the time? A timer? |
| 08-17-2006, 12:55 PM | #2 |
My guess is that he measures the time for LocalPlayer and then Syncs the time measured |
| 08-17-2006, 01:24 PM | #3 |
But im wondering how he meassures the time for localplayer. I dont really need to sync the time afterwards since im just gonna display it ingame (which shouldnt desync right?) |
| 08-17-2006, 03:07 PM | #4 |
He may just have started a timer at 0.00 game time and then GetTimerElapsed(). He may also have used the jAPI GetTicks native with a loader. |
| 08-17-2006, 06:24 PM | #5 |
So then, this should be correct? JASS:function PingPlayer takes player p returns real local timer t = CreateTimer() local real r call StoreInteger(GC(), "a", "a", 1) call TimerStart(t, 10., false, function CleanPingTimer) if GetLocalPlayer() == p then call TriggerSyncStart() call SyncStoredInteger(GC(), "a", "a") call TriggerSyncReady() endif set r = TimerGetElapsed(t) set t = null return r endfunction And it should return 0.00 for all other players than the one being pinged. If this is correct so far then I'd like to know how to make player2 aware of player1's delay, how could I sync the real value? Edit: this function desyncs, which I thought it would :( any ideas? |
| 08-17-2006, 09:43 PM | #6 |
the only way known to reliably transmit information is via SyncSelections Transform the real into 12 bit fixed precision and then search around for Mike's optimized Sync12BitInteger. |
| 08-18-2006, 11:18 AM | #7 |
I tried that... JASS:set udg_Latency[i] = Sync12BitInteger(Player(i), R2I(PingPlayer(Player(i)) * 1000)) But it still desyncs... Any idea how to fix? |
| 08-18-2006, 12:31 PM | #8 |
Delay returns to wrong local player. |
| 08-18-2006, 05:31 PM | #9 |
Erm, as always, I dont see your point. Be more clear please. |
| 08-19-2006, 01:51 AM | #10 |
if GetLocalPlayer() == p then call TriggerSyncStart() call SyncStoredInteger(GC(), "a", "a") call TriggerSyncReady() Sync with others localy.... |
| 08-19-2006, 01:18 PM | #11 | ||
Quote:
Quote:
|
