Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Guides & Releases
You last visited: Today at 05:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE] FIX for Bank teller DC problem

Discussion on [RELEASE] FIX for Bank teller DC problem within the Shaiya PServer Guides & Releases forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2011
Posts: 108
Received Thanks: 269
Cool [RELEASE] FIX for Bank teller DC problem

i have not fully 100 % tested with populated server and stuff like that it was tested on my local server first atempt proved dc happened aproxamently 15 mins after removeing an item from the bank teller due to errors in procs so i fixed what i seen and retryed again and lasted aproxamently 30 mins with absolutly no dc opened the db and checked the tabel the item removed from the bank teller had vanished from the tabel as it should i baught a stack of glod bars just after removeing the item from the bank teller and wated the 30 mins no dc so i reloged compleatly out to force the db to update all player info for the account and reloged the item ( includeing the stack of bars) stayed in my bag and never apeared in the bank again. with what small test i did i have to conclude under my test sercumstances this infact dose fix the bank dc ishue.


what needs to be done run these few quarys to alter ( fix ) the procs errors.


not shure if this first quary has any signifacants to the dc ishue but i edited it also so i included it for just incase.
PHP Code:
USE [PS_Billing]
GO
/****** Object:  StoredProcedure [dbo].[usp_Insert_AuctionProduct_User_E]    Script Date: 01/31/2012 22:16:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER  Proc 
[dbo].[usp_Insert_AuctionProduct_User_E]

@
UserUID int,
@
ProductCode varchar(20),
@
SecurityCode varchar(16)


--@
UserUID     => 유저개정키
--@ProductCode     => Item Code(GoodCode)
--@
SecurityCode => Passphrase

-- RETURN
--  
=> Success.
-- -
=> Security code error.
-- -
=> 은행슬롯 꽉참.
-- -=> Add items in error.
-- -
=> Item code does not exist.
-- -
=> INSERT Error (DB error)

--
WITH ENCRYPTION



AS

SET NOCOUNT ON

DECLARE @SlotCnt    int
DECLARE @SlotMax    int
DECLARE @SlotUse    int
DECLARE @I        int
DECLARE @J        int
DECLARE @StrItemID    varchar(20)
DECLARE @
StrItemCount    varchar(20)
DECLARE @
Query        nvarchar(1000)
DECLARE @
ItemID        int
DECLARE @ItemCount    tinyint
DECLARE @Ret        int
DECLARE @OrderNumber    int
DECLARE @VerifyCode    bigint


SET 
@Ret 0
SET 
@SlotMax 240

SET 
@OrderNumber 9999
SET 
@VerifyCode 9999

BEGIN TRANSACTION

CREATE TABLE 
#SlotList( SlotNum int NOT NULL )

INSERT INTO #SlotList SELECT Slot FROM Users_Product WHERE UserUID=@UserUID ORDER BY Slot

SET @SlotCnt = ( SELECT ISNULL(COUNT(*),0FROM #SlotList )

IF( @SlotCnt >= @SlotMax )
BEGIN
    
-- Item has exceeded number (bank slots kkwakcham)
    
SET @Ret = -2
    
GOTO ERROR_RETURN
END

SET 
@1

WHILE( @<= 24 )
BEGIN
    SET 
@StrItemID 'ItemID' CAST( @AS varchar(5) )
    
SET @StrItemCount 'ItemCount' CAST( @AS varchar(5) )

    
SET @Query 'SELECT @ItemID='+@StrItemID+', @ItemCount='+@StrItemCount+' FROM AuctionProductList WHERE ProductCode='''+@ProductCode+''''

    
EXEC sp_executesql @QueryN'@ItemID int OUTPUT, @ItemCount tinyint OUTPUT', @ItemID OUTPUT, @ItemCount OUTPUT

    
IF( (@ItemID IS NOT NULL) AND (@ItemCount IS NOT NULL) AND (@ItemID <> 0) ) 
    
BEGIN
        SET 
@0

        
WHILE( @< @SlotMax )
        
BEGIN
            SET 
@SlotUse = ( SELECT ISNULL(COUNT(*),0FROM #SlotList WHERE SlotNum=@J )
            
IF( @SlotUse )
            
BEGIN
                INSERT INTO Users_Product
(UserUID,Slot,ItemID,ItemCount,ProductCode,OrderNumber,VerifyCode,BuyDateVALUES(@UserUID,@J,@ItemID,@ItemCount,@ProductCode,@OrderNumber,@VerifyCode,GETDATE())
                IF( @@
ERROR )
                
BEGIN
                    INSERT INTO 
#SlotList(SlotNum) VALUES(@J)
                    
BREAK
                
END
                
ELSE
                
BEGIN
                    
-- Insert error
                    SET 
@Ret = -5
                    
GOTO ERROR_RETURN
                END
            END
            
            SET 
@= @1
        END

        
IF( @>= @SlotMax )
        
BEGIN
            
-- Lack of slots (not add the item)
            
SET @Ret = -3
            
GOTO ERROR_RETURN
        END
    END
    
ELSE IF( @)
    
BEGIN
        
-- Product table data error (the product code does not exist)
        
SET @Ret = -4
        
GOTO ERROR_RETURN
    END

    SET 
@= @1
END

ERROR_RETURN
:

DROP TABLE #SlotList

IF( @@ERROR AND @Ret )
BEGIN
    COMMIT TRAN
    
RETURN 0
END
ELSE
BEGIN
    ROLLBACK TRAN
    
RETURN @Ret
END

SET NOCOUNT OFF 
this quarys is the culprit for the dc/rollback ishue as it is what the logs stated in the server files.

PHP Code:
USE [PS_GameData]
GO
/****** Object:  StoredProcedure [dbo].[usp_Save_Char_Product_Item_E]    Script Date: 01/31/2012 22:23:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Proc 
[dbo].[usp_Save_Char_Product_Item_E]

@
ServerID tinyint,
@
UserUID int,
@
BankSlot tinyint,
@
CharID int,
@
ItemUID bigint,
@
Bag tinyint,
@
Slot tinyint,
@
ItemID int,
@
Type tinyint,
@
TypeID tinyint,
@
Quality smallint,    --int
@Gem1 tinyint,
@
Gem2 tinyint,
@
Gem3 tinyint,
@
Gem4 tinyint,
@
Gem5 tinyint,
@
Gem6 tinyint,
@
Craftname varchar(20) = ''
@
Count tinyint,
@
Maketime datetime,
@
Maketype varchar(1)    --char(1)

AS

--
SET NOCOUNT ON
SET XACT_ABORT ON

DECLARE @ProductCode varchar(20)
DECLARE @
OrderNumber int
DECLARE @VerifyCode bigint
DECLARE @BuyDate datetime

IF(@Quality >= 5000)
BEGIN
    SET 
@Quality=0
END

BEGIN DISTRIBUTED TRANSACTION

-- Add inventory
INSERT INTO CharItems
(CharID,Bag,Slot,ItemID,Type,TypeID,ItemUID,Quality,Gem1,Gem2,Gem3,Gem4
Gem5,Gem6,CraftName,[Count],Maketime,Maketype)
VALUES(@CharID,@Bag,@Slot,@ItemID,@Type,@TypeID,@ItemUID,@Quality,@Gem1,@Gem2,@Gem3,@Gem4
@
Gem5,@Gem6,@Craftname,@Count,@Maketime,@Maketype)

-- 
Logging receipt of goods
SELECT 
@ProductCode=ProductCode,@OrderNumber=OrderNumber,@VerifyCode=VerifyCode,@BuyDate=BuyDate
FROM PS_Billing
.dbo.Users_Product 
WHERE UserUID
=@UserUID AND Slot=@BankSlot

INSERT INTO ProductLog
(ServerID,UserUID,CharID,ItemID,ItemUID,Quality,ItemCount,ProductCode,OrderNumber,VerifyCode,BuyDate,ReceiveDate)
VALUES(@ServerID,@UserUID,@CharID,@ItemID,@ItemUID,@Quality,@Count,@ProductCode,@OrderNumber,@VerifyCode,@BuyDate,@Maketime)

-- 
Deleting the bank storage
DELETE FROM PS_Billing
.dbo.Users_Product WHERE UserUID=@UserUID AND Slot=@BankSlot

IF( @@ERROR=AND @@ROWCOUNT=1)
BEGIN
    COMMIT TRAN
    
RETURN 1
END
ELSE
BEGIN
    ROLLBACK TRAN
    
RETURN -1
END

SET XACT_ABORT OFF
--SET NOCOUNT OFF 
[DEV]xXDASHXx is offline  
Thanks
30 Users
Old 10/11/2013, 22:20   #2
 
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 18
Problem is still propagated, still dc and rollback
accuface35 is offline  
Old 10/12/2013, 08:17   #3
 
elite*gold: LOCKED
Join Date: Oct 2013
Posts: 3,414
Received Thanks: 1,844
Quote:
Originally Posted by accuface35 View Post
Problem is still propagated, still dc and rollback
You know that it's posted in 2012?
Stureplan is offline  
Old 10/12/2013, 09:59   #4
 
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 18
yes but i have always this error
accuface35 is offline  
Old 10/12/2013, 10:41   #5
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
Quote:
Originally Posted by MidZero View Post
You know that it's posted in 2012?
As a secret, the way the databases work hasn't changed since then, so the fix is still supposed to work, if you apply it properly of course. I don't see anything wrong with him posting that it doesn't work for him. He just doesn't specify any details, that's the disturbing part.
nubness is offline  
Old 10/12/2013, 12:20   #6
 
elite*gold: 0
Join Date: Feb 2011
Posts: 295
Received Thanks: 18
my error is dc when the gamer put anything in warehouse and take this item, then becomes dc and the item is again in warehouse
accuface35 is offline  
Old 11/03/2015, 15:14   #7
 
Apero's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 156
Received Thanks: 42
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'OrderNumber'.
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'VerifyCode'.
Apero is offline  
Old 11/03/2015, 18:35   #8
 
elite*gold: 0
Join Date: May 2012
Posts: 394
Received Thanks: 391
Quote:
Originally Posted by Apero View Post
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'OrderNumber'.
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'VerifyCode'.
You would be better off posting a new thread with your problem, instead of one that has been inactive for 2 years.

Also, the problem you are having (whatever it might be) is clearly something wrong with your OrderNumber and VerifyCode columns in whatever table you are trying to make changes to. If you can't figure that much out, you need to seriously learn more about SQL before trying to do whatever it is you are trying.
Truth1010 is offline  
Old 11/03/2015, 21:03   #9
 
Apero's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 156
Received Thanks: 42
If not criticize you why you were on the board?
Because 95% of your response are critical and constructive nothing
Apero is offline  
Old 11/03/2015, 22:02   #10
 
elite*gold: 0
Join Date: May 2012
Posts: 394
Received Thanks: 391
Quote:
Originally Posted by Truth1010 View Post
Also, the problem you are having (whatever it might be) is clearly something wrong with your OrderNumber and VerifyCode columns in whatever table you are trying to make changes to.
Erm... i think that was "constructive" to your post?
Truth1010 is offline  
Old 11/04/2015, 18:28   #11
 
wallerus's Avatar
 
elite*gold: 0
Join Date: Apr 2014
Posts: 300
Received Thanks: 472
Quote:
Originally Posted by Apero View Post
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'OrderNumber'.
Msg 207, Level 16, State 1, Procedure usp_Save_Char_Product_Item_E, Line 49
Invalid column name 'VerifyCode'.
Read and understand what the script is actually doing. Kinda sick of people whose first instinct is to post their problem and not even trying to troubleshoot it themselves. Learn some basic SQL otherwise stop trying.
wallerus is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
[Help]Bank Teller
08/22/2010 - Shaiya Private Server - 2 Replies
Hey guys and Gals I know the stored Proc to send items to the Bank teller and it works great again thumbs up for the people who answered me. My problem is that when the person takes the item out it Dced them shortly after and the item is back the bank. This causes me problems as you can imagine. I have been messing around with it trying to figure out why it is doing that and can't find anything.. If anyone has any help in this matter that would be amazing:handsdown: Thank you!
simple fortune teller
03/06/2010 - CO2 PServer Guides & Releases - 1 Replies
this only very simple moonbox cuz i cant code the original moonbox quest, so i decide to a simple one,#region fortune teller case 302: { if (Control == 0) { GC.AddSend(Packets.NPCSay("did you hear of palace method?")); GC.AddSend(Packets.NPCLink("palace method?", 1)); ...
[WTS] Pizza auf blauem Teller!
03/18/2008 - Off Topic - 1 Replies
Pizza liegt auf einem blauen Teller und ist Aufwärmbereit! 200Thanks'es VHB! http://imgnow.de/uploads/DSC000028fcJPG.jpg



All times are GMT +2. The time now is 05:01.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.