# *ItemInfo.txt class ItemInfoScript < Script def initialize(required, name, path) super(required, name, path) end def check_rule(columns) super code = columns[col_index('Code')].strip.to_i type = columns[col_index('Type')].strip.to_i level = columns[col_index('Level')].strip.to_i sockets = columns[col_index('SocketUse')].strip.to_i dup_num = columns[col_index('DupNum')].strip.to_i charge_subtype = columns[col_index('ChargeSubType')].strip.to_i # ItemCode Áߺ¹ ºÒ°¡ if checker.item_table.has_key?(code) puts "[ERROR] #{@name} : Code #{code} Áߺ¹ #{checker.item_table[code]} (line #{@line_num})" set_error else checker.item_table[code] = "#{@name} line #{@line_num}" end # 0 < ItemCode <= 65535 if code <= 0 or 65535 < code puts "[ERROR] #{@name} : Code #{code} ¹üÀ§ ¿À·ù (line #{@line_num})" set_error end # ¾ÆÀÌÅÛ Å¸ÀÔÀº 0º¸´Ù Ä¿¾ß if type <= 0 puts "[ERROR] #{@name} : Type #{type} ¹üÀ§ ¿À·ù (line #{@line_num})" end # ¾ÆÀÌÅÛ ·¹º§Àº 0º¸´Ù Ä¿¾ß #if level <= 0 # puts "[WARNING] #{@name} : Level #{level} ¹üÀ§ ¿À·ù (line #{@line_num})" #end # ¼ÒÄÏ È¦ °¹¼ö´Â 255 ÀÌÇÏ if sockets < 0 or 255 < sockets puts "[ERROR] #{@name} : SocketUse #{sockets} ¹üÀ§ ¿À·ù (line #{@line_num})" set_error end dup_num = columns[col_index('DupNum')].to_i if dup_num <= 0 # °ãÄ¡±â °¹¼ö´Â 0º¸´Ù Ä¿¾ß puts "[ERROR] #{@name} : DupNum #{dup_num} ¹üÀ§ ¿À·ù (line #{@line_num})" set_error elif dup_num > 1 # °ãÄ¡´Â ¾ÆÀÌÅÛÀº À¯È¿±â°£À» °¡ÁöÁö ¾Ê´Â´Ù unless charge_subtype == 0 or charge_subtype == 7 puts "[ERROR] #{@name} : ChargeSubType+DupNum #{charge_subtype}+#{dup_num} ºÒÀÏÄ¡ (line #{@line_num})" set_error end # ¹«±â/¹æ¾î±¸/¸ñ°ÉÀÌ/¹ÝÁö/Àå½Å±¸´Â °ãÄ¥ ¼ö ¾ø´Ù if type < 900 and not (type == 886 or type == 887) puts "[ERROR] #{@name} : Type+DupNum #{charge_subtype}+#{dup_num} ºÒÀÏÄ¡ (line #{@line_num})" set_error end end end end # Filter.txt & FilterName.txt class FilterScript < Script def initialize(required, name, path) super(required, name, path) # Ä÷³ ³»¿ë Áß °ø¹é üũ °Ç³Ê¶Ü @should_check_space = false end end # AbusingOption.txt class AbusingOptionScript < Script def initialize(required, name, path) super(required, name, path) @table = {} end def check_rule(columns) super # AbuseType + AbuseSubType Á¶ÇÕÀº Áߺ¹ ºÒ°¡ type = columns[col_index('AbuseType')] subtype = columns[col_index('AbuseSubType')] if @table.has_key?([ type, subtype ]) puts "[ERROR] #{@name} : AbuseType+AbuseSubType #{type}+#{subtype} Áߺ¹ line #{@table[ [ type, subtype ] ]} (line #{@line_num})" set_error else @table[ [ type, subtype ] ] = @line_num end end end