|
发表于 2008-5-10 16:45:06
|
显示全部楼层
那么报告下我的测试
在显示精度为0.0001下,triggersleep的测试为同步
个人认为比较重要的第一个测试很有意思
如lz所说,会出现有可能掉线,也可能不掉线的情况~
时差在0.005以上基本直接掉线
如果只是静静等触发制造单位,能够维持连线的,即使刷的很快,但是~如果玩家另外加入额外的干扰操作,极有可能指不定什么时候掉线,且有可能出现后遗灵异状况,比如我弄出过使游戏菜单失灵的
以下使用过的触发
[codes=jass]function isnothing takes nothing returns nothing
endfunction
function dosth takes nothing returns nothing
call CreateUnit(Player(0),'hfoo',0,0,0)
endfunction
function deplayer takes player p1,player p2 returns nothing
local timer t=CreateTimer()
local real ext=0
if GetLocalPlayer()==p1 then
set ext=0.1
elseif GetLocalPlayer()==p2 then
set ext=0.2
endif
call TimerStart(t,ext,false,function isnothing)
endfunction
function deplayer2 takes player p1,player p2 returns nothing
local timer t=CreateTimer()
local real ext=0
if GetLocalPlayer()==p1 then
set ext=1.126
elseif GetLocalPlayer()==p2 then
set ext=1.127
endif
call TimerStart(t,ext,false,function dosth)
endfunction
function debugTriggerSleepTime takes nothing returns nothing
local timer t =CreateTimer()
call TimerStart(t,GetRandomReal(1,2),false,null)
call TriggerSleepAction(GetRandomReal(0,1))
call PauseTimer(t)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,10,R2SW(TimerGetElapsed(t),5,5))
call DestroyTimer(t)
set t=null
endfunction
function Trig_syn_Actions takes nothing returns nothing
call deplayer2(Player(0),Player(1))
endfunction
//===========================================================================
function InitTrig_syn takes nothing returns nothing
set gg_trg_syn = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_syn, Player(0) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_syn, Player(1) )
call TriggerAddAction( gg_trg_syn, function Trig_syn_Actions )
endfunction
[/codes]
当然,如果是do nothing的,是没问题的
那么关于结论呐 |
|