ko cuce

Inventory editor çalıştırmak.(SQL 2008)

ADOS

Kayıtlı Üye
1 Eylül 2012
494
9
18
28
mevcut olanları silin, bunlara bi f5 çakın tamamdır:f:



İçerik Açılmıştır Teşekkürler :)
Kod:
USE [kn_online]

GO

/****** Object:  StoredProcedure [dbo].[itemleri_bul]    Script Date: 01/17/2013 00:14:55 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER OFF

GO



Create procedure [dbo].[itemleri_bul]

@StrUserID varchar(30)

AS

DECLARE

@length int, -- stritem uzunluğu

@i int, -- item'in stritem deki yeri

@dwid int,

@dur int,

@duar int,

@StackSize1 int,

@Sira int,

@Row int,

@name varchar(100),

@extname varchar(100),

@ext int





set @i = 14*0+1

set @length = 601



select @row=count(*) from userdata where [email protected]



delete from itemler where [email protected]



if @row>0

begin



WHILE @i < @length

Begin



Select @dwid=cast(cast(substring(cast(substring(strItem, @i,4) as varbinary(4)), 4,

1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 3, 1)+substring(cast(substring(strItem, @i,4) as

varbinary(4)), 2, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 1, 1) as varbinary(4)) as int),

@dur = cast(cast(cast( substring(strItem, @i+5, 1) as varbinary(1))+cast(substring(strItem, @i+4, 1) as

varbinary(1)) as varbinary(2)) as int),

@StackSize1 = cast(cast(cast( substring(strItem, @i+7, 1) as varbinary(1))+cast(substring(strItem, @i+6, 1) as

varbinary(1)) as varbinary(2)) as int),

@StrUserID = strUserID

From UserData

Where strUserID = @StrUserID





insert into itemler (dwid,stacksize,durability,struserid,sira,itembasicname,extname)

values(@dwid,@stacksize1,@dur,@StrUserID,(@i-1) / 8,@extname,@name )



set @[email protected]+8



end

end


Kod:
USE [kn_online]

GO

/****** Object:  StoredProcedure [dbo].[itemleri_encode]    Script Date: 01/17/2013 00:15:45 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER OFF

GO



Create procedure [dbo].[itemleri_encode]

@StrUserID varchar(30)

AS

DECLARE

@length int, -- stritem uzunluğu

@row int, -- yerine göre deişior.

@i int, -- item'in stritem deki yeri

@dwid int, -- dwid

@pos int,

@dur int,

@dur1 int,

@ext int,

@StackSize1 int,

@strName varchar(30),

@strExtName varchar(30),

@Cdwid varbinary(4),

@cdur varchar(2),

@Source tinyint,

@NEWdwid int,

@StackSize int,

@cstack varchar(2),

@sira int



set @sira=0

set @i = 14*0

set @length = 601



select @row=count( * ) from userdata where [email protected]



if @row>0

begin





Select @dwid=dwid,

@dur = durability,

@StackSize1 = stacksize,

@StrUserID = strUserID

From itemler

Where strUserID = @StrUserID and [email protected]



Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) +

Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)

Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as

varchar(2))

Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as

varbinary(2)), 1, 1) as varchar(2))





update UserData set strItem = cast(cast(cast(@Cdwid as varchar(4)) + @Cdur + @Cstack as varchar(8)) as

binary(600)) where strUserID = @strUserID





set @[email protected]+8

set @[email protected]+1





WHILE @sira < 50

Begin



Select @dwid=dwid,

@dur = durability,

@StackSize1 = stacksize,

@StrUserID = strUserID

From itemler

Where strUserID = @StrUserID and [email protected]



Set @Cdwid = Substring(cast(@dwid as varbinary(4)), 4, 1) + Substring(cast(@dwid as varbinary(4)), 3, 1) +

Substring(cast(@dwid as varbinary(4)), 2, 1) + Substring(cast(@dwid as varbinary(4)), 1, 1)

Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as

varchar(2))

Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as

varbinary(2)), 1, 1) as varchar(2))





update UserData set strItem = cast( substring(strItem, 1, @i) + cast(cast(@Cdwid as varchar(4)) + @Cdur +

@Cstack as varchar(8)) + substring(strItem, @i+8, [email protected]) as binary(600)) where strUserID = @strUserID





set @[email protected]+8

set @[email protected]+1



end

end

delete from itemler