Jump to content

ds_aim

Banned
  • Posts

    442
  • Joined

  • Last visited

  • Days Won

    9
  • Feedback

    0%

Posts posted by ds_aim

  1. Just now, charparodar said:

     

    
    
     

    # For advice on how to change settings please see
    # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

    [mysqld]

    # Remove leading # and set to the amount of RAM for the most important data
    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    # innodb_buffer_pool_size = 128M

    # Remove leading # to turn on a very important data integrity option: logging
    # changes to the binary log between backups.
    # log_bin

    # These are commonly set, remove the # and set as required.
    # basedir = .....
    # datadir = .....
    # port = .....
    # server_id = .....
    # socket = .....

    # Remove leading # to set options mainly useful for reporting servers.
    # The server defaults are faster for transactions and fast SELECTs.
    # Adjust sizes as needed, experiment to find the optimal values.
    # join_buffer_size = 128M
    # sort_buffer_size = 2M
    # read_rnd_buffer_size = 2M 

    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

     

    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

    Delete this line restart mysql server and try again.

    • Love 1
  2. Setting the SQL Mode

    The default SQL mode in MySQL 5.6.6 and later is NO_ENGINE_SUBSTITUTION; in MySQL 5.6.5 and earlier, it was empty (no modes set).

    To set the SQL mode at server startup, use the --sql-mode="modes" option on the command line, or sql-mode="modes" in an option file such as my.cnf(Unix operating systems) or my.ini (Windows). modes is a list of different modes separated by commas. To clear the SQL mode explicitly, set it to an empty string using --sql-mode="" on the command line, or sql-mode="" in an option file.

     

    https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html

    • Metin2 Dev 1
  3. 16 minutes ago, Bituse said:

    It needs compiling...
    But thanks for your replay.

    And you want a precompiled dump_proto ? with those? lel

     

    People come here to ask for help .. nobody works for you. As I said, to make compatible do as I said. Modify the structure mob_proto for each ehchant and resist as in mob_proto client and dump_proto.

    I've helped you with the answer, but you have to do and a little effort and learn to compile alone dump_proto. If you do not try, you do not ever learn, and again you will come here for help. Belive me isn't so hard to compile dump_proto it take 10 seconds.

     

    Client side :

    Change mob_proto struct:  https://metin2.download/picture/xQk5b1dpC5Hogn6YEe86irkVECrOANYp/.png

    Change dumo_proto struct: https://metin2.download/picture/a9GNlUoIHvpBm7fN6UBu4lvdUC00px20/.png

    Server side :

    mob_proto struct :https://metin2.download/picture/344AVT939pmxu0Q1VZSj8MTgv8eOrjH6/.png

    After MOB_ENCHANT_PENETRATE add: MOB_ENCHANT_BLEEDING

    etc...

    After MOB_RESIST_POISON add : MOB_RESIST_CLAW  and MOB_RESIST_BLEEDING

    You need to look intro you mob_proto and add those in structs

    • Love 1
  4. 8 minutes ago, flatik said:

    Not work! ő.Ő

    My version: G++5, boost 1.5.8, lua51, libdevil 1.7.8, freebsd 10.3

    Edit:

    replace typeof with __typeof

    replace auto_ptr with unique_ptr

    what the problem? :(

    Char.h

    Find:     boost::unordered_map<VID, size_t> TargetVIDMap;

    replace with

    boost::unordered_map<DWORD, size_t> TargetVIDMap;

     

    Char_skill.cpp

    auto iterTargetMap = rSkillUseInfo.TargetVIDMap.find(TargetVID);

    • Love 1
  5. 18 minutes ago, RealReznov said:

    Why?


    input_main.cpp:3697: error: duplicate case value
    input_main.cpp:3692: error: previously used here
     

    https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

    enum PacketHeaders {

    HEADER_X,

    HEADER_Y,

    HEADER_Z,

    }

    The enum assign automaticaly a number intro data

    The real values is

    enum PacketHeaders {

    HEADER_X = 0,

    HEADER_Y = 1,

    HEADER_Z = 2,

    }

    You have 2 headers with same value, soo change header value or delete one of them

    Please read this too :  http://en.cppreference.com/w/cpp/language/enum

    The answer is easy now.

    • Metin2 Dev 1
    • Love 2
  6.  

     

     

    #include "stdafx.h"
    #include "constants.h"
    #include "log.h"
    #include "locale_service.h"
    #include "item.h"
    #include "blend_item.h"
    
    struct BLEND_ITEM_INFO
    {
    	DWORD item_vnum;
    	int apply_type;
    	int apply_value[MAX_BLEND_ITEM_VALUE];
    	int apply_duration[MAX_BLEND_ITEM_VALUE];
    };
    
    typedef std::vector<BLEND_ITEM_INFO*> T_BLEND_ITEM_INFO;
    T_BLEND_ITEM_INFO s_blend_info;
    
    bool Blend_Item_init()
    {
    	char file_name[256];
    	snprintf (file_name, sizeof (file_name), "%s/blend.txt", LocaleService_GetBasePath().c_str());
    	sys_log (0, "Blend_Item_init %s ", file_name);
    
    	for (const auto& blend_item_info : s_blend_info)
    	{
    		M2_DELETE (blend_item_info);
    	}
    
    	s_blend_info.clear();
    
    	if (false == Blend_Item_load (file_name))
    	{
    		sys_err ("<Blend_Item_init> fail");
    		return false;
    	}
    
    	return true;
    }
    
    bool Blend_Item_load (char* file)
    {
    	FILE* fp;
    	char one_line[256];
    	const char* delim = " \t\r\n";
    	char* v;
    
    	BLEND_ITEM_INFO* blend_item_info;
    
    	if (0 == file || 0 == file[0])
    	{
    		return false;
    	}
    
    	if ((fp = fopen (file, "r")) == 0)
    	{
    		return false;
    	}
    
    	while (fgets (one_line, 256, fp))
    	{
    		if (one_line[0] == '#')
    		{
    			continue;
    		}
    
    		const char* token_string = strtok (one_line, delim);
    
    		if (nullptr == token_string)
    		{
    			continue;
    		}
    
    		TOKEN ("section")
    		{
    			blend_item_info = M2_NEW BLEND_ITEM_INFO;
    			memset (blend_item_info, 0x00, sizeof (BLEND_ITEM_INFO));
    		}
    		else TOKEN ("item_vnum")
    		{
    			v = strtok (nullptr, delim);
    
    			if (nullptr == v)
    			{
    				fclose (fp);
    				return false;
    			}
    
    			str_to_number (blend_item_info->item_vnum, v);
    		}
    		else TOKEN ("apply_type")
    		{
    			v = strtok (nullptr, delim);
    
    			if (nullptr == v)
    			{
    				fclose (fp);
    				return false;
    			}
    			blend_item_info->apply_type = FN_get_apply_type (v);
    		}
    		else TOKEN ("apply_value")
    		{
    			for (int i = 0; i < MAX_BLEND_ITEM_VALUE; ++i)
    			{
    				v = strtok (nullptr, delim);
    
    				if (nullptr == v)
    				{
    					fclose (fp);
    					return false;
    				}
    
    				str_to_number (blend_item_info->apply_value[i], v);
    			}
    		}
    		else TOKEN ("apply_duration")
    		{
    			for (int i = 0; i < MAX_BLEND_ITEM_VALUE; ++i)
    			{
    				v = strtok (nullptr, delim);
    
    				if (nullptr == v)
    				{
    					fclose (fp);
    					return false;
    				}
    
    				str_to_number (blend_item_info->apply_duration[i], v);
    			}
    		}
    		else TOKEN ("end")
    		{
    			s_blend_info.push_back (blend_item_info);
    		}
    	}
    
    	fclose (fp);
    	return true;
    }
    
    static int FN_random_index()
    {
    	int	percent = number (1, 100);
    
    	if (percent <= 10)
    	{
    		return 0;
    	}
    	else if (percent <= 30)
    	{
    		return 1;
    	}
    	else if (percent <= 70)
    	{
    		return 2;
    	}
    	else if (percent <= 90)
    	{
    		return 3;
    	}
    	else
    	{
    		return 4;
    	}
    
    	return 0;
    }
    
    static int FN_ECS_random_index()
    {
    	int	percent = number (1, 100);
    	if (percent <= 5)
    	{
    		return 0;
    	}
    	else if (percent <= 15)
    	{
    		return 1;
    	}
    	else if (percent <= 60)
    	{
    		return 2;
    	}
    	else if (percent <= 85)
    	{
    		return 3;
    	}
    	else
    	{
    		return 4;
    	}
    
    	return 0;
    }
    
    bool Blend_Item_set_value (LPITEM item)
    {
    	for (const auto& blend_info : s_blend_info)
    	{
    		if (blend_info->item_vnum == item->GetVnum())
    		{
    			int	apply_type;
    			int	apply_value;
    			int	apply_duration;
    
    			if (item->GetVnum() == 51002)
    			{
    				apply_type = blend_info->apply_type;
    				apply_value = blend_info->apply_value[FN_ECS_random_index()];
    				apply_duration = blend_info->apply_duration[FN_ECS_random_index()];
    			}
    			else
    			{
    				apply_type = blend_info->apply_type;
    				apply_value = blend_info->apply_value[FN_random_index()];
    				apply_duration = blend_info->apply_duration[FN_random_index()];
    			}
    
    			sys_log (0, "blend_item : type : %d, value : %d, du : %d", apply_type, apply_value, apply_duration);
    			item->SetSocket (0, apply_type);
    			item->SetSocket (1, apply_value);
    			item->SetSocket (2, apply_duration);
    			return true;
    		}
    	}
    	return false;
    }
    
    bool Blend_Item_find (DWORD item_vnum)
    {
    	BLEND_ITEM_INFO* blend_info;
    	for (const auto& blend_item_info : s_blend_info)
    	{
    		if (blend_info->item_vnum == item_vnum)
    		{
    			return true;
    		}
    	}
    
    	return false;
    }

     

    http://paste.ubuntu.com/15718092/

    Have fun.

    This fix all blend bugs and issues.     Also fix the unsafe strtok();

    And also const  helping the compiler to optimize your code, and you prevent yourself from making unintentional bugs

    Removed macro.

    Also contain some features auto transform and nullptr transform.

     

    1. A new parameter, s1max, prevents strtok_s from storing outside of the string being tokenized. (The string being divided into tokens is both an input and output of the function since strtok_s stores null characters into the string.)
    2. A new parameter, ptr, eliminates the static internal state that prevents strtok from being re-entrant (Subclause 1.1.12). (The ISO/IEC 9899 function wcstok and the ISO/IEC 9945 (POSIX) function strtok_r fix this problem identically.)

     

     

    Regards ds_aim.

     

    • Metin2 Dev 1
    • Love 7
×
×
  • 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.