Just wanted to report back. Works like a charm, thanks a lot pyrok!
I just fixed demonroro's login so it works with md5 hashes.
Account table:
USE [Auth]
GO
/****** Object: Table [dbo].[Accounts] Script Date: 05/02/2011 23:19:11 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Accounts]') AND type in (N'U'))
DROP TABLE [dbo].[Accounts]
GO
USE [Auth]
GO
/****** Object: Table [dbo].[Accounts] Script Date: 05/02/2011 23:19:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Accounts](
[account_id] [int] IDENTITY(1,1) NOT NULL,
[login_name] [nvarchar](31) NULL,
[password] [nvarchar](32) NULL,
[block] [int] NULL,
[withdraw_remain_time] [int] NULL,
[age] [int] NULL,
[auth_ok] [int] NULL,
[pcbang] [int] NULL,
[last_login_server_idx] [int] NULL,
[event_code] [int] NULL,
[server_list_mask] [nvarchar](31) NULL,
[result] [int] NULL,
[ip] [int] NULL,
[game_code] [nvarchar](50) NULL,
[gamecode] [varchar](50) NULL,
PRIMARY KEY CLUSTERED
(
[account_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
Account procedure:
USE [Auth]
GO
/****** Object: StoredProcedure [dbo].[smp_account] Script Date: 05/02/2011 23:20:01 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[smp_account]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[smp_account]
GO
USE [Auth]
GO
/****** Object: StoredProcedure [dbo].[smp_account] Script Date: 05/02/2011 23:20:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- start of smp_insert_character
CREATE PROCEDURE [dbo].[smp_account]
@IN_ACCOUNT nvarchar(31),
@IN_GAMECODE nvarchar(50),
@IN_PASSWORD nvarchar(32)
AS
SET NOCOUNT ON
--IF NOT EXISTS ( SELECT * FROM dbo.Accounts WHERE login_name = @IN_ACCOUNT )
-- INSERT dbo.Accounts( login_name,ip,password ) VALUES( @IN_ACCOUNT,0,@IN_ACCOUNT )
SELECT * FROM dbo.Accounts WHERE login_name = @IN_ACCOUNT --AND password = @IN_PASSWORD
SELECT * FROM dbo.Accounts WHERE password = @IN_PASSWORD
RETURN @@ERROR
GO
Commands to send to the game server:
set game.use_login_logout_debug 1
set io.port 4514
set io.ip_address 127.0.0.1
set server_name RappelZ
set auth.server_name RappelZ
Commands to send to the auth server:
start_service
set db.auth.use_md5 1
set db.auth.md5_key rappelz
set db.auth.debug_md5 1
set game.open_external 1
At the end, send the following command to the game server:
You can use any MD5 hash generator to generate your password. I personally prefer
one.
For example, if you want to log in with the following credentials:
Quote:
Name: Link404
Password: ZomG.MD5
|
And you set the md5 key just like below:
Quote:
set db.auth.md5_key rappelz
|
Then you have to get the md5 hash of:
Quote:
The result is:
Quote:
aa1dfb7ce49f5131ee5a2dfb073d20cb
|
In your account table, you insert this md5 hash as your password.
Means, the syntax is:
Code:
[B]md5key[/B][U]+password[/U]
Let's start fixing the bugs now.