Jump to content

DerBooy

Inactive Member
  • Posts

    20
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by DerBooy

  1. How i have to change affect_flag.h to float?

    #ifndef IS_SET
    #define IS_SET(flag, bit)                ((flag) & (bit))
    #endif
    
    #ifndef SET_BIT
    #define SET_BIT(var, bit)                ((var) |= (bit))
    #endif
    
    #ifndef REMOVE_BIT
    #define REMOVE_BIT(var, bit)             ((var) &= ~(bit))
    #endif
    
    #ifndef TOGGLE_BIT
    #define TOGGLE_BIT(var, bit)             ((var) = (var) ^ (bit))
    #endif
    
    struct TAffectFlag
    {
    	DWORD bits[2];
    
    	inline TAffectFlag() { bits[0] = 0; bits[1] = 0; }
    	inline TAffectFlag(float v1, float v2 = 0) {bits[0] = v1; bits[1] = v2;}
    
    	inline bool IsSet(int flag) const
    	{ 
    		if (AFF_BITS_MAX <= flag || 0 >= flag)
    			return false;
    
    		return IS_SET(bits[(flag - 1) >> 5], (((DWORD)1) << ((flag - 1) & 31))); 
    	}
    
    	inline void Set(int flag)
    	{
    		if (AFF_BITS_MAX <= flag || 0 >= flag)
    			return;
    
    		SET_BIT(bits[(flag-1)>>5], (((DWORD)1)<<((flag-1)&31))); 
    	}
    
    	inline void Reset(int flag)
    	{
    		if (AFF_BITS_MAX <= flag || 0 >= flag)
    			return;
    
    		REMOVE_BIT(bits[(flag-1)>>5], (((DWORD)1)<<((flag-1)&31)));
    	}
    
    	inline TAffectFlag& operator = (const TAffectFlag& rhs)
    	{
    		bits[0] = rhs.bits[0];
    		bits[1] = rhs.bits[1];
    		return *this;
    	}
    };
    
    inline bool operator == (const TAffectFlag& lhs, const TAffectFlag& rhs)
    {
    	return lhs.bits[0] == rhs.bits[0] && lhs.bits[1] == rhs.bits[1];
    }
    
    inline bool operator != (const TAffectFlag& lhs, const TAffectFlag& rhs)
    {
    	return !(lhs == rhs);
    }

     

  2. item_manager_read_tables.cpp: In member function 'bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char*)':
    item_manager_read_tables.cpp:627: warning: 'pkGroup' may be used uninitialized in this function
    ../../../Extern/include/cryptopp/misc.h: At global scope:
    ../../../Extern/include/cryptopp/misc.h:548: warning: 'std::string CryptoPP::StringNarrow(const wchar_t*, bool)' defined but not used
    linking ../game_r40267_64....
    linking ../test
    /usr/bin/ld: skipping incompatible ../../../Extern/lib/libthecore.a when searching for -lthecore
    /usr/bin/ld: skipping i/usr/bin/ld: skipping incompatible ../../../Extern/lib/libthecore.a whncompatible ../../libthecore/lib/libthecore.a when searching for -lthecore
    en searching for -lthecore
    /usr/bin/ld: cannot find -lthecore
    /usr/bin/ld: skipping incompatible ../../libthecore/lib/libthecore.a when searching for -lthecore
    /usr/bin/ld: cannot find -lthecore
    gmake: *** [Makefile:132: ../test] Error 1
    gmake: *** Waiting for unfinished jobs....
    gmake: *** [Makefile:128: ../game_r40267_64] Error 1
  3. I made this like the tutorial here in metin2dev

     

    bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
    {
        if (ch->m_kAttackLog.dwVID == victim->GetVID())
        {
            if (current_time - ch->m_kAttackLog.dwTime < GET_ATTACK_SPEED(ch))
            {
                INCREASE_SPEED_HACK_COUNT(ch);
     
                if (test_server)
                {
                    sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
                            ch->GetName(),
                            current_time - ch->m_kAttackLog.dwTime,
                            GET_ATTACK_SPEED(ch),
                            ch->m_speed_hack_count);
     
                    ch->ChatPacket(CHAT_TYPE_INFO, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d",
                            ch->GetName(),
                            current_time - ch->m_kAttackLog.dwTime,
                            GET_ATTACK_SPEED(ch),
                            ch->m_speed_hack_count);
                }
     
                SET_ATTACK_TIME(ch, victim, current_time);
                SET_ATTACKED_TIME(ch, victim, current_time);
                return true;
            }
        }
     
        SET_ATTACK_TIME(ch, victim, current_time);
     
        if (victim->m_AttackedLog.dwPID == ch->GetPlayerID())
        {
            if (current_time - victim->m_AttackedLog.dwAttackedTime < GET_ATTACK_SPEED(ch))
            {
                INCREASE_SPEED_HACK_COUNT(ch);
                if (ch->m_speed_hack_count > 100)
                {
    #ifdef ENABLE_SYSLOG_NOTICE
                    sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d",
                            ch->GetName(),
                            current_time - victim->m_AttackedLog.dwAttackedTime,
                            GET_ATTACK_SPEED(ch),
                            ch->m_speed_hack_count);
    #endif
    #ifdef ENABLE_SYSCHAT_NOTICE
                    ch->ChatPacket(CHAT_TYPE_INFO, "A hack was detected , close it!",
                            ch->GetName(),
                            current_time - victim->m_AttackedLog.dwAttackedTime,
                            GET_ATTACK_SPEED(ch),
                            ch->m_speed_hack_count);
    #endif             
    #ifdef ENABLE_BAN_WAITHACK              
                    DBManager::instance().Query("INSERT INTO log.wait_hack SET login='%s', nickname='%s', ip='%s', time=NOW(), map_index=%d, server='%s';",
          ch->GetDesc()->GetAccountTable().login, ch->GetName(), ch->GetDesc()->GetHostName(), ch->GetMapIndex(), g_stHostname.c_str());
    #endif
                    ch->GetDesc()->DelayedDisconnect(3);
                }
                 
                SET_ATTACKED_TIME(ch, victim, current_time);
                return true;
            }
        }
     
        SET_ATTACKED_TIME(ch, victim, current_time);
        return false;
    }
    

     

    Problem: Some of my Players ingame attacked in slow motion after a while and I dont know how to fix it.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.