Could you test it on battle.net plz ?

Troll-Brain

You can change this now in User CP.
Reaction score
85
I want to know how fast/slow is gamecache sync.

JASS:
library SyncDatas initializer onInit

globals
    private trigger array Trig
    private gamecache array GC
    private timer array Tim
    private force Players
    private integer I
endglobals

private function Actions takes nothing returns nothing
    local integer i = I
    
    if GetLocalPlayer() == Player(i) then
        call StoreReal(GC[0],I2S(i),"0",GetCameraTargetPositionX())
    endif
    call TriggerSyncStart()
    
    if GetLocalPlayer() == Player(i) then
        call SyncStoredReal(GC[0], I2S(i), "0")
    endif

    call TriggerSyncReady()

    call BJDebugMsg("time elapsed == " + R2S(TimerGetElapsed(Tim[0])))
    call BJDebugMsg("data of Player( " + I2S(i) + ") == " + R2S(GetStoredReal(GC[0],I2S(i),"0")))
    call BJDebugMsg(" ")
endfunction

private function Callback takes nothing returns nothing
    set I = GetPlayerId(GetEnumPlayer())
    call TriggerExecute(Trig<i>)
endfunction

private function DoTheSync takes nothing returns nothing
    call ForForce(Players,function Callback)
    call TimerStart(Tim[0],10.,false,null)
endfunction

private function onInit takes nothing returns nothing
    local trigger trig = CreateTrigger()
    local integer i = 0
    
    call TriggerRegisterPlayerChatEvent(trig,Player(0),&quot;test&quot;,true)
    call TriggerAddAction(trig,function DoTheSync)
    set Players = CreateForce()
    set GC[0] = InitGameCache(SCOPE_PREFIX)
    set Tim[0] = CreateTimer()
    
    loop
    exitwhen i == 12
    
        if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i)) == MAP_CONTROL_USER then
            call ForceAddPlayer(Players,Player(i))
            set Trig<i> = CreateTrigger()
            call TriggerAddAction(Trig<i>,function Actions)
            
        endif
    
    set i = i+1
    endloop
    

endfunction

endlibrary</i></i></i>


I've tested it with 2 players and a good host, the needed time was 0.5 s.
Could you test it with as players as possible and with a host connection as crap as possible plz ?
And ofc give me the result.

Thx in advance.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
This syncs client's data to host? Not the other way around, correct?
No.
I sync all local data from each player, not only the host.
It works, i just want to know the needed time with more players than 2, or at least with a bad host connection.

I don't handle leavers yet, it's just a test anyway, not a snippet.
 

Sevion

The DIY Ninja
Reaction score
413
So. All local data from Player 1 (Blue) will get synced to Player 0 (Red) and all local data from Player 0 (Red) will get synced to Player 1 (Blue)?

Assuming Player 0 is host and Player 1 is client?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
In this sample, all players will get all camera target X of each other players on their machine.

Again the test is not to know if it works or not, it works.
But i want to know the needed time to sync it with a bad host.
 

Sevion

The DIY Ninja
Reaction score
413
Ah. Well I can't test then. I'm too good a host >_>

Anyways, I'm curious as to how this does that. AFAIK you can only sync clients to host.
 

Azlier

Old World Ghost
Reaction score
461
I don't think the timer is even ticking while the syncing is going on.

If it did, timers would be more inaccurate than they already are.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I don't think the timer is even ticking while the syncing is going on.

If it did, timers would be more inaccurate than they already are.
You think wrong, the TriggerSync block act like a TriggerSleepAction for all players.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top