• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Disconnecting! HELP! - Only for advanced jassers -

Status
Not open for further replies.
Level 13
Joined
Sep 13, 2010
Messages
550
JASS:
library LaggHooker initializer Lagghooker_init

    globals
        private sound LSF
        private real ESTSTUCKTIME = -1.0
        private real D = 1.0
        private integer RegF = 0
        private integer RegF2 = 0
    endglobals

    function GetFreezeTime takes nothing returns real
        if ESTSTUCKTIME > 0.0 then
            return ESTSTUCKTIME
        else
            return 0.0
        endif
    endfunction
    
    function TriggerRegisterFreeze takes trigger T returns event
        return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 3.0 )
    endfunction
    
    function TriggerRegisterAbsoluteGameFreeze takes trigger T returns event
        return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 4.0 )
    endfunction
    
    function TriggerRegisterFreezeEnd takes trigger T returns event
        return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 0.0 )
    endfunction
    
    function TriggerRegisterMinorLagg takes trigger T returns event
        return TriggerRegisterVariableEvent( T , SCOPE_PRIVATE + "D" , EQUAL , 2.0 )
    endfunction
    
    function hookLagg takes nothing returns nothing
        if not GetSoundIsPlaying( LSF ) then
            set RegF2 = RegF2 + 1
            if RegF2 > 3 then
                if ESTSTUCKTIME == -1.0 then
                    set ESTSTUCKTIME = 0.02
                    set D = 3.0
                    set D = 1.0
                else
                    if ESTSTUCKTIME < 10.0 then
                        set ESTSTUCKTIME = ESTSTUCKTIME + 0.08 + ESTSTUCKTIME / 40.0
                    else
                        set D = 4.0
                        set D = 1.0
                    endif
                endif
            endif
            set RegF = 0
        elseif ESTSTUCKTIME != -1.0 then
            set RegF = RegF + 1
            if RegF > 1 then
                set D = 0.0
                set D = 1.0
                set ESTSTUCKTIME = -1.0
                set RegF = 0
                set RegF2 = 0
            endif
        else
            if RegF2 > 1 then
                set D = 2.0
                set D = 1.0
            endif
            set RegF2 = 0
        endif
        call StopSound( LSF , false , false )
        call StartSound( LSF )
    endfunction
    
    function Lagghooker_init takes nothing returns nothing
        if GetExpiredTimer( ) == null then
            call TimerStart( CreateTimer( ) , 0.0 , false , function Lagghooker_init )
            set LSF = CreateSound( "Sound\\Music\\mp3Music\\Tension.mp3", false, false, false, 10, 10, "" )
            call SetSoundDuration( LSF , 100 )
            call SetSoundVolume( LSF , 0 )
        else
            call DestroyTimer( GetExpiredTimer( ) )
            call TimerStart( CreateTimer( ) , 0.06 , true , function hookLagg )
            call StartSound( LSF )
        endif
    endfunction

endlibrary
This is a system that registers FPS drop under 15( lagg ) and freeze etc shits. But since fps lagg and freeze commonly based on the players' computer specs what are not the same it desyncs. Soo I would ask someone to fix that desync. I DON'T NEED IDEAS! I NEED COMPLETE SOLUTION!

Reward ofc rep and shits.
 

Attachments

  • X.w3m
    82.6 KB · Views: 56
Level 17
Joined
Apr 27, 2008
Messages
2,455
That can't work, because if the player has turned off the wc3 sound, then the sound will not be played.
Try to find a better solution.

Plus, i'm not sure that fire a trigger locally work without any descyn, maybe opening a new thread locally desync by itself, like using a ForForce with an empty function argument in a local block. (if GetLocalPlayer() ...)

EDIT :

http://www.hiveworkshop.com/forums/...asy-way-sync-data-new-gethost-command-114475/

Not tested myself, problem is that you need to host to test, i can't.
Or have friends or slaves wc3 hosters, i have neither of them.

But i'm 100 % sure that you can use the sync native game functions in some way to sync local data, the main problem is that the sync is not instant, it's even quite delayed. (about several 1/10 of seconds in the best case).
I've also heard that the sync string function doesn't work at all (again, never tested myself)
You can also use dummy units and then select them with GetLocalPlayer, the event will fire for all pc and you will know each player has selected the unit (triggering player).
And that makes sense, because select events are already local and are synced if you think more about it.
However that seems way too overkill, and it's not silent, just use the sync game cache native functions.

More infos about sync stuff in this thread (read all the posts) :
http://www.hiveworkshop.com/forums/submissions-414/snippet-press-spacebar-event-213395/
 
Last edited:
Level 13
Joined
Sep 13, 2010
Messages
550
That can't work, because if the player has turned off the wc3 sound, then the sound will not be played.

I know :/


I know to sync values. :<

the main problem is that the sync is not instant, it's even quite delayed. (about several 1/10 of seconds in the best case).

And that is my problem with it. But did you know that if you sync 10 values instead one is a big time saving?

I've also heard that the sync string function doesn't work at all (again, never tested myself)

I had issues with that D:

Well it seems it will only work in single player >.>
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
I know to sync values. :<

I coudn't guess, because syncing data is the only way here, and you didn't even care to sync data in your code.
You have to play with jass limitations.
Also plz highlight me on the meaning of this smiley.

And that is my problem with it. But did you know that if you sync 10 values instead one is a big time saving?

It seems obvious that syncing only one value would be way faster than syncing X values.
Not sure i got what you meant here though.


Well it seems it will only work in single player >.>

If you don't sync local data, yes.
But except for the fun i don't get the usefulness of it, and sadly it can be broken so easily.
 
Status
Not open for further replies.
Top