dupe problem

05/23/2014 09:59 GMCronus#1
yes it's not about the stuff i need i have it all but gives me a problem.


Quote:
AS
DECLARE @CharLeave int

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
SET @CharLeave = 1

IF @ActionType = '116'--Trade Item-remove item from originator
BEGIN
WAITFOR DELAY '00:00:05'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
EXEC PS_GameData.dbo.usp_Save_Char_Item_Del_E @CharID=@CharID, @IDList=@Value1
END
END

IF @ActionType = '164'--Trade Gold-remove gold from originator
BEGIN

WAITFOR DELAY '00:00:05'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
UPDATE PS_GameData.dbo.Chars
SET [Money]=@Value2
WHERE PS_GameData.dbo.Chars.CharID=@CharID
END
END


this one make ppl loose items. specialy when they trade from a stac of items. the rest of the stack is gone when they log back




but this


Quote:
AS
DECLARE @CharLeave int

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
SET @CharLeave = 1

IF @ActionType = '116'--Trade Item-remove item from originator
BEGIN
WAITFOR DELAY '00:05:00'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID
END

IF @ActionType = '164'--Trade Gold-remove gold from originator
BEGIN

WAITFOR DELAY '00:05:00'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
UPDATE PS_GameData.dbo.Chars
SET [Money]=@Value2
WHERE PS_GameData.dbo.Chars.CharID=@CharID
END
END
just removed every 116 from the db

yes we have 115 but never 116

Quote:
115 - Buy from a player
- Value1 - ItemUID - of item bought
- Value2 - ItemID - of item bought
- Value3 - unknown
- Value4 - Amount bought
- Text1 - ItemName - Item Bought
- Text2 - CharName - Person That bought the item.
- Text3 - Item options
- Text4 - Time and date of the occurrence
116 - Sell to a player
- Value1 - ItemUID - of sold item
- Value2 - ItemID - of sold item
- Value3 - unknown
- Value4 - Amount Sold
- Text1 - ItemName - The item that was sold
- Text2 - CharName - Person that bought the item
- Text3 - Item properties
- Text4 - Slot's in inventory that the item's were
placed.
anyone realy know why and how to fix this?

thanks
05/23/2014 10:14 nubness#2
Did you even read the code to understand what it does ?
05/23/2014 10:17 GMCronus#3
ty that's a good answer to my question
05/23/2014 10:20 nubness#4
Stop being such a moron, you didn't even read the damn queries. It's full of copy-pasters like you in here.
05/23/2014 10:45 GMCronus#5
who's the moron here? realy i asked a question nothing else, me one of the copy pasters? nice..

i did read :

Quote:
USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[usp_Save_Char_Item_Del_E] Script Date: 5/23/2014 10:39:51 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO


/****** 개체: 저장 프로시저 dbo.usp_Save_Char_Item_Del_E 스크립트 날짜: 2006-04-11 오후 10:57:52 ******/


ALTER Proc [dbo].[usp_Save_Char_Item_Del_E]

@CharID int,
@IDList varchar(7000) = '', -- 삭제시(리스트값)
@ChkID int = 1,
@Qry varchar(8000) = ''

AS

--------------------------------------------------------------------------------------------------------------------------------
SET NOCOUNT ON

DECLARE
@TmpQuery varchar(7000)

SET @TmpQuery = 'INSERT INTO #TmpTb(ItemUID) VALUES('
SET @TmpQuery = @TmpQuery + REPLACE( @IDList, ',', ') INSERT INTO #TmpTb(ItemUID) VALUES(' )
SET @TmpQuery = @TmpQuery + ')'


CREATE TABLE #TmpTb( ItemUID bigint NULL )

EXEC (@TmpQuery)


IF( @ChkID = 1 )
BEGIN
DELETE CharItems WHERE CharID = @CharID AND ItemUID IN (SELECT ItemUID FROM #TmpTb)
END
ELSE
BEGIN
DELETE CharItems WHERE ItemUID IN (SELECT ItemUID FROM #TmpTb)
END

IF(@@ERROR = 0)
BEGIN
DROP TABLE #TmpTb
RETURN 1
END
ELSE
BEGIN
DROP TABLE #TmpTb
RETURN -1
END

SET NOCOUNT OFF

--------------------------------------------------------------------------------------------------------------------------------
i know basic sql but not the advanced stuff and if you said something like it's your usp_Save_Char_Item_Del_E that's the problem or look at this and that so i could understand what i'm missing it would be good but asking me if i read it.? i changed it to test it why shouldnt i then read it?

i removed that part becouse it have the delete item in it. and that means this is the script that kkeep deleting. but what i don't understand is why ppl that just transfer like 10% of there stack missing items with it
05/23/2014 10:52 nubness#6
Quote:
Originally Posted by GMCronus View Post

but this


Code:
AS
DECLARE @CharLeave int

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
SET @CharLeave = 1

IF @ActionType = '116'--Trade Item-remove item from originator
BEGIN
WAITFOR DELAY '00:05:00'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID
END

IF @ActionType = '164'--Trade Gold-remove gold from originator
BEGIN

WAITFOR DELAY '00:05:00'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
UPDATE PS_GameData.dbo.Chars
SET [Money]=@Value2
WHERE PS_GameData.dbo.Chars.CharID=@CharID
END
END
just removed every 116 from the db
Do you see a delete instruction ? I don't.

The first query you pasted is what most people use. It's ok, somewhat fixes duping, but it's not the perfect solution.
05/23/2014 11:14 GMCronus#7
i know that becouse in that i removed the delete, that's why i asked the question why the other


AS
DECLARE @CharLeave int

SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
SET @CharLeave = 1

IF @ActionType = '116'--Trade Item-remove item from originator
BEGIN
WAITFOR DELAY '00:00:05'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
EXEC PS_GameData.dbo.usp_Save_Char_Item_Del_E @CharID=@CharID, @IDList=@Value1
END
END

IF @ActionType = '164'--Trade Gold-remove gold from originator
BEGIN

WAITFOR DELAY '00:00:05'--Time delay to give the duper time to log out fully

SELECT @CharLeave=Leave
FROM PS_userdata.dbo.Users_Master
WHERE UserUID=@UserUID

IF @CharLeave=0
BEGIN
UPDATE PS_GameData.dbo.Chars
SET [Money]=@Value2
WHERE PS_GameData.dbo.Chars.CharID=@CharID
END
END

delete items that's not even beeing suppose to delete. like when ppl trade normaly, stacks normaly.

IF @CharLeave=0
BEGIN
EXEC PS_GameData.dbo.usp_Save_Char_Item_Del_E @CharID=@CharID, @IDList=@Value1
END
END

this one keeps deleteing the wrong items too
05/23/2014 11:20 nubness#8
Replace
Code:
EXEC PS_GameData.dbo.usp_Save_Char_Item_Del_E @CharID=@CharID, @IDList=@Value1
with
Code:
DELETE PS_GameData.dbo.CharItems WHERE CharID = @CharID AND ItemUID = @Value1
05/23/2014 11:27 GMCronus#9
ty ty i'll try that too. skip it in the first place. ok i admit nubb this time it was me


sorry
05/23/2014 12:07 nubness#10
No worries. Just keep in mind that a properly formulated question contains 50% of the answer.
05/23/2014 12:08 GMCronus#11
true. problem i hade was this kind of worked before but out of no where it starts deleting items and i'm like totaly lost as it's not going on all of the time. well hope this fix it for good