Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

RaiderZ Launcher v2 (checks ID/Pass)

Joined
Apr 16, 2007
Messages
441
Reaction score
204
First post updated with launcher v3 you can now use the register script, and login using the launcher.
 
Last edited:
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
PHP:
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'RZ_ACCOUNTDB'., SQL state S0002 in SQLExecDirect in C:\AppServ\www\RaiderZ\register.php on line 13

Fatal error: Call to undefined function num_rows() in C:\AppServ\www\RaiderZ\register.php on line 14

Only messed with the Host, User, and Pass.
And yeah, I do have the Databases created.

EDIT:
Here is phant0m's fixed script:
register.php
PHP:
<?php
require_once('db.config.php');

$username = isset($_POST['username']) ? mssql_escape_string(trim($_POST['username'])) : '';
$password = isset($_POST['password']) ? mssql_escape_string(trim($_POST['password'])) : '';
$loginarg = md5($_POST['username'].time().$_POST['password']);
$errors = array();
$success = false;
if(isset($_POST) && !empty($_POST)){
	require_once('db.php');
	
	// Validate user name.
	$result = @mssql_query("SELECT USER_ID FROM RZ_ACCOUNT WHERE USER_ID = '{$username}'") or die('Failed to verify if the provided user named already exists.');
	if(empty($username)){
		$errors[] = 'Please provide a user name.';
	}else if(strlen($username) < 3 || strlen($username) > 16){
		$errors[] = 'User name must be between 3 and 16 characters in length.';
	}else if(ctype_alnum($username) === false){
		$errors[] = 'User name must consist of numbers and letters only.';
	}else if(mssql_num_rows($result)){
		$errors[] = 'User name already exists, please choose a different user name.';
	}
	// Validate user password.
	if(empty($password)){
		$errors[] = 'Please provide a password.';
	}else if(strlen($password) < 3 || strlen($password) > 16){
		$errors[] = 'Password must be between 3 and 16 characters in length.';
	}

	// Persist the new account to the database if no previous errors occured.
	if(count($errors) == 0){
		$sql = "DECLARE @ACCN_ID BIGINT;
    EXEC dbo.USP_RZ_GLOBAL_ID @ACCN_ID OUTPUT;

INSERT INTO dbo.RZ_ACCOUNT
				(ACCN_ID,USER_ID,SITE_CODE,SITE_USER_ID,PWD,ACC_PTM)
				
VALUES (@ACCN_ID,'{$username}','{$loginarg}','{$username}','',0)";

		// Remove the @ symbol here to see what the SQL error message is when running the above query in $sql.
		if($result = mssql_query($sql)){
			$success = "Account {$username} successfully created!";
		}else{
			// This means the insert statement is probably not valid for your database.  Fix the query or fix your database, your choice ;)
			$errors[] = 'Failed to create a new account, please try again later';
		}
	}
}
// Determine which view to show.
if($success === false){
	require_once('register.view.php');
}else{
	require_once('success.view.php');
}
?>
No clue where he got ACCOUNT_ID in his.
 
Last edited:
Joined
Apr 16, 2007
Messages
441
Reaction score
204
lol i forgot to add in ACCN_ID in my register.php my bad. in my database i set ACCN_ID as int instead of bigint. and set it to add by 1 every time someone register so its organized from 1 - 100+ and has no need to be in my register.php sorry about that.
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Oh, it's fine. I just fixed the script to where other users, who are probably not going to mess with the database, could use it.

I like what you are doing, but doesn't it already do that?
 
Joined
Apr 16, 2007
Messages
441
Reaction score
204
nope it needs to be entered in manually. and if the ACCN_ID is wrong example. in the database the latest ACCN_ID is lets say 630 and it counts down 629,628 etc. the register.php enters in ACCN_ID 650 and you login create a char i believe that new char will be created under 631. i could be wrong i remember encounter this problem awhile ago.
 
Joined
Mar 22, 2008
Messages
830
Reaction score
158
ACCOUNT_ID is account name (add manually to database so MY UPDATE to launcher works)
If im not wrong, SITE_CODE is not used to login to the client, that's why I created ACCOUNT_ID and USER_ID stores the hashes,which are called by the launcher after checking ACCOUNT_ID and PWD.
 
Last edited:
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Hmm, ok. But there was nothing about adding anything to the DB to make this work. Which is why the script didn't work for me.

The way I have it is that the md5 hashed password is in the SITE_CODE area since there was no ACCOUNT_ID column in my database.

Was it supposed to go somewhere else?
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Thanks, and what do you need done to your script?
 
Joined
Apr 16, 2007
Messages
441
Reaction score
204
Thanks, and what do you need done to your script?

Right-click RZ_ACCOUNT select edit scroll down, and find the last row ACCN_ID. copy that number it has to be your number. Then right-click RZ_ACCOUNT select "Design" and adjust the settings to the picture that i attached. save it if you have a problem saving it then rename RZ_ACCOUNT to RZ_ACCOUNT2 or something right-click Tables under RZ_ACCOUNTDB and select "New Table" and make that new table have the same settings as picture step2.jpg then save as RZ_ACCOUNT. Hope that helps.
 

Attachments

You must be registered for see attachments list
Last edited:
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Alright, let me see what I can do :)

Also, I'm trying to register MSINET.OCX file, but it is giving me errors.

"The module MSINET.OCX was loaded but the call to DLLRegisterServer failed with error code 0x8002801c."

EDIT: Never mind, damn Vista. Everything has to be "Run As Administrator"
 
Last edited:
Joined
Apr 16, 2007
Messages
441
Reaction score
204
Alright, let me see what I can do :)

Also, I'm trying to register MSINET.OCX file, but it is giving me errors.

"The module MSINET.OCX was loaded but the call to DLLRegisterServer failed with error code 0x8002801c."

EDIT: Never mind, damn Vista. Everything has to be "Run As Administrator"

lol yea i was about to say that.
 
DRGunZ 2 Creator
Loyal Member
Joined
Jan 21, 2007
Messages
4,493
Reaction score
161
Here is a SQL Script that will fix that, but you will lose all account data.
PHP:
USE [RZ_ACCOUNTDB]
GO

/****** Object:  Table [dbo].[RZ_ACCOUNT]    Script Date: 07/02/2011 03:25:35 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RZ_ACCOUNT]') AND type in (N'U'))
DROP TABLE [dbo].[RZ_ACCOUNT]
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[RZ_ACCOUNT](
	[ACCN_ID] [int] IDENTITY(639,1) NOT NULL,
	[USER_ID] [nvarchar](32) NULL,
	[SITE_CODE] [nvarchar](32) NOT NULL,
	[SITE_USER_ID] [nvarchar](32) NOT NULL,
	[PWD] [nvarchar](32) NOT NULL,
	[ACC_PTM] [int] NOT NULL,
	[REG_DATE] [datetime] NULL,
	[UNREG_DATE] [datetime] NULL,
 CONSTRAINT [PK_RZ_ACCOUNT_ACCN_ID] PRIMARY KEY CLUSTERED 
(
	[ACCN_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UK_RZ_ACCOUNT_SITE_CODE_SITE_USER_ID] UNIQUE NONCLUSTERED 
(
	[SITE_CODE] ASC,
	[SITE_USER_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

ALTER TABLE [dbo].[RZ_ACCOUNT] ADD  DEFAULT ((0)) FOR [ACC_PTM]
GO
 
Last edited:
Joined
Apr 16, 2007
Messages
441
Reaction score
204
Here is a SQL Script that will fix that, but you will lose all account data.
PHP:
USE [RZ_ACCOUNTDB]
GO

/****** Object:  Table [dbo].[RZ_ACCOUNT]    Script Date: 07/02/2011 03:25:35 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RZ_ACCOUNT]') AND type in (N'U'))
DROP TABLE [dbo].[RZ_ACCOUNT]
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[RZ_ACCOUNT](
    [ACCN_ID] [int] IDENTITY(639,1) NOT NULL,
    [USER_ID] [nvarchar](32) NULL,
    [SITE_CODE] [nvarchar](32) NOT NULL,
    [SITE_USER_ID] [nvarchar](32) NOT NULL,
    [PWD] [nvarchar](32) NOT NULL,
    [ACC_PTM] [int] NOT NULL,
    [REG_DATE] [datetime] NULL,
    [UNREG_DATE] [datetime] NULL,
 CONSTRAINT [PK_RZ_ACCOUNT_ACCN_ID] PRIMARY KEY CLUSTERED 
(
    [ACCN_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UK_RZ_ACCOUNT_SITE_CODE_SITE_USER_ID] UNIQUE NONCLUSTERED 
(
    [SITE_CODE] ASC,
    [SITE_USER_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

ALTER TABLE [dbo].[RZ_ACCOUNT] ADD  DEFAULT ((0)) FOR [ACC_PTM]
GO

Thanks i will post this in my first post, and Launcher v5 was just released fixed a mistake in v4, and now has MD5 check so if someone tries to switch the Raiderz.exe the launcher wont launch the game if the MD5 dont match.
 
Back
Top