MMORG ZONE
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Guide] Trigger to prevent dupe !

Go down

[Guide] Trigger to prevent dupe ! Empty [Guide] Trigger to prevent dupe !

Post by  Mon Dec 24, 2007 6:51 am

this is taken from MG forum, and it his a babelfish traslation:
(i haven't tested it and i haven't read all the script)

This one works, but may put a bit of lag on ur server (thakns to john that tested it)
=========================================

[ 鍘熷垱 ] issued successfully prevents the duplication automatic title and video recording downloading and the code


First thanks 54321abc in here me to issue these codes to us. I borrow this code to join successfully

Discovered some people did not know how adds. Therefore I have made a
simple video recording! ~~ such big forum nobody helped me to look that
the long time. That many person cannot. Cannot look they do the worry

Therefore I have completed. Issues a video recording. Likes Brother `` friend. The help goes against.

Video recording downloading address

The ftp://220.164.154.26/essence pastes /hefudelx.exe

Http://www.loveqj.com/hefudelx.exe

[ 鍘熷垱 ] issued completely prevented the duplication code ~ constructs
Italy to stop the clothing movement, front sends code not clear and
when duplication code makes a mistake the part all revised well, when
everybody duplication code paid attention line feeds, some places sent
when the forum automatically joined has line fed the symbol, please
removed it otherwise has the possibility not to be normal

First, everybody research that kind cancels the T key and the D key as
well as the parting line guards against the duplication the mentality
all is not correct, but increased the duplication difficulty but by, is
not true governs the root the method. My this method majority of source
programs originate at the others write, is I which who writes did not
know, the extension pastes the person too were many. At that time but
he has not been able to solve the elimination replica and to kick the
person winding these two questions, the replica may forward to the
others in the same old way, and the real-time examination extremely
wastes the memory, was equal to does not have the function. First joins
field FZ in yours memb_info table, the type is int, tacitly approves
the value is 0, uses to make the recording duplication number of times
Joins field gq in the autogmgg table, the type is int, tacitly approves
the value is 0, uses to make the elimination expired announcement
Principle: After duplicated successfully automatically changes the
warehouse password to cause the user to be unable to open the
warehouse, and the automatic recording and issued in automatic
announcement, when winding the automatic clear spatial warehouse,
surpassed three time automatically seals the account number.

Before this method because did not have the means promptly to kick the
user the winding to be unable normally to use, now this solution must
not exist, I used month server basic nobody to dare to duplicate. The
premise was you already clear removed these already has duplicated the
goods, this method cannot eliminate 0 serial numbers the goods, to
already has duplicated the goods also do not have the effect.
The first section, the trigger, directly in inquired in the analyzer to your data sheet movement to be allowed

-- Establishes the data sheet

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id,
N'IsTrigger') = 1)
drop trigger [dbo].[trg_CheckSameID]
GO

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

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

CREATE TABLE [dbo].[AllItemsLog] (
[items_id] [int] IDENTITY (1, 1) NOT NULL ,
[items_type] [binary] (1) NOT NULL ,
[items_serial] [binary] (4) NOT NULL ,
[items_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CopyLog] (
[copy_id] [int] IDENTITY (1, 1) NOT NULL ,
[copy_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[copy_whdata] [binary] (1200) NOT NULL ,
[copy_date] [datetime] NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[AllItemsLog] ADD
CONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],
CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],
CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT (0) FOR [items_acid]
GO

CREATE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CopyLog] ADD
CONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


-- Constructs the trigger


CREATE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].[character]
FOR UPDATE
AS
BEGIN
IF UPDATE(inventory)
BEGIN
SET NOCOUNT ON
DECLARE
@wh_acid varchar(10),
@wh_data binary(1200),
@wh_type binary(1),
@wh_serial binary(4),
@cr_user varchar(10),
@cr_acid varchar(10),
@cr_data binary(760),
@cr_type binary(1),
@cr_serial binary(4),
@al_acid varchar(10),
@j int,
@k int,
@find bit
SELECT @cr_acid=i.accountid,
@cr_data=i.inventory
FROM inserted i
SET @j=0
SET @find=0
WHILE @j<76 AND @cr_data IS NOT NULL
BEGIN
SET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)
SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)
IF @cr_type<>0xFF AND @cr_serial<>0x00000000
BEGIN
SELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serial
-- Adds on new master marking to the goods
IF @al_acid IS NULL
INSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)
ELSE
BEGIN
UPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serial
-- From the old master warehouse searches whether also has the same ID goods
SELECT @wh_data=items FROM warehouse WHERE accountid=@al_acid
SET @k=0
WHILE @k<120 AND @wh_data IS NOT NULL
BEGIN
SET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)
SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)
IF @wh_type=@cr_type AND @wh_serial=@cr_serial
SET @find=1
SET @k=@k+1
END
END
END
SET @j=@j+1
END
-- The discovery on cages to the warehouse
IF @find=1
BEGIN
INSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())
update memb_info set fz=fz+1 where memb___id= @al_acid
-- Pays attention to here PW= how many to alter to from already 4 numerical cipherses which only then knew
update warehouse set pw=5555 WHERE accountid=@al_acid

-- Revised the warehouse password first time to send has a question here many line, now changed

INSERT INTO autogmgg (Valid, SvrID, Type, BeginTM, EndTM, DispJG,
WorkMINU, LoopMINU, Notice, gq) values (1,0,0, getdate (), getdate ()
+2,15,15,15, @al_acid+' in '+convert (varchar (10), getdate (),,111) +'
'+convert (varchar (10), getdate (),Cool +' has carried on duplication
behavior, already by record, and by automatic clear spatial warehouse,
is surpassed three time automatically deletes this account number ',1)
END
SET NOCOUNT OFF
END
END

Second section. The winding automatic clear spatial warehouse, changes
the password, opens the business management, selects your data sheet,
selects the storage process, selects WZ_DISCONNECT_MEMB, a right key
chooses the attribute, was allowed to see the code, in

UPDATE MEMB_STAT
Under this code joins
Update memb_info set bloc_code=1 where memb___id=@uid and fz > 3
-- Surpasses three time is automatically sealed
Update warehouse set items = null, pw=0 WHERE accountid= @uid and pw=5555
-- Here is that password which above you establishes 5,555, alters to
it only has you to know, must equally only then be good with above

The third section, eliminates the expired announcement, joins the method with the second section to be same
In this storage process MyGSFun_SBKEND, center joins, adds in this under "set @ec=0"
-- Automatic deletion expired replica advertisement
Delete from autogmgg where gq=1 and getdate () -BeginTM>1
Behind -- the deletion ended that 1 expression to delete the expired
day-long duplication to announce, if is 2 indicated announces two days.




Originally pasteshttp://bbs.vzkj.com/dispbbs.asp? BoardID=10&ID=257274&page=1


Favourite Game : MuOnline
Registration date : 1969-12-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum