Built in Registration

11/20/2011 16:49 benoli105#1
I saw a server with a built in registration system . is there any1 who know how to do ? by that i mean , the user/pass ur gonna use to login will be your account further.
11/20/2011 21:12 JohnHeatz#2
For this you need to know what you are doing, just getting it done won't really hel you out, as if you get an error (can always happen) you won't know how to fix it, I would suggest to keep the common registration, until you actually get to know how to code that built-in registration
11/20/2011 22:17 benoli105#3
ok well , is the built in registratin that hard? i mean , harder then making a web register page .. ?
11/20/2011 22:24 JohnHeatz#4
You have to do it through your ps_game.exe/game.exe to do it properly
11/20/2011 22:32 benoli105#5
um ok well nvm bout this u can close this thread. ill continue working on a web registration page >.>
11/21/2011 10:13 Phantomangel042#6
Not only that, but even though it appears cool at a glance to have auto-registration, it kinda seems like it would turn out to be a logistical nightmare for the admins. Every time someone puts in the wrong account name, or typos it, or whatever, it makes *another* (probably useless) account. You could periodically go through and delete accounts that were never logged I suppose, but overall, is it really worth all the hassle to avoid the, what, 10 seconds it takes to register an account online? o.O Just my 2 cents. lol
11/21/2011 11:53 castor4878#7
Quote:
Originally Posted by benoli105 View Post
ok well , is the built in registratin that hard? i mean , harder then making a web register page .. ?
no it's quite easier.

registration by web-based form requires:
- setting up a php, asp, cgi, ..., http server
- running connection between http server & SQL server
- knowing how registration is done at svr game side

auto-registration only requires
- knowing how registration is done at svr game side

but the point of Phantomangel042 is important, your login process will not be able to detect any mistyping (coz its purpose is to create a new account if given user's name doesn't exist) and thus it can be confusing to players: their first reaction will be to think that they enter the correct user name and their account has been deleted or hacked.

if you still want to implement auto-registration, simply change the PS_UserData.dbo.usp_Try_GameLogin_Taiwan stored procedure

one possible version of your current script can be:

change it to be: (part of PS_UserData.dbo.usp_Try_GameLogin_Taiwan)
Code:
-- try to select user by name,password
SELECT @UserUID=[UserUID], @Status=[Status], @Leave=[Leave], @LeaveDate=LeaveDate 
FROM Users_Master
WHERE UserID = @UserID AND Pw = @InPassword

-- NotExist User OR Leave User
IF (@UserUID = -1)	--	account does not exist, will create it
BEGIN
--	define unique ID of new account
	select @UserUID=isnull(max(UserUID),0)+1 FROM Users_Master
	set @Status = 0
--	auto-register new account
	INSERT INTO Users_Master ([UserUID],[UserID],[Pw],[JoinDate],[Status])
		VALUES (@UserUID,@UserID,@InPassword,GETDATE(),@Status)
END

-- Select responses
SELECT @Status AS Status, @UserUID AS UserUID
full:

I said, auto-reg is (can be) quite easy, don't forget that it's even more easy to introduce mistakes. if your login process fails, verify *all* tests & write operations made on the PS_UserData.dbo.usp_Try_GameLogin_Taiwan and PS_UserData.dbo.usp_Try_GameLogout_R procedures to find out the errors.

but fortunately, login (with or without registration) only depends on invoked SP - it does not depend on your client game nor on the server ps_game (as long as the server components do use the SP listed herebefore).