用户登录  | 
首 页技术文章软件发布广告价格
当前位置:传奇游戏服务端下载站传奇站长论坛资源网站程序技术文章文章资讯游戏架设教程奇迹技术

最新的防止复制的SQL代码,速度快!

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2014-10-03 23:22:20

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO dedecms.com

CREATE TRIGGER [dbo].[clear_copyitems] ON [dbo].[warehouse]
FOR UPDATE
AS
BEGIN

IF UPDATE(items)
BEGIN
DECLARE @al_acid varchar(10)
DECLARE @al_name varchar(10) dedecms.com

DECLARE @whItems AS binary(1200)
DECLARE @bdItems AS binary(760)

DECLARE @bItem AS binary(1)
DECLARE @wItem AS binary(1)

DECLARE @bItemId AS binary(4)
DECLARE @WItemId AS binary(4)

DECLARE @i AS int
DECLARE @ii AS int

dedecms.com

DECLARE @find AS int

SET @find=0 dedecms.com

SELECT @al_acid=inserted.accountid,@whItems=inserted.items FROM inserted

dedecms.com

SELECT @al_name=GameIDC FROM AccountCharacter WHERE id=@al_acid
SELECT @bdItems=inventory FROM character WHERE accountid=@al_acid AND name=@al_name

SET @i=0
WHILE @i<120
BEGIN
SET @wItem=SUBSTRING(@whItems,@i*10+1,1)
SET @wItemId=SUBSTRING(@whItems,@i*10+4,4)

IF @wItem<>0xFF AND @wItemId<>0x00000000 AND @wItem IS NOT NULL AND @wItemId IS NOT NULL
BEGIN
SET @ii=0
WHILE @ii<76
BEGIN
SET @bItem=SUBSTRING(@bdItems,@ii*10+1,1)
SET @bItemId=SUBSTRING(@bdItems,@ii*10+4,4)
IF @bItem<>0xFF AND @bItemId<>0x00000000
BEGIN
IF @bItem=@wItem AND @bItemId=@wItemId
BEGIN
SET @whitems=SUBSTRING(@whitems,1,@i*10)+0xFFFFFFFFFFFFFFFFFFFF+SUBSTRING(@whitems,(1+@i)*10+1,(76-1-@i)*10)
SET @find=1
SET @ii=76
END
SET @ii=@ii+1
END
END

SET @i=@i+1
END
END
IF @find=1
BEGIN
UPDATE warehouse SET items=@whitems WHERE accountid=@al_acid
END

END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
dedecms.com

Tags:

作者:佚名

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
传奇资源网提供最新传奇开区一条龙版本下载,本站声明:只更新最新最好的传奇服务端分享给大家。