Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 20:09

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

 

smp_check_purchased_item

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2011
Posts: 157
Received Thanks: 5
smp_check_purchased_item

You must register and activate your account in order to view images.



Please help!



OyunPozitifRappelz is offline  
Old   #2
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by OyunPozitifRappelz View Post
You must register and activate your account in order to view images.



Please help!
Enjoy

HTML Code:
USE [Telecaster]
GO
/****** Object:  StoredProcedure [dbo].[smp_check_purchased_item]    Script Date: 8/6/2012 7:03:59 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[smp_check_purchased_item]

@IN_ACCOUNT_ID INT,
@IN_SID INT,
@OUT_TOTAL_ITEM_COUNT INT OUTPUT,	/* Total Item Count */
@OUT_NEW_ITEM_COUNT INT OUTPUT,		/* New Item Count (AKA New presents received)*/
@OUT_PREMIUM_TICKET INT OUTPUT,		/* Premium Ticket Flag - 0 = No Pass*/
@OUT_PREMIUM_REST_TIME INT OUTPUT,	/* HV Pass Time Remaining */
@OUT_STAMINA_REGEN_TIME INT OUTPUT	/* Stam Regen Time (Stam Bonus) */

AS
SET NOCOUNT ON

SET @OUT_NEW_ITEM_COUNT = 10 
SET @OUT_STAMINA_REGEN_TIME = 20 

SET @OUT_PREMIUM_TICKET = 0
SET @OUT_PREMIUM_REST_TIME = 0

SELECT @OUT_PREMIUM_TICKET = COUNT(*) from PaidItem WITH (NOLOCK) where taken_account_id = @IN_ACCOUNT_ID and item_code = 910000 and valid_time > GETDATE()

IF @OUT_PREMIUM_TICKET > 0
BEGIN

/* Extend the Pass on first login after it is purchased to grant the user to full time on the pass based on the first login */
UPDATE PaidItem set valid_time = DATEADD(s, DATEDIFF(s, bought_time, GETDATE()), valid_time), taken_time = GETDATE() where taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND taken_time IS NULL

/** Combine passes by invalidating older passes and adding the combined extra time onto the most recently purchased pass **/
DECLARE @VALID_PASS_COUNT INT
SET @VALID_PASS_COUNT = 0

DECLARE @COMBINED_TIME INT
SET @COMBINED_TIME = 0

DECLARE @NEWEST_PASS INT
SET @NEWEST_PASS = -1

-- Check for more than one pass in Item Box.  If there are combine them into one pass.
SELECT @VALID_PASS_COUNT = COUNT(*) FROM PaidItem WHERE taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND valid_time > GETDATE()

IF @VALID_PASS_COUNT > 1
	BEGIN
		-- Get the combined time of all active passes
		SELECT @COMBINED_TIME = SUM(DATEDIFF(s, GETDATE(), valid_time)) from PaidItem where taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND valid_time > GETDATE()
		
		-- Select the most recent pass
		SELECT TOP (1) @NEWEST_PASS = sid from PaidItem where taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND valid_time > GETDATE() ORDER BY bought_time DESC
		
		-- Invalidate all but the most recent pass
		SET ROWCOUNT 1
		WHILE 1=1
		BEGIN
			UPDATE PaidItem set valid_time = GETDATE(), rest_item_count=0 WHERE sid IN ( SELECT TOP 1 sid FROM PaidItem WITH (NOLOCK) WHERE taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND valid_time > GETDATE() AND sid <> @NEWEST_PASS )
			IF @@ROWCOUNT = 0 BREAK
		END
		SET ROWCOUNT 0

		-- Extend the most recent pass by the Combined time - the current time
		UPDATE PaidItem set valid_time = DATEADD(s, @COMBINED_TIME, GETDATE()), rest_item_count=0 WHERE taken_account_id = @IN_ACCOUNT_ID AND item_code = 910000 AND valid_time > GETDATE()AND sid = @NEWEST_PASS
	END
