Well, i've tried to search and i only found how to activate for 2.2.3.2
Can you help me how to activate premium for BSB? DB is BillCruxRF
ty
Printable View
Well, i've tried to search and i only found how to activate for 2.2.3.2
Can you help me how to activate premium for BSB? DB is BillCruxRF
ty
1. Change rfacc.ini in a folder with my account login billing agent for this:
[Options]
DBSTR = Provider = MSDASQL; DSN = BILLING; UID = sa; PWD = password;
ErrDBSTR =
LogLevel = 2
2. Change rfacc.ini in the folder area on this:
[Options]
DBSTR = Provider = SQLOLEDB; Source = localhost; UID = sa; PWD = password; Initial Catalog = BILLING;
ErrDBSTR =
LogLevel = 2
3.1 Create a database BILLING fill it from a script
3.2 Put the fixCode:USE [BILLING]
GO
/****** Object: Table [dbo].[tbl_user] Script Date: 05/06/2009 20:53:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_user](
[ID] [int] NOT NULL,
[UserID] [varchar](20) NOT NULL,
[Cash] [float] NOT NULL,
CONSTRAINT [PK_tbl_user] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbl_personal_billing] Script Date: 05/06/2009 20:53:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_personal_billing](
[ID] [binary](13) NOT NULL,
[BillingType] [int] NOT NULL,
[EndDate] [datetime] NOT NULL,
[RemainTime] [int] NULL,
CONSTRAINT [PK2_personal_billing] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbl_cashlogrf] Script Date: 05/06/2009 20:53:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_cashlogrf](
[userid] [varchar](20) NOT NULL,
[character] [varchar](50) NOT NULL,
[pscode] [varchar](20) NOT NULL,
[quantity] [int] NOT NULL,
[server] [varchar](50) NOT NULL,
[scode] [bigint] NOT NULL,
[price] [int] NOT NULL,
[dcrate] [int] NOT NULL,
[Date] [datetime] NOT NULL,
[status] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[tbl_cashList] Script Date: 05/06/2009 20:53:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_cashList](
[id] [varchar](20) NOT NULL,
[name] [varchar](50) NOT NULL,
[cost] [int] NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object: StoredProcedure [dbo].[RF_PING] Script Date: 05/06/2009 20:53:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[RF_PING]
as
DECLARE @strCmd VARCHAR(60)
declare @strServerIP VARCHAR(50)
set @strServerIP = '127.0.0.1'
SELECT @strCmd = 'ping ' + @strServerIP
EXEC Master..xp_cmdShell @strCmd
GO
/****** Object: StoredProcedure [dbo].[RF_CheckBalance] Script Date: 05/06/2009 20:53:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[RF_CheckBalance]
@s_userid varchar(50)
, @p2 float OUTPUT
AS
SET NOCOUNT ON
SELECT @p2 = Cash
FROM tbl_user WITH (READUNCOMMITTED)
WHERE UserID = @s_userid
return @p2
GO
/****** Object: StoredProcedure [dbo].[RF_CheckAccountStatus] Script Date: 05/06/2009 20:53:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[RF_CheckAccountStatus]
@id varchar(20),
@p2 int output
AS
declare @end_time datetime
declare @cur_time datetime
declare @billtype int
SELECT @end_time = EndDate FROM tbl_personal_billing WHERE ID = CONVERT(BINARY, @id)
Select @cur_time = GETDATE()
select @billtype= Billingtype from tbl_personal_billing WHERE ID = CONVERT(BINARY, @id)
if @billtype = 1
begin
set @p2 = 1
return
end
else if @end_time <= @cur_time
begin
set @p2 = 0
update tbl_personal_billing set BillingType = 1 WHERE ID = CONVERT(BINARY, @id)
return
end
else
begin
set @p2 = 2
return
end
GO
/****** Object: StoredProcedure [dbo].[RF_ChargeBalance] Script Date: 05/06/2009 20:53:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[RF_ChargeBalance]
@s_userid varchar(20)
, @s_character varchar(50)
, @s_pscode varchar(20)
, @s_quantity int
, @s_server varchar (50)
, @s_scode bigint
, @s_price int
, @s_dcrate int
, @p9 int output
AS
set nocount on
DECLARE
@totalAmount as int,
@ProductAmount as int,
@cashBalance as int
select @cashBalance=Cash from tbl_user where UserID=@s_userid
select @productAmount=cost from tbl_cashList where id=@s_pscode
set @totalAmount=@productAmount*@s_quantity
if @@error <> 0
begin
set @p9=0
return
end
else
if @s_userid is null or RTrim(@s_userid)=''
begin
set @p9=0
return
end
else if @s_pscode is null or len(@s_pscode)<>'7'
begin
set @p9=0
return
end
else if @s_price is null or rtrim(@s_price)='' or @s_price<'0'
begin
set @p9=0
return
end
else if @s_quantity is null or @s_quantity<='0' or @s_quantity >= '100'
begin
set @p9=0
return
end
else if @s_scode is null or rtrim(@s_scode) =''
begin
set @p9=0
return
end
else if @s_server is null or rtrim(@s_server)=''
begin
set @p9=0
return
end
else if @s_character is null or rtrim(@s_character)=''
begin
set @p9=0
return
end
else if @productAmount != @s_price or @s_price<=0 or @productAmount <=0 or @productAmount is null
begin
set @p9=0
return
end
else if @totalAmount > @CashBalance
begin
set @p9=0
return
end
set @cashBalance=@cashbalance-@totalAmount
if @@error<>0
begin
set @p9=0
return
end
else
begin
set @p9=1
insert into tbl_cashlogrf (userid,character,pscode,quantity,server,scode,price,dcrate,status)
values (@s_userid,@s_character,@s_pscode,@s_quantity,@s_server,@s_scode,@s_price,@s_dcrate,@p9)
update tbl_user set Cash=@cashbalance where UserID=@s_userid
return
end
GO
/****** Object: Default [DF1_tbl_cashlog_Date] Script Date: 05/06/2009 20:53:52 ******/
ALTER TABLE [dbo].[tbl_cashlogrf] ADD CONSTRAINT [DF1_tbl_cashlog_Date] DEFAULT (getdate()) FOR [Date]
GO
/****** Object: Default [DF2_tbl_personal_billing_accounttype] Script Date: 05/06/2009 20:53:52 ******/
ALTER TABLE [dbo].[tbl_personal_billing] ADD CONSTRAINT [DF2_tbl_personal_billing_accounttype] DEFAULT ((0)) FOR [BillingType]
GO
/****** Object: Default [DF2_tbl_personal_billing_RemainTime] Script Date: 05/06/2009 20:53:52 ******/
ALTER TABLE [dbo].[tbl_personal_billing] ADD CONSTRAINT [DF2_tbl_personal_billing_RemainTime] DEFAULT ((0)) FOR [RemainTime]
GO
/****** Object: Default [DF_tbl_user_Cash] Script Date: 05/06/2009 20:53:52 ******/
ALTER TABLE [dbo].[tbl_user] ADD CONSTRAINT [DF_tbl_user_Cash] DEFAULT ((0)) FOR [Cash]
GO
3.4 Remove the table and apply RF_User requestCode:USE [BILLING]
GO
/****** Object: StoredProcedure [dbo].[RF_ChargeBalance] by TriRozhka Script Date: 02/19/2010 15:25:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[RF_ChargeBalance]
@s_userid varchar(12)
, @s_character varchar(50)
, @s_pscode varchar(20)
, @s_quantity int
, @s_server varchar (50)
, @s_scode bigint
, @s_price int
, @s_dcrate int
, @p9 int output
AS
set nocount on
DECLARE
@totalAmount int,
@cashBalance int
select @cashBalance=Cash from tbl_user where UserID=@s_userid
set @totalAmount=@s_price*@s_quantity
if @@error <> 0 or @s_quantity < 1 or @s_quantity >99 or @s_price < 1
begin
set @p9 = 0
return
end
else
if @s_dcrate < 100 and (@totalAmount*((100-@s_dcrate)/100)) <= @cashBalance
begin
set @p9 = 1
set @cashBalance=@cashbalance-(@totalAmount*((100-@s_dcrate)/100))
insert into tbl_cashlogrf (userid,character,pscode,quantity,server,scode,price,dcrate,status)
values (@s_userid,@s_character,@s_pscode,@s_quantity,@s_server,@s_scode,@s_price,@s_dcrate,@p9)
update tbl_user set Cash = @cashBalance where UserID = @s_userid
return
end
else
if (@cashbalance + @s_dcrate) >= @totalAmount
begin
set @p9 = 1
set @cashBalance=@cashbalance-@totalAmount+@s_dcrate
insert into tbl_cashlogrf (userid,character,pscode,quantity,server,scode,price,dcrate,status)
values (@s_userid,@s_character,@s_pscode,@s_quantity,@s_server,@s_scode,@s_price,@s_dcrate,@p9)
update tbl_user set Cash = @cashBalance where UserID = @s_userid
return
end
else
begin
set @p9 = 0
return
end
GO
4. Change the name of the procedure in the database RF_User pSelect_AccountPass_China on pSelect_AccountPass (If the server is not)Code:USE [BILLING]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbl_user](
[ID] [int] IDENTITY(0,1) NOT NULL,
[UserID] [varchar](20) NOT NULL,
[Cash] [float] NOT NULL,
CONSTRAINT [PK_tbl_user] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[tbl_user] ADD CONSTRAINT [DF_tbl_user_Cash] DEFAULT ((0)) FOR [Cash]
GO
5. Logins from RF_User.tbl_rfaccount should be moved to BILLING.tbl_personal_billing and BILLING.tbl_user (in the nick is important only 2 column in the first login ID, for example Acre)
transfer request to the billing account
Code:insert into BILLING.dbo.tbl_personal_billing (id, BillingType, EndDate, RemainTime)
select id, 1, GETDATE(), 0 from RF_USER.dbo.tbl_rfaccount
insert into BILLING.dbo.tbl_user (UserID, Cash)
select id, 0 from RF_USER.dbo.tbl_rfaccount
update RF_User.dbo.tbl_rfaccount
set accounttype = 1
where accounttype = 0