Troll-Brain
You can change this now in User CP.
- Reaction score
- 85
I want to know how fast/slow is gamecache sync.
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.
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),"test",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.