• Forum vBulletin altyapısından Xenforo altyapısına geçirildi, bu sebeple eski şifreleriniz ile foruma giriş yapamayacaksınız, parolamı unuttum adımından mailiniz ile şifre sıfırlayarak giriş yapabilirsiniz.

    Üyeliklerinde geçerli bir mail adresi olmadığı için sıfırlama yapamayacak kullanıcılar forum kullanıcı adlarını ve yeni şifrelerini yazarak info@maxigame.org adresine şifre sıfırlamak istediklerine dair bir mail göndersinler şifrelerini sıfırlayıp mail adreslerini güncelleyeceğiz. Şifreniz sıfırlandıktan sonra foruma giriş yapıp tekrar istediğiniz gibi değiştirebilirsiniz.

SMC Db Query Fix

  • Konuyu başlatan Konuyu başlatan KaRa
  • Başlangıç tarihi Başlangıç tarihi

KaRa

Yaşıyorum!
Aileden
Aktiflik
K.Tarihi
19 Nis 2009
Mesajlar
1,152
Puanı
762
Konum
Mersin
Merhaba arkadaşlar.

Orjinal ve çoğu database'de SMC'den item eklerken , silerken veya düzenlerken Db query failed hatası veriyor.

Bu hatayı fixlemek için aşağıdaki dosyayı indirip üç txt dosyasındaki prosedürleri New Query ile Execute yaparsanız sorun kalkacaktır.

Link


SMC Db Query Fix Maxigame KaRa.rar

Rar Şifresi :


HTML:
www.maxigamerz.com
 
Eline sağlık gerçi okuma yazması olan yaprdida

GT-I9100 cihazımdan Tapatalk 2 ile gönderildi
 
Linke bir şey olmuş yeniliyebilirsen mutlu olurum. Bu arada ellerine sağlık.
 
Başka sitelerden birinin konusundan almış olabilri misin bunları :D
 
item edit prosedüründe hata var.
Düzeltilmiş Hali
Teşekkürler bu arada ;)

Kod:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_SMC_EDIT_ITEM]    Script Date: 06/15/2012 19:51:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO


ALTER  procedure [dbo].[_SMC_EDIT_ITEM]
----------------------------------------------------- params to find target item
    @TargetStorage    int,                /* 0 = inventory, 1 = chest, 2 = guild chest, 3 = Avatar Inventory */
    @OwnerName    varchar(128),        /* account id or char id */
    @Slot            int,
    @ItemIDToEdit    bigint,    /* just for check validity */
    ----------------------------------------------------- params to modify the item
    @RefItemID        int,
    @OptLvl            tinyint,
    @Variance        bigint,
    @Data            int,
    @szCreater        varchar(32),
    @MagParamNum    int,
    @MagParam1    bigint,
    @MagParam2    bigint,
    @MagParam3    bigint,
    @MagParam4    bigint,
    @MagParam5    bigint,
    @MagParam6    bigint,
    @MagParam7    bigint,
    @MagParam8    bigint,
    @MagParam9    bigint,
    @MagParam10    bigint,
    @MagParam11    bigint,
    @MagParam12    bigint
as
    ----------------------------------------------------
    -- step 1. check validity of parameters
    ----------------------------------------------------
    if (@TargetStorage <> 0 and @TargetStorage <> 1 and @TargetStorage <> 2 and @TargetStorage <> 3)
    begin
        select -1    -- invalid target storage
        return
    end
    declare @ownerid int
    declare @ItemID bigint
    set @ownerid = 0
    set @ItemID = 0
    if (@TargetStorage = 0)
    begin
        select @ownerid = charid from _char where charname16 = @OwnerName
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _inventory where charid = @ownerid and slot = @slot
    end
    else if (@TargetStorage = 1)
    begin
        select @ownerid = JID from _AccountJID where AccountID = @ownername
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _chest where userjid = @ownerid and slot = @slot
    end
    else if (@TargetStorage = 2)
    begin
        select @ownerid = [id] from _guild where [name] = @ownername
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _guildchest where guildid = @ownerid and slot = @slot
    end
    else
    begin
        select @ownerid = charid from _char where charname16 = @OwnerName
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _InventoryForAvatar where charid = @ownerid and slot = @slot
    end


    if (@ItemID = 0 or @ItemID is null)
    begin
        select -3    -- can't find the item
        return
    end
    if (@ItemID <> @ItemIDToEdit)
    begin
        select -4    -- it's not the one that you wanna edit
        return 
    end
    declare @tid1 int
    declare @tid2 int
    select @tid1 = TypeID1, @tid2 = TypeID2 from _RefObjCommon where ID = @RefItemID
    if (@tid1 <> 3)
    begin
        select -5    -- about to assign non-item object
        return
    end
    if (@tid2 <> 1)        -- is equipment
    begin
        -- can't assign magic param or optlevel to non-equip item
        if (@MagParamNum > 0 or @OptLvl > 0)
        begin
            select -6
            return
        end
    end
    
    ----------------------------------------------------
    -- step 2. correct some non-critical parameters
    ----------------------------------------------------
    if (@OptLvl > 255)
    begin
        set @OptLvl = 255    -- clamp optlevel to 255
    end    
    if (LEN(@szCreater) = 0)
        set @szCreater = NULL
    
    ----------------------------------------------------
    -- step 3. modify target item to desired values
    ----------------------------------------------------
    if (@MagParamNum = 0)
    begin
        update _Items 
        set RefItemID = @RefItemID, OptLevel = @OptLvl, Variance = @Variance, Data = @Data, CreaterName = @szCreater, MagParamNum = 0 
        where id64 = @ItemID
    end
    else
    begin
        update _Items 
        set  RefItemID = @RefItemID, OptLevel = @OptLvl, Variance = @Variance, Data = @Data, CreaterName = @szCreater, MagParamNum = @MagParamNum,
            MagParam1 = @MagParam1, MagParam2 = @MagParam2, MagParam3 = @MagParam3, MagParam4 = @MagParam4,
            MagParam5 = @MagParam5, MagParam6 = @MagParam6, MagParam7 = @MagParam7, MagParam8 = @MagParam8,
            MagParam9 = @MagParam9, MagParam10 = @MagParam10, MagParam11 = @MagParam11, MagParam12 = @MagParam12
        where id64 = @ItemID
    end
        
    if (@@error <> 0 or @@rowcount = 0)
    begin
        select -7
        return
    end
    select 1
    return
 
item edit prosedüründe hata var.
Düzeltilmiş Hali
Teşekkürler bu arada ;)

Kod:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_SMC_EDIT_ITEM]    Script Date: 06/15/2012 19:51:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO


ALTER  procedure [dbo].[_SMC_EDIT_ITEM]
----------------------------------------------------- params to find target item
    @TargetStorage    int,                /* 0 = inventory, 1 = chest, 2 = guild chest, 3 = Avatar Inventory */
    @OwnerName    varchar(128),        /* account id or char id */
    @Slot            int,
    @ItemIDToEdit    bigint,    /* just for check validity */
    ----------------------------------------------------- params to modify the item
    @RefItemID        int,
    @OptLvl            tinyint,
    @Variance        bigint,
    @Data            int,
    @szCreater        varchar(32),
    @MagParamNum    int,
    @MagParam1    bigint,
    @MagParam2    bigint,
    @MagParam3    bigint,
    @MagParam4    bigint,
    @MagParam5    bigint,
    @MagParam6    bigint,
    @MagParam7    bigint,
    @MagParam8    bigint,
    @MagParam9    bigint,
    @MagParam10    bigint,
    @MagParam11    bigint,
    @MagParam12    bigint
as
    ----------------------------------------------------
    -- step 1. check validity of parameters
    ----------------------------------------------------
    if (@TargetStorage <> 0 and @TargetStorage <> 1 and @TargetStorage <> 2 and @TargetStorage <> 3)
    begin
        select -1    -- invalid target storage
        return
    end
    declare @ownerid int
    declare @ItemID bigint
    set @ownerid = 0
    set @ItemID = 0
    if (@TargetStorage = 0)
    begin
        select @ownerid = charid from _char where charname16 = @OwnerName
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _inventory where charid = @ownerid and slot = @slot
    end
    else if (@TargetStorage = 1)
    begin
        select @ownerid = JID from _AccountJID where AccountID = @ownername
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _chest where userjid = @ownerid and slot = @slot
    end
    else if (@TargetStorage = 2)
    begin
        select @ownerid = [id] from _guild where [name] = @ownername
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _guildchest where guildid = @ownerid and slot = @slot
    end
    else
    begin
        select @ownerid = charid from _char where charname16 = @OwnerName
        if (@@rowcount = 0 or @ownerid = 0 or @ownerid is null)
        begin
            select -2    -- can't find owner
            return
        end
        select @ItemID = ItemID from _InventoryForAvatar where charid = @ownerid and slot = @slot
    end


    if (@ItemID = 0 or @ItemID is null)
    begin
        select -3    -- can't find the item
        return
    end
    if (@ItemID <> @ItemIDToEdit)
    begin
        select -4    -- it's not the one that you wanna edit
        return 
    end
    declare @tid1 int
    declare @tid2 int
    select @tid1 = TypeID1, @tid2 = TypeID2 from _RefObjCommon where ID = @RefItemID
    if (@tid1 <> 3)
    begin
        select -5    -- about to assign non-item object
        return
    end
    if (@tid2 <> 1)        -- is equipment
    begin
        -- can't assign magic param or optlevel to non-equip item
        if (@MagParamNum > 0 or @OptLvl > 0)
        begin
            select -6
            return
        end
    end
    
    ----------------------------------------------------
    -- step 2. correct some non-critical parameters
    ----------------------------------------------------
    if (@OptLvl > 255)
    begin
        set @OptLvl = 255    -- clamp optlevel to 255
    end    
    if (LEN(@szCreater) = 0)
        set @szCreater = NULL
    
    ----------------------------------------------------
    -- step 3. modify target item to desired values
    ----------------------------------------------------
    if (@MagParamNum = 0)
    begin
        update _Items 
        set RefItemID = @RefItemID, OptLevel = @OptLvl, Variance = @Variance, Data = @Data, CreaterName = @szCreater, MagParamNum = 0 
        where id64 = @ItemID
    end
    else
    begin
        update _Items 
        set  RefItemID = @RefItemID, OptLevel = @OptLvl, Variance = @Variance, Data = @Data, CreaterName = @szCreater, MagParamNum = @MagParamNum,
            MagParam1 = @MagParam1, MagParam2 = @MagParam2, MagParam3 = @MagParam3, MagParam4 = @MagParam4,
            MagParam5 = @MagParam5, MagParam6 = @MagParam6, MagParam7 = @MagParam7, MagParam8 = @MagParam8,
            MagParam9 = @MagParam9, MagParam10 = @MagParam10, MagParam11 = @MagParam11, MagParam12 = @MagParam12
        where id64 = @ItemID
    end
        
    if (@@error <> 0 or @@rowcount = 0)
    begin
        select -7
        return
    end
    select 1
    return

Ben bu prosedürlerle İtem editliyorum neresinde hata varki ? Yinede bir kontrol edeyim ben :)
 
Geri
Üst