-- end combine passes
	
SELECT @OUT_PREMIUM_REST_TIME = MAX(DATEDIFF(s, GETDATE(), valid_time)) from PaidItem WITH (NOLOCK) where taken_account_id = @IN_ACCOUNT_ID and item_code = 910000 and valid_time > GETDATE()

SELECT @OUT_TOTAL_ITEM_COUNT = COUNT(*) from PaidItem WITH (NOLOCK) where taken_account_id = @IN_ACCOUNT_ID and rest_item_count > 0;
SELECT @OUT_NEW_ITEM_COUNT = COUNT(*) from PaidItem WITH (NOLOCK) where taken_account_id = @IN_ACCOUNT_ID and rest_item_count > 0 and confirmed = 0;

END

RETURN @@ERROR



GO


Arthas2012 is offline  
Thanks
1 User
Old   #3
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
^^
Msg 208, Level 16, State 6, Procedure smp_check_purchased_item, Line 3
Invalid object name 'dbo.smp_check_purchased_item'.


tell plz what is it=)
mongreldogg is offline  
Old   #4
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by mongreldogg View Post
^^
Msg 208, Level 16, State 6, Procedure smp_check_purchased_item, Line 3
Invalid object name 'dbo.smp_check_purchased_item'.


tell plz what is it=)
umh.. it should work, try to delete the already one you have and be sure it's Telecaster the name of the database (if not change it in the script).


Arthas2012 is offline  
Thanks
1 User
Old   #5
 
elite*gold: 0
Join Date: Aug 2011
Posts: 161
Received Thanks: 36
edit it -_-
gruce is offline  
Thanks
2 Users
Old   #6
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
Quote:
Originally Posted by Arthas2012 View Post
umh.. it should work, try to delete the already one you have and be sure it's Telecaster the name of the database (if not change it in the script).
db name is Telecaster=)
i'm not so noob=)
and I haven't this object in my DB. And so I have created it thanks=)
Mystical xD
mongreldogg is offline  
Old   #7
 
elite*gold: 0
Join Date: Aug 2011
Posts: 161
Received Thanks: 36
Lol @@
gruce is offline  
Old   #8
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
But have another problem now.

Could not find stored procedure 'dbo.smp_raed_purchase_item_list'
(DB COM ERROR in GS)
mongreldogg is offline  
Old   #9
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by mongreldogg View Post
But have another problem now.

Could not find stored procedure 'dbo.smp_raed_purchase_item_list'
(DB COM ERROR in GS)
I edited my post, now it works.
Arthas2012 is offline  
Thanks
1 User
Old   #10
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
Quote:
Originally Posted by Arthas2012 View Post
I edited my post, now it works.
Thanks but it doesn't helped me with new error =(
mongreldogg is offline  
Old   #11
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by mongreldogg View Post
But have another problem now.

Could not find stored procedure 'dbo.smp_raed_purchase_item_list'
(DB COM ERROR in GS)
Quote:
Originally Posted by mongreldogg View Post
Thanks but it doesn't helped me with new error =(
Which error? o_O
Arthas2012 is offline  
Old   #12
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
Quote:
Originally Posted by Arthas2012 View Post
Which error? o_O
The first you quoted is an error that appears in GS when I open cash shop bag.
Not this: smp_check_purchased_item
But this: smp_read_purchase_item_list
mongreldogg is offline  
Old   #13
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by mongreldogg View Post
The first you quoted is an error that appears in GS when I open cash shop bag.
Not this: smp_check_purchased_item
But this: smp_read_purchase_item_list
come on, today i'm generous

HTML Code:
USE [Telecaster]
GO
/****** Object:  StoredProcedure [dbo].[smp_read_purchased_item_list]    Script Date: 8/6/2012 7:04:00 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[smp_read_purchased_item_list]

@IN_ACCOUNT_ID          INT
 
AS
SET NOCOUNT ON

-- ئہجإغ بہخ ؟؛خ ئأ
UPDATE dbo.PaidItem set confirmed = 1, confirmed_time = GETDATE() WHERE taken_account_id = @IN_ACCOUNT_ID and confirmed = 0;

SELECT  sid,                          -- ID
        account_id,            -- إار ء ID
        avatar_id,             -- إار ؤ ID        ( -1 ہدو؟ىباا؟،*إارحہس)
        avatar_name,           -- إار ؤ ہج        ( -1 ہدو؟ىباا؟،*إارحہس)
        server_name,                      -- إار *ِ ہج
        item_code,             -- ئہجإغؤعه
        item_count,            -- إار ئہجإغِ
        rest_item_count,                  -- ہ؛ ئہجإغ ِ
        bought_time,           -- إأ
        valid_time             -- ہب؟أ( ءارّہو؟ى-12-31 )
               
        FROM dbo.PaidItem WITH (NOLOCK) WHERE taken_account_id = @IN_ACCOUNT_ID and rest_item_count > 0 
        -- The below shows items after they have been taken
        --or sid in ( select sid from dbo.PaidItem WITH(NOLOCK) WHERE taken_account_id [email protected]_ACCOUNT_ID and rest_item_count = 0)

RETURN @@ERROR



GO
Delete it before use it (if you already have)


Arthas
Arthas2012 is offline  
Thanks
1 User
Old   #14
 
elite*gold: 30
Join Date: Mar 2012
Posts: 626
Received Thanks: 280
Quote:
Originally Posted by Arthas2012 View Post
come on, today i'm generous

HTML Code:
USE [Telecaster]
GO
/****** Object:  StoredProcedure [dbo].[smp_read_purchased_item_list]    Script Date: 8/6/2012 7:04:00 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[smp_read_purchased_item_list]

@IN_ACCOUNT_ID          INT
 
AS
SET NOCOUNT ON

-- ئہجإغ بہخ ؟؛خ ئأ
UPDATE dbo.PaidItem set confirmed = 1, confirmed_time = GETDATE() WHERE taken_account_id = @IN_ACCOUNT_ID and confirmed = 0;

SELECT  sid,                          -- ID
        account_id,            -- إار ء ID
        avatar_id,             -- إار ؤ ID        ( -1 ہدو؟ىباا؟،*إارحہس)
        avatar_name,           -- إار ؤ ہج        ( -1 ہدو؟ىباا؟،*إارحہس)
        server_name,                      -- إار *ِ ہج
        item_code,             -- ئہجإغؤعه
        item_count,            -- إار ئہجإغِ
        rest_item_count,                  -- ہ؛ ئہجإغ ِ
        bought_time,           -- إأ
        valid_time             -- ہب؟أ( ءارّہو؟ى-12-31 )
               
        FROM dbo.PaidItem WITH (NOLOCK) WHERE taken_account_id = @IN_ACCOUNT_ID and rest_item_count > 0 
        -- The below shows items after they have been taken
        --or sid in ( select sid from dbo.PaidItem WITH(NOLOCK) WHERE taken_account_id [email protected]_ACCOUNT_ID and rest_item_count = 0)

RETURN @@ERROR



GO
Delete it before use it (if you already have)


Arthas
works. thanks man)

Quote:
Originally Posted by Arthas2012 View Post
come on, today i'm generous

[/html]

Delete it before use it (if you already have)


Arthas
Oh no! Not again!
smp_takeout_commercial_item

=(((
Can you give me fix?)
Yeah i know i know I'm noob but.. Please=)
mongreldogg is offline  
Old   #15
 
elite*gold: 165
Join Date: Aug 2012
Posts: 150
Received Thanks: 72
Quote:
Originally Posted by mongreldogg View Post
works. thanks man)



Oh no! Not again!
smp_takeout_commercial_item

=(((
Can you give me fix?)
Yeah i know i know I'm noob but.. Please=)
BTW, in download center there are smp fixes dude...

and these smp it's really easy to fix..



Arthas2012 is offline  
Thanks
1 User
Reply



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 20:09.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.