function ASyncInt takes integer inp returns integer
local gamecache sync = InitGameCache( "null" )
local integer outp
call StoreInteger( sync , "1" , "1" , 0 )
call TriggerSyncStart( )
if inp == 0 then
call SyncStoredInteger( sync , "1" , "1" )
endif
call TriggerSyncReady( )
if inp != 0 then
call StoreInteger( sync , "1" , "1" , inp )
endif
call TriggerSyncStart( )
if inp != 0 then
call SyncStoredInteger( sync , "1" , "1" )
endif
call TriggerSyncReady( )
set outp = GetStoredInteger( sync , "1" , "1" )
return outp
endfunction
function ASyncBool takes boolean inp returns boolean
local gamecache sync = InitGameCache( "null" )
local boolean outp
call StoreBoolean( sync , "1" , "1" , false )
call TriggerSyncStart( )
if not inp then
call SyncStoredBoolean( sync , "1" , "1" )
endif
call TriggerSyncReady( )
if inp then
call StoreBoolean( sync , "1" , "1" , inp )
endif
call TriggerSyncStart( )
if inp then
call SyncStoredBoolean( sync , "1" , "1" )
endif
call TriggerSyncReady( )
set outp = GetStoredBoolean( sync , "1" , "1" )
return outp
endfunction