sm
服务器租用 996 无法下载点击此处反馈
/
查看: 900|回复: 1

如何正确的删除传奇3复制装备的SQL漏洞 [传奇3架设教程]

[复制链接]

826

主题

37

回帖

23万

积分

霸王教主

积分
237197
发表于 2023-8-17 09:32:03 | 显示全部楼层 |阅读模式
如何正确的删除传奇3复制装备的SQL漏洞

说明:

SQL脚本如下所示,请复制到SQL查询分析器中执行即可,建议做完备份再做些类的操作!如果你用的是GAME1数据库,请查找所有的GAME,改成GAME1,就可以了!

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBL_ALLITEM]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBL_ALLITEM]

CREATE TABLE [dbo].[TBL_ALLITEM]
(
[FLD_CHARACTER] [char] (15) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[FLD_TYPE] [tinyint] NULL ,
[FLD_MAKEINDEX] [int] NOT NULL ,
[FLD_TID] [varchar] (30) NOT NULL ,
[FLD_INDEX] [int] NOT NULL ,
[Place] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL
)
ON [PRIMARY]

--首先删除玩家刚摘下来的装备,就是TBL_ITEM表中,FLD_INDEX=0的那些装备
DELETE FROM [game].[dbo].[TBL_ITEM] WHERE [FLD_INDEX] = 0

--从玩家身上/包袱获取数据
INSERT INTO [game].[dbo].[TBL_ALLITEM]([FLD_CHARACTER], [FLD_TYPE], [FLD_MAKEINDEX],[FLD_TID],[FLD_INDEX],[Place])
SELECT [FLD_CHARACTER], [FLD_TYPE], [FLD_MAKEINDEX], LTRIM(STR([FLD_MAKEINDEX]))+LTRIM(STR([FLD_INDEX])) AS FLD_TID,[FLD_INDEX],'身上' AS Place
FROM [game].[dbo].[TBL_ITEM]

--从仓库获取数据
INSERT INTO [game].[dbo].[TBL_ALLITEM]([FLD_CHARACTER], [FLD_TYPE], [FLD_MAKEINDEX],[FLD_TID],[FLD_INDEX],[Place])
SELECT [FLD_CHARACTER], [FLD_TYPE], [FLD_MAKEINDEX], LTRIM(STR([FLD_MAKEINDEX]))+LTRIM(STR([FLD_INDEX])) AS FLD_TID,[FLD_INDEX],'仓库' AS Place
FROM [game].[dbo].[TBL_SAVEDITEM]

--从寄售获取数据
INSERT INTO [game].[dbo].[TBL_ALLITEM]([FLD_CHARACTER], [FLD_TYPE], [FLD_MAKEINDEX],[FLD_TID],[FLD_INDEX],[Place])
SELECT [FLD_SELLWHO], [FLD_ITEMTYPE], [FLD_ITEM_MAKEINDEX], LTRIM(STR([FLD_ITEM_MAKEINDEX]))+LTRIM(STR([FLD_ITEM_INDEX])) AS FLD_TID,[FLD_ITEM_INDEX],'寄售' AS Place
FROM [game].[dbo].[TBL_ITEMMARKET]

--记录将要删除的复制装备
if not exists (select * from dbo.sysobjects where id = object_id(N'[game].[dbo].[TBL__DELLOG]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [game].[dbo].[TBL__DELLOG] (
[删除日期] datetime not null,
[FLD_MAKEINDEX] [int] NOT NULL ,
[角色名] [char] (15) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[装备代码] [int] NULL ,
[存放地点] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

INSERT INTO [game].[dbo].[TBL__DELLOG]([删除日期],[FLD_MAKEINDEX],[装备代码],[角色名],[存放地点])--,[装备名称]
SELECT getdate() as 删除日期,[FLD_MAKEINDEX] , [FLD_INDEX]-1 AS 装备代码,[FLD_CHARACTER] AS 角色名, [Place] AS 存放地点--,[Name] AS 装备名称
FROM [game].[dbo].[TBL_ALLITEM]
WHERE ((([FLD_TID]) In
(SELECT [FLD_TID] FROM [TBL_ALLITEM] As Tmp GROUP BY [FLD_TID] HAVING Count([FLD_TID])>1 )))
ORDER BY [FLD_MAKEINDEX]

--遂个删除复制装备
DECLARE @T_ID char (30),@I_MAKEINDEX int , @V_Place varchar (10)
DECLARE D_ITEMS_cursor CURSOR FOR

SELECT [FLD_TID],[FLD_MAKEINDEX],[Place]
FROM [game].[dbo].[TBL_ALLITEM]
WHERE ((([FLD_TID]) In
(SELECT [FLD_TID] FROM [TBL_ALLITEM] As Tmp GROUP BY [FLD_TID]
HAVING Count([FLD_TID])>1 )))
ORDER BY [FLD_MAKEINDEX]

OPEN D_ITEMS_cursor

FETCH NEXT FROM D_ITEMS_cursor INTO @T_ID,@I_MAKEINDEX,@V_Place

WHILE @@FETCH_STATUS = 0
BEGIN

BEGIN
IF @V_Place = '仓库'
DELETE FROM [game].[dbo].[TBL_SAVEDITEM] WHERE [FLD_MAKEINDEX] = @I_MAKEINDEX
ELSE IF @V_Place = '身上'
DELETE FROM [game].[dbo].[TBL_ITEM] WHERE [FLD_MAKEINDEX] = @I_MAKEINDEX
ELSE
DELETE FROM [game].[dbo].[TBL_ITEMMARKET] WHERE [FLD_ITEM_MAKEINDEX] = @I_MAKEINDEX
END

FETCH NEXT FROM D_ITEMS_cursor INTO @T_ID,@I_MAKEINDEX,@V_Place
END

CLOSE D_ITEMS_cursor
DEALLOCATE D_ITEMS_cursor

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBL_ALLITEM]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[TBL_ALLITEM]






上一篇:传奇3镶嵌宝石打孔镶嵌系统逻辑
下一篇:传奇3私服版本角色无法学习技能解决方法
回复

使用道具 举报

1

主题

252

回帖

1070

积分

旋风流星刀

积分
1070
QQ
发表于 2024-1-12 14:12:25 | 显示全部楼层
积分任务
回复

使用道具 举报

© 2001-2024 Discuz! Team. Powered by Discuz! X3.5

GMT+8, 2024-11-21 17:00 , Processed in 0.295596 second(s), 62 queries 手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

快速回复 返回顶部 返回列表