Hi how to setting auto add gc new account in RaGEZONE Community Edition!
Thanks
sory my bad English
Printable View
Hi how to setting auto add gc new account in RaGEZONE Community Edition!
Thanks
sory my bad English
Code:-- ----------------------------
-- Procedure structure for [dbo].[WZ_ACCOUNT_CREATE]
-- ----------------------------
-- ----------------------------
-- Procedure structure for [dbo].[WZ_ACCOUNT_CREATE]
-- ----------------------------
-- ----------------------------
-- Procedure structure for [dbo].[WZ_ACCOUNT_CREATE]
-- ----------------------------
-- ----------------------------
-- Procedure structure for [dbo].[WZ_ACCOUNT_CREATE]
-- ----------------------------
-- ----------------------------
-- Procedure structure for [dbo].[WZ_ACCOUNT_CREATE]
-- ----------------------------
-- ----------------------------
-- Procedure structure for [WZ_ACCOUNT_CREATE]
-- ----------------------------
ALTER PROCEDURE [dbo].[WZ_ACCOUNT_CREATE]
@in_IP varchar(64),
@in_Email varchar(128),
@in_Password varchar(64),
@in_ReferralID int,
@in_SerialKey varchar(128),
@in_SerialEmail varchar(128)
AS
BEGIN
SET NOCOUNT ON;
-- Close Register from Launcher
-- select 2 as ResultCode, 'Registeration from Patcher/Launcher was closed.' as ResultMsg;
-- return;
--
-- NOTE: add new ResultCodes to updater CUpdater::CreateAccThreadEntry
--
-- check for serial key
--declare @KEYResultCode int = 99
--declare @KEYCustomerID int = 99
--declare @KeyserialType int = 99
--exec [BreezeNet].[dbo].[BN_WarZ_SerialGetInfo]
-- @in_SerialKey,
-- @in_SerialEmail,
-- @KEYResultCode out,
-- @KEYCustomerID out,
-- @KeyserialType out
--if @KEYResultCode <> 0 or @KEYCustomerID > 0) begin
-- select 3 as ResultCode, 'Serial not valid' as ResultMsg;
-- return
--end
declare @KeyserialType int = 2 -- Legend Package
-- check if that account was created and refunded before (status 999)
declare @ReFundCustomerID int = 0
select @ReFundCustomerID=CustomerID from Accounts WHERE email=@in_Email and AccountStatus=999
if @ReFundCustomerID > 0) begin
-- change email to some unique one so it can be used again.
declare @dateTime varchar(128)
set @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),111),'/','') + REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','')
declare @ReFundedEmail varchar(128) = '(' + @dateTime + ') ' + @in_Email
update Accounts set email @ReFundedEmail where CustomerID @ReFundCustomerID
end
-- validate that email is unique
if exists (SELECT CustomerID from Accounts WHERE email=@in_Email) begin
select 2 as ResultCode, 'Email already in use' as ResultMsg;
return;
end
-- create user
declare @MD5FromPwd varchar(100)
exec FN_CreateMD5Password @in_Password, @MD5FromPwd OUTPUT
INSERT INTO Accounts (
email,
MD5Password,
dateregistered,
ReferralID,
lastlogindate,
lastloginIP
) VALUES (
@in_EMail,
@MD5FromPwd,
GETDATE(),
@in_ReferralID,
GETDATE(),
@in_IP
)
-- get new CustomerID
declare @CustomerID int
SELECT @CustomerID=CustomerID from Accounts where email=@in_Email
-- create all needed user tables
INSERT INTO UsersData (
CustomerID,
AccountType,
dateregistered,
IsPunisher
) VALUES (
@CustomerID,
'2',
GETDATE(),
'0'
)
-- guest accounts have 48hrs play time (sync with WZ_ACCOUNT_APPLYKEY also)
if @KeyserialType = 3) begin
declare @dateActiveUntil datetime = DATEADD(hour, 48, GETDATE())
update UsersData set DateActiveUntil @dateActiveUntil where CustomerID @CustomerID
end
-- register CustomerID in BreezeNet
-- exec [BreezeNet].[dbo].[BN_WarZ_SerialSetCustomerID] @in_SerialKey, @CustomerID
-- default items and bonuses for account types
exec FN_AddItemToUser @CustomerID, 20174, 2000 -- hero: regular guy
-- CBT TEST HEROES
exec FN_AddItemToUser @CustomerID, 20182, 2000
exec FN_AddItemToUser @CustomerID, 20184, 2000
-- 10 of each
--declare @i int = 0
--while(@i < 10) begin
-- set @i = @i + 1
-- exec FN_AddItemToUser @CustomerID, 101306, 2000 -- Flashlight
-- exec FN_AddItemToUser @CustomerID, 101261, 2000 -- Bandages
-- exec FN_AddItemToUser @CustomerID, 101296, 2000 -- Can of Soda
-- exec FN_AddItemToUser @CustomerID, 101289, 2000 -- Granola Bar
--end
-- BONUSES for packages - do not forget to sync them with [WZ_ACCOUNT_APPLYKEY]
if @KeyserialType = 0) begin
-- pioneer package, 15$ 1GC=142
update UsersData set GamePoints=(GamePoints+50000) where CustomerID @CustomerID
end
if @KeyserialType = 0) begin
-- pioneer package, 15$ 1GC=142
update UsersData set GameDollars=(GameDollars+50000) where CustomerID @CustomerID
end
-- success
select 0 as ResultCode
select @CustomerID as CustomerID, @KeyserialType as 'AccountType'
return
END
- - - Updated - - -
You can change this code 50000 where this can put the value that would
-- BONUSES for packages - do not forget to sync them with [WZ_ACCOUNT_APPLYKEY]
if @KeyserialType = 0) begin
-- pioneer package, 15$ 1GC=142
update UsersData set GamePoints=(GamePoints+50000) where CustomerID @CustomerID
end
if @KeyserialType = 0) begin
-- pioneer package, 15$ 1GC=142
update UsersData set GameDollars=(GameDollars+50000) where CustomerID @CustomerID
end
-- success
select 0 as ResultCode
select @CustomerID as CustomerID, @KeyserialType as 'AccountType'
return
END
[IMG]http://image.ohozaa.com/i/669/pJLP7T.JPG[/IMG]
error this line
this:Quote:
where CustomerID @CustomerID
Shouldn't it be this?Quote:
where CustomerID=@CustomerID
Or is mssql so fucked up?
if (@KeyserialType = 0) begin
-- Survivor package, 0$ 1GC=142
update UsersData set GameDollars=(GameDollars+1000) where CustomerID=@CustomerID
end
whats the point of your post?