Need vusion or someone can add AFK system help

Results 1 to 6 of 6
  1. #1
    Gunz General Develop Gun[Lengend] is offline
    MemberRank
    Jan 2010 Join Date
    Gunz Viet NamLocation
    312Posts

    Need vusion or someone can add AFK system help

    ZGame.cpp
    Code:
    void ZGame::OnGameResponseTimeSync(unsigned int nLocalTimeStamp, unsigned int nGlobalTimeSync)
    {
    	ZGameTimer* pTimer = GetGameTimer();
    	int nCurrentTick = pTimer->GetGlobalTick();
    	int nDelay = (nCurrentTick - nLocalTimeStamp)/2;
    	int nOffset = (int)nGlobalTimeSync - (int)nCurrentTick + nDelay;
    	pTimer->SetGlobalOffset(nOffset);
    	SetReadyState(ZGAME_READYSTATE_RUN);
    	
    	if(ZGetGame()->m_pMyCharacter->LastKeyTime + ((ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL || ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUELTOURNAMENT) ? 30000 : 18000) < timeGetTime())
    		ZApplication::GetGameInterface()->ReserveLeaveBattle();//Gun edit AFK
    }
    ZGameInput.cpp
    Code:
    	ZMyCharacter* pMyCharacter = ZGetGameInterface()->GetGame()->m_pMyCharacter;
    	if ((!pMyCharacter) || (!pMyCharacter->GetInitialized())) return false;
    
        ZGetGame()->m_pMyCharacter->LastKeyTime = timeGetTime();//Gun edit
    	////////////////////////////////////////////////////////////////////////////
    	switch(pEvent->nMessage){
    	case MWM_HOTKEY:
    ZCharacter.h
    Code:
    virtual bool IsGuard();
    	virtual void OnMeleeGuardSuccess();
        int LastKeyTime;//Gun edit AFK
    The //Gun edit comment to make me remember where i was edited in my source, not credit.
    The credit from Vusion.
    Please tell me i put it wrong ? Still not working


  2. #2
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: Need vusion or someone can add AFK system help

    For starters, remove this check from OnGameResponseTimeSync();
    Code:
    	if(ZGetGame()->m_pMyCharacter->LastKeyTime + ((ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL || ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUELTOURNAMENT) ? 30000 : 18000) < timeGetTime())
    		ZApplication::GetGameInterface()->ReserveLeaveBattle();//Gun edit AFK
    And find
    Code:
    void ZCombatInterface::OnDraw(MDrawContext* pDC)
    Scroll a little until you find this,
    Code:
    	if ( m_bShowResult)	// °á°ú È­¸é
    		return;
    Now, put this after it;
    Code:
    	if(ZGetGame() && ZGetGame()->m_pMyCharacter->LastKeyTime + ((ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL || ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUELTOURNAMENT) ? 30000 : 18000) < timeGetTime())
    		ZApplication::GetGameInterface()->ReserveLeaveBattle();//Gun edit AFK
    Note; little misplaced.

  3. #3
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Need vusion or someone can add AFK system help

    Quote Originally Posted by Vusion View Post
    For starters, remove this check from OnGameResponseTimeSync();
    Code:
    	if(ZGetGame()->m_pMyCharacter->LastKeyTime + ((ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL || ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUELTOURNAMENT) ? 30000 : 18000) < timeGetTime())
    		ZApplication::GetGameInterface()->ReserveLeaveBattle();//Gun edit AFK
    And find
    Code:
    void ZCombatInterface::OnDraw(MDrawContext* pDC)
    Scroll a little until you find this,
    Code:
    	if ( m_bShowResult)	// °á°ú È­¸é
    		return;
    Now, put this after it;
    Code:
    	if(ZGetGame() && ZGetGame()->m_pMyCharacter->LastKeyTime + ((ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL || ZGetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUELTOURNAMENT) ? 30000 : 18000) < timeGetTime())
    		ZApplication::GetGameInterface()->ReserveLeaveBattle();//Gun edit AFK
    Note; little misplaced.


    1 DOubt !!

    Does this AFK system crashes the game??? or my wrong implementation ?

  4. #4
    Gunz General Develop Gun[Lengend] is offline
    MemberRank
    Jan 2010 Join Date
    Gunz Viet NamLocation
    312Posts

    Re: Need vusion or someone can add AFK system help

    I think it not have error, and the function not make crash a game.. hmmm i will try and say to you ok :D

    Hmm. It only work in the first time. Then i rejoin and wait... and wait... nothing happen @@!

  5. #5
    Hi, I'm Omar! Vusion is offline
    MemberRank
    Jan 2011 Join Date
    HereLocation
    1,658Posts

    Re: Need vusion or someone can add AFK system help

    Quote Originally Posted by Gun[Lengend] View Post
    I think it not have error, and the function not make crash a game.. hmmm i will try and say to you ok :D

    Hmm. It only work in the first time. Then i rejoin and wait... and wait... nothing happen @@!
    Probably need to set LastKeyTime to timeGetTime() on game join.

  6. #6
    Gunz General Develop Gun[Lengend] is offline
    MemberRank
    Jan 2010 Join Date
    Gunz Viet NamLocation
    312Posts

    Re: Need vusion or someone can add AFK system help

    Probably need to set LastKeyTime to timeGetTime() on game join.
    I'm noob. So i don't know the way to do :D



Advertisement