Server Split

--Thanatos--

New Member
Reaction score
33
JASS:
function Hero_Revive_Actions takes nothing returns nothing

    local integer ownerId = 0
    local player  owner

    loop
        if revive[ownerId] != 0 then
            set revive[ownerId] = revive[ownerId] - 1
            call MultiboardSetItemValue (ReviveSlot[ownerId],I2S(revive[ownerId]))
            if  revive[ownerId] == 0 then
                set owner = Player       (ownerId)
                call ReviveHero          (Hero[ownerId],startX[ownerId],startY[ownerId],true)
                if GetLocalPlayer        () == owner then
                    call PanCameraTo     (startX[ownerId],startY[ownerId])
                    call ClearSelection  ()
                    call SelectUnit      (Hero[ownerId],true)
                    call SetUnitPosition (Hero[ownerId],startX[ownerId],startY[ownerId])
                endif
                call MultiboardSetItemValue (ReviveSlot[ownerId],"Alive")
            endif
        endif
        set ownerId = ownerId + 1
        exitwhen ownerId == 12
    endloop

    set owner = null

endfunction

//===========================================================================
function InitTrig_Hero_Revive takes nothing returns nothing
    set gg_trg_Hero_Revive       = CreateTrigger ()
    call TimerStart                              (CreateTimer(),1.,true,function Hero_Revive_Actions)
    call TriggerAddAction                        (gg_trg_Hero_Revive,function Hero_Revive_Actions)
endfunction


This cause all clients to DC out
when the revive was 0
anyone know the reason?
 

Hero

─║╣ero─
Reaction score
250
It could be because you revive the hero for only one player?
 

0zaru

Learning vJASS ;)
Reaction score
60
thats not the problem i think that the problem is this inside your GetLocalPlayer() if

You are setting a position for only the local player O.O

call SetUnitPosition (Hero[ownerId],startX[ownerId],startY[ownerId])

and maybe the select action too.
 

hell_knight

Playing WoW
Reaction score
126
If you set a point for only 1 player , I believe that causes a desync cause only 1 player has this point.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
As was said, simply move the SetUnitPosition out of the localplayer block:
JASS:
function Hero_Revive_Actions takes nothing returns nothing

    local integer ownerId = 0
    local player  owner

    loop
        if revive[ownerId] != 0 then
            set revive[ownerId] = revive[ownerId] - 1
            call MultiboardSetItemValue (ReviveSlot[ownerId],I2S(revive[ownerId]))
            if  revive[ownerId] == 0 then
                set owner = Player       (ownerId)
                call ReviveHero          (Hero[ownerId],startX[ownerId],startY[ownerId],true)
                if GetLocalPlayer        () == owner then
                    call PanCameraTo     (startX[ownerId],startY[ownerId])
                    call ClearSelection  ()
                    call SelectUnit      (Hero[ownerId],true)
                endif
                call SetUnitPosition (Hero[ownerId],startX[ownerId],startY[ownerId])
                call MultiboardSetItemValue (ReviveSlot[ownerId],"Alive")
            endif
        endif
        set ownerId = ownerId + 1
        exitwhen ownerId == 12
    endloop

    set owner = null

endfunction

//===========================================================================
function InitTrig_Hero_Revive takes nothing returns nothing
    set gg_trg_Hero_Revive       = CreateTrigger ()
    call TimerStart                              (CreateTimer(),1.,true,function Hero_Revive_Actions)
    call TriggerAddAction                        (gg_trg_Hero_Revive,function Hero_Revive_Actions)
endfunction
 

--Thanatos--

New Member
Reaction score
33
I realize

Yeah I bet it was because of the SetUnitPosition() was only for Local Player
Really Forgotten @_@
Thx
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top