decomp DBCServer_Release and inspect/document database

This commit is contained in:
Benjamin Palko 2026-10-14 23:22:03 -04:00
parent 4b267cbe05
commit 7834b98bf0
28222 changed files with 843300 additions and 144 deletions

View file

@ -0,0 +1,12 @@
CREATE procedure [dbo].[up_add_inquiry_count]
@auth_id uniqueidentifier
as
set nocount on
declare @inquiry_count tinyint;
select @inquiry_count = [InquiryCount] from [AuthTable] with (READUNCOMMITTED) where [AuthID] = @auth_id;
UPDATE [AuthTable] SET [InquiryCount] = @inquiry_count + 1 WHERE [AuthID] = @auth_id;
return @@error

View file

@ -0,0 +1,75 @@
CREATE procedure [dbo].[up_ado_data_mapping]
@bcust_id nvarchar(50),
@UUID uniqueidentifier,
@OnLine tinyint,
@ServerID smallint,
@ChannelID int,
@CharExp bigint,
@CharName nvarchar(16),
@IP nchar(16),
@fValue float,
@btValue tinyint,
@bGift bit,
@dDouble datetime,
@CharClass int
as
BEGIN
set nocount on
-- create table TTMapping (
-- @bcust_id nvarchar(50),
-- UUID uniqueidentifier,
-- OnLine tinyint,
-- ServerID smallint,
-- ChannelID int,
-- CharExp bigint,
-- CharName nvarchar(16),
-- IP nchar(16),
-- fValue float,
-- btValue tinyint,
-- bGift bit,
-- dDouble datetime,
-- CharClass int
-- )
INSERT INTO dbo.TTMapping (
windy_code,
UUID ,
OnLine ,
ServerID,
ChannelID,
CharExp ,
CharName,
IP ,
fValue ,
btValue ,
bGift ,
dDouble ,
CharClass
)
--
VALUES (
@bcust_id ,
@UUID ,
@OnLine ,
@ServerID ,
@ChannelID ,
@CharExp ,
@CharName ,
@IP ,
@fValue ,
@btValue ,
@bGift ,
@dDouble ,
@CharClass
--
)
select * from dbo.TTMapping
END

View file

@ -0,0 +1,13 @@
CREATE procedure [dbo].[up_auth_agentaccount]
@Account nvarchar(16),
@Password nvarchar(32)
as
BEGIN
set nocount on
set transaction isolation level read uncommitted
select permission from dbo.AgentAccount where [Account] = @Account and [Password] = @Password
return @@error
END

View file

@ -0,0 +1,11 @@
create procedure [dbo].[up_change_world]
@old_world_id int,
@new_world_id int
as
set nocount on
begin
UPDATE [dbo].[AuthTable] SET [world_id] = @new_world_id where [world_id] = @old_world_id
end
return @@error

View file

@ -0,0 +1,9 @@
CREATE procedure [dbo].[up_delete_inquiry]
@character_id uniqueidentifier
as
set nocount on
delete from [dbo].[InquiryTable] where [character_id] = @character_id
return @@error

View file

@ -0,0 +1,37 @@
CREATE procedure [dbo].[up_get_auth_id]
@bcust_id nvarchar(50),
@UUID uniqueidentifier,
@channelling int,
@mac_addr char(17),
@mac_addr02 char(17),
@mac_addr03 char(17)
as
set nocount on
declare @login_count bigint
set @login_count = -1
if exists (select AuthID from AuthTable with (nolock) where WindyCode = @bcust_id)
begin
select @login_count = [LCount] from AuthTable with (nolock) where WindyCode = @bcust_id
select AuthID, online, DBCIndex, InquiryCount, CashMileage, [pc_room_point] from AuthTable with (nolock) where WindyCode = @bcust_id
--Online Login Count
update AuthTable set [online] = '1', [LCount] = @login_count+1, ServerType = 'G', ServerIP=0, HostID=0, mac_addr=@mac_addr, mac_addr02=@mac_addr02, mac_addr03=@mac_addr03 from AuthTable where WindyCode = @bcust_id
return;
end
declare @LastAuthID bigint;
select @LastAuthID = [Value] from GlobalVariableTable with (nolock) where VarName = 'LastAuthID'
update GlobalVariableTable set [Value] = @LastAuthID+1 where VarName = 'LastAuthID'
insert into AuthTable
values( @bcust_id, 0, @UUID, @LastAuthID, '1', GetDate(), GetDate(), GetDate(), 0, 1, 0, 'G', 0, -1, 5, 0, 0, @channelling, 0, 0, @mac_addr, @mac_addr02, @mac_addr03, '' )
select AuthID, online, DBCIndex, InquiryCount, CashMileage, [pc_room_point] from AuthTable with (nolock) where WindyCode = @bcust_id
return @@error

View file

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[up_get_pcroominfo]
(
@szIP nvarchar(24)
)
as
begin
set nocount on
--declare @sql nvarchar(1000)
--set @sql= 'select * from openquery(PcRoom, '
-- + '''select Level from tbCustomerIP
-- where IP = '''''
-- + @szIP + ''''' '')'
--exec(@sql)
--select InquiryCount as [Level] from AuthTable where IP = @szIP
select 0 as [Level]
end

View file

@ -0,0 +1,15 @@
CREATE procedure [dbo].[up_get_second_pass]
@bcust_id nvarchar(50)
as
set nocount on
if exists (select AuthID from AuthTable with (nolock) where WindyCode = @bcust_id)
begin
select second_pass from AuthTable with (nolock) where WindyCode = @bcust_id
return;
end
select '';
return @@error

View file

@ -0,0 +1,14 @@
CREATE procedure [dbo].[up_gm_add]
@account nvarchar(16),
@pass nvarchar(16)
as
set nocount on
declare @LastGMID bigint;
select @LastGMID = [Value] from GlobalVariableTable with (nolock) where VarName = 'LastGMID'
update GlobalVariableTable set [Value] = @LastGMID+1 where VarName = 'LastGMID'
insert into GMInfoTable values ( @LastGMID, @account , @pass, 100, GETDATE() )
return @@error

View file

@ -0,0 +1,10 @@
create procedure [dbo].[up_gm_change_pass]
@gm_id int,
@pass nvarchar(16)
as
set nocount on
UPDATE [dbo].[GMInfoTable] SET [pass] = @pass WHERE [gm_id] = @gm_id
return @@error

View file

@ -0,0 +1,9 @@
create procedure [dbo].[up_gm_del]
@account nvarchar(16)
as
set nocount on
DELETE FROM [dbo].[GMInfoTable] WHERE name = @account
return @@error

View file

@ -0,0 +1,12 @@
CREATE procedure [dbo].[up_gm_login]
@account nvarchar(16),
@pass nvarchar(16)
as
set nocount on
set transaction isolation level read uncommitted
select gm_id, [name], permission from GMInfoTable where [name] = @account and [pass] = @pass
return @@error

View file

@ -0,0 +1,26 @@
CREATE procedure [dbo].[up_init_auth]
as
set nocount on
INSERT INTO [dbo].[GlobalVariableTable] ([VarName] ,[Value]) VALUES ('LastAuthID' ,1)
INSERT INTO [dbo].[GlobalVariableTable] ([VarName] ,[Value]) VALUES ('LastGMID' ,1)
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 1 ,'GameServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 2 ,'DungeonServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 3 ,'PVPServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 5 ,'GuildServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 6 ,'MessageServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 7 ,'GMServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 8 ,'GameGatewayServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 9 ,'ManagerServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 10 ,'AuctionServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 11 ,'MatchServer_Release_CHN_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 12 ,'DBCServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 13 ,'Agent_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 17 ,'DBCServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 18 ,'DBCServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 19 ,'DBCServer_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 21 ,'AgentManager_Release_x64.exe' )
INSERT INTO [dbo].[ServerFile] ([type] ,[filename]) VALUES ( 24 ,'PatchServer_Release_x64.exe' )

View file

@ -0,0 +1,34 @@
CREATE procedure [dbo].[up_init_auth_link]
@db_src nvarchar(32),
@db_account nvarchar(32),
@db_pass nvarchar(32)
as
set nocount on
--링크드 서버 설정
--서버등록
EXEC sp_addlinkedserver
@server='RustyHeartsLinkAuth', -- 링크드서버이름, 기본값없음
@srvproduct = '', -- OLEDB 데이터원본제품이름, 기본값NULL
@provider = 'SQLOLEDB', -- 공급자고유식별자
@datasrc = @db_src, -- 데이터원본이름
@provstr='', -- OLEDB 공급자연결문자열, 기본값NULL
@catalog='RustyHearts_Auth' -- 공급자연결카다로그, 데이터베이스이름
--서버등록확인
SELECT * FROM master.dbo.sysservers
--연결계정등록
EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'RustyHeartsLinkAuth', -- 링크드서버이름, 기본값없음
@useself = 'false', -- 로그인이름사용유무, 기본값true
@locallogin = NULL, -- 로컬서버로그인여부, 기본값NULL
@rmtuser = @db_account, -- 사용자이름
@rmtpassword = @db_pass -- 사용자암호
EXEC SP_SERVEROPTION [RustyHeartsLinkAuth], 'RPC OUT' , 'TRUE'

View file

@ -0,0 +1,37 @@
create procedure [dbo].[up_init_log_link]
@db_src nvarchar(32),
@db_account nvarchar(32),
@db_pass nvarchar(32)
as
set nocount on
--링크드 서버 설정
--서버등록
EXEC sp_addlinkedserver
@server='RustyHearts_LogDB', -- 링크드서버이름, 기본값없음
@srvproduct = '', -- OLEDB 데이터원본제품이름, 기본값NULL
@provider = 'SQLOLEDB', -- 공급자고유식별자
@datasrc = @db_src, -- 데이터원본이름
@provstr='', -- OLEDB 공급자연결문자열, 기본값NULL
@catalog='RustyHearts_Log' -- 공급자연결카다로그, 데이터베이스이름
--서버등록확인
SELECT * FROM master.dbo.sysservers
--연결계정등록
EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'RustyHearts_LogDB', -- 링크드서버이름, 기본값없음
@useself = 'false', -- 로그인이름사용유무, 기본값true
@locallogin = NULL, -- 로컬서버로그인여부, 기본값NULL
@rmtuser = @db_account, -- 사용자이름
@rmtpassword = @db_pass -- 사용자암호
EXEC SP_SERVEROPTION [RustyHearts_LogDB], 'RPC OUT' , 'TRUE'
return @@error

View file

@ -0,0 +1,24 @@
CREATE procedure [dbo].[up_insert_agentaccount]
@Account nvarchar(16),
@Password nvarchar(16)
as
BEGIN
set nocount on
BEGIN TRAN
if NOT EXISTS (select Account from dbo.AgentAccount with (nolock) where [Account] = @Account)
begin
insert into dbo.AgentAccount ( [Account], [Password] ) values
( @Account, @Password );
end
if(@@error <> 0 )
BEGIN
ROLLBACK TRAN
return
END
COMMIT TRAN
END

View file

@ -0,0 +1,19 @@
CREATE procedure [dbo].[up_insert_agentaccount_by_query]
@ID nvarchar(16),
@PASSWORD char(16),
@PERMISSION int
as
set nocount on
if NOT EXISTS (select @ID from dbo.AgentAccount with (nolock) where [Account] = @ID)
begin
declare @PASSWORD_LENGTH int
declare @PASSWORD_MD5 nvarchar(32)
set @PASSWORD_LENGTH = len(@PASSWORD)
set @PASSWORD_MD5 = SUBSTRING(master.dbo.fn_varbintohexstr( HashBytes('MD5', SUBSTRING(@PASSWORD, 1, @PASSWORD_LENGTH))), 3, 32)
insert into dbo.AgentAccount( [Account], [Password], [Permission] ) values( @ID, @PASSWORD_MD5, @PERMISSION )
end

View file

@ -0,0 +1,24 @@
CREATE procedure [dbo].[up_insert_blacklist]
@IP nvarchar(15),
@State int,
@Cause nvarchar(50),
@GmID nvarchar(15)
as
set nocount on
begin tran
if NOT EXISTS (select IP from dbo.BlackListTable with (nolock) where [IP] = @IP)
begin
insert into dbo.BlackListTable ( [IP], [State], [Cause], [GmID] ) values
( @IP, @State, @Cause, @GmID );
end
if(@@error <> 0 )
begin
rollback
return
end
commit

View file

@ -0,0 +1,23 @@
CREATE procedure [dbo].[up_insert_channel_auto_count]
@StartCode int,
@World int,
@count int
as
set nocount on
declare @n int
set @n = 0
while @n < @count
begin
EXEC [dbo].[up_insert_channelbyAuto]
@StartCode,
@World
set @StartCode = @StartCode + 1
set @n = @n+1
end

View file

@ -0,0 +1,52 @@
CREATE procedure [dbo].[up_insert_channelbyAuto]
@Code int,
@World int
as
set nocount on
declare @i int
declare @last int
declare @current int
declare @minid int
declare @maxid int
set @i = 1
set @last = 0
set @current = 1
set @minid = 1
set @maxid = 1
select @last = ID from ChannelSeed where Last_Seed = 1 and WorldID = @World
select @maxid = MAX(ID) from ChannelSeed where WorldID = @World
select @minid = MIN(ID) from ChannelSeed where WorldID = @World
if @last = 0
begin
set @last = @minid
end
else
begin
set @last = @last+1
end
while @i <= 3
begin
if @last > @maxid
begin
set @last = @minid
end
insert into ChannelOption( Code, CH_Group, CH_Type, MinLevel, MaxLevel, CH_NUM, WorldID )
select @Code, CH_Group, CH_Type, MinLevel, MaxLevel, Current_Num, @World from ChannelSeed where ID = @last
select @current = Current_Num from ChannelSeed where ID = @last
update ChannelSeed set Current_Num = @current+1 where ID = @last
update ChannelSeed set Last_Seed = 0 where WorldID = @World
update ChannelSeed set Last_Seed = 1 where ID = @last
set @last = @last+1
set @i = @i+1
end

View file

@ -0,0 +1,32 @@
CREATE procedure [dbo].[up_insert_inquiry]
@auth_id uniqueidentifier,
@character_id uniqueidentifier,
@type tinyint,
@character_name nvarchar(16),
@bcust_id nvarchar(50),
@count tinyint,
@memo nvarchar(255),
@compulsion tinyint,
@registertime datetime
as
set nocount on
if NOT EXISTS (select @character_id from [dbo].[InquiryTable] with (READUNCOMMITTED) where [character_id] = @character_id)
begin
insert into InquiryTable
values
(
@auth_id,
@character_id,
@type,
@character_name,
@bcust_id,
@count,
@memo,
@compulsion,
@registertime
);
end
return @@error

View file

@ -0,0 +1,41 @@
CREATE procedure [dbo].[up_insert_inquiry_by_gm]
@type tinyint,
@character_name nvarchar(16),
@memo nvarchar(255),
@compulsion tinyint
as
set nocount on
declare @auth_id uniqueidentifier
declare @character_id uniqueidentifier
declare @bcust_id nvarchar(50)
declare @count tinyint
set @bcust_id = ''
select @auth_id = [AuthID], @character_id = [character_id], @bcust_id = RTRIM(bcust_id) from [dbo].[CharacterTable] with (READUNCOMMITTED) where [Name] = @character_name
select @count = [InquiryCount] from [RustyHearts_Auth].[dbo].[AuthTable] with (READUNCOMMITTED) where [AuthID] = @auth_id
set xact_abort on
if NOT EXISTS ( select @character_id from [dbo].[InquiryTable] with (READUNCOMMITTED) where [character_id] = @character_id )
begin
insert into InquiryTable
values
(
@auth_id,
@character_id,
@type,
@character_name,
@bcust_id,
@count,
@memo,
@compulsion,
GETDATE()
);
end
select * from [dbo].[InquiryTable] with (READUNCOMMITTED) where character_id = @character_id
return @@error

View file

@ -0,0 +1,38 @@
CREATE procedure [dbo].[up_insert_log_auth_succeed]
@AuthID [uniqueidentifier],
@server smallint,
@real_ip varchar(16)
as begin
set nocount on
-------------------------------------------------------
-- 접속 유저 로그 DB로 보내기
declare @bcust_id nvarchar(50)
declare @char_name nvarchar(30)
declare @character_id [uniqueidentifier]
set @bcust_id = ''
set @char_name = ''
set @character_id = '00000000-0000-0000-0000-000000000000'
declare @sql nvarchar(max)
set @sql = ' select top 1 @bcust_id = WindyCode from openquery([RustyHeartsLinkAuth]
, ''select top 1 WindyCode
from [RustyHearts_Auth].[dbo].[AuthTable]
where AuthID = '''''+convert(varchar(255),@AuthID)+''''''')'
select @sql
begin
-- select @bcust_id=WindyCode from [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] where AuthID = @AuthID
exec dbo.sp_executesql @sql, N'@bcust_id nvarchar(50) output', @bcust_id output
select @bcust_id
exec RustyHearts_LogDB.RustyHearts_Log.dbo.up_SetConnectionUV 4, @server, @AuthID, @bcust_id,
@character_id, @char_name, 0, @real_ip, 0, 0, 0, 0
end
-------------------------------------------------------
end

View file

@ -0,0 +1,144 @@
create procedure [dbo].[up_lock2]
@spid1 int = NULL, /* server process id to check for locks */
@spid2 int = NULL /* other process id to check for locks */
as
set nocount on
/*
** Show the locks for both parameters.
*/
declare @objid int,
@dbid int,
@string Nvarchar(255)
CREATE TABLE #locktable
(
spid smallint
,loginname nvarchar(20)
,hostname nvarchar(30)
,dbid int
,dbname nvarchar(20)
,objId int
,ObjName nvarchar(128)
,IndId int
,Type nvarchar(4)
,Resource nvarchar(16)
,Mode nvarchar(8)
,Status nvarchar(5)
)
if @spid1 is not NULL
begin
INSERT #locktable
(
spid
,loginname
,hostname
,dbid
,dbname
,objId
,ObjName
,IndId
,Type
,Resource
,Mode
,Status
)
select convert (smallint, l.req_spid)
--,coalesce(substring (user_name(req_spid), 1, 20),'')
,coalesce(substring (s.loginame, 1, 20),'')
,coalesce(substring (s.hostname, 1, 30),'')
,l.rsc_dbid
,substring (db_name(l.rsc_dbid), 1, 20)
,l.rsc_objid
,''
,l.rsc_indid
,substring (v.name, 1, 4)
,substring (l.rsc_text, 1, 16)
,substring (u.name, 1, 8)
,substring (x.name, 1, 5)
from master.dbo.syslockinfo l,
master.dbo.spt_values v,
master.dbo.spt_values x,
master.dbo.spt_values u,
master.dbo.sysprocesses s
where l.rsc_type = v.number
and v.type = 'LR'
and l.req_status = x.number
and x.type = 'LS'
and l.req_mode + 1 = u.number
and u.type = 'L'
and req_spid in (@spid1, @spid2)
and req_spid = s.spid
end
/*
** No parameters, so show all the locks.
*/
else
begin
INSERT #locktable
(
spid
,loginname
,hostname
,dbid
,dbname
,objId
,ObjName
,IndId
,Type
,Resource
,Mode
,Status
)
select convert (smallint, l.req_spid)
--,coalesce(substring (user_name(req_spid), 1, 20),'')
,coalesce(substring (s.loginame, 1, 20),'')
,coalesce(substring (s.hostname, 1, 30),'')
,l.rsc_dbid
,substring (db_name(l.rsc_dbid), 1, 20)
,l.rsc_objid
,''
,l.rsc_indid
,substring (v.name, 1, 4)
,substring (l.rsc_text, 1, 16)
,substring (u.name, 1, 8)
,substring (x.name, 1, 5)
from master.dbo.syslockinfo l,
master.dbo.spt_values v,
master.dbo.spt_values x,
master.dbo.spt_values u,
master.dbo.sysprocesses s
where l.rsc_type = v.number
and v.type = 'LR'
and l.req_status = x.number
and x.type = 'LS'
and l.req_mode + 1 = u.number
and u.type = 'L'
and req_spid = s.spid
order by spID
END
DECLARE lock_cursor CURSOR
FOR SELECT dbid, ObjId FROM #locktable WHERE Type ='TAB'
OPEN lock_cursor
FETCH NEXT FROM lock_cursor INTO @dbid, @ObjId
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @string =
'USE ' + db_name(@dbid) + char(13)
+ 'UPDATE #locktable SET ObjName = object_name('
+ convert(varchar(32),@objId) + ') WHERE dbid = ' + convert(varchar(32),@dbId)
+ ' AND objid = ' + convert(varchar(32),@objId)
EXECUTE (@string)
FETCH NEXT FROM lock_cursor INTO @dbid, @ObjId
END
CLOSE lock_cursor
DEALLOCATE lock_cursor
SELECT * FROM #locktable
return (0)
-- END up_lock2

View file

@ -0,0 +1,10 @@
CREATE procedure [dbo].[up_read_agentmanager]
@code int
as
set nocount on
begin
select * FROM [dbo].[ServerOption] with (nolock) where code = @code
end

View file

@ -0,0 +1,9 @@
CREATE procedure [dbo].[up_read_all_serveroption]
as
set nocount on
select * FROM [dbo].[ServerOption] with (READUNCOMMITTED) WHERE Useable = 'Y'
return @@error

View file

@ -0,0 +1,9 @@
CREATE procedure [dbo].[up_read_all_serveroption_dns]
as
set nocount on
select * FROM [dbo].[ServerOptionDNS] with (nolock) where [Use] = 'Y'
return @@error

View file

@ -0,0 +1,15 @@
CREATE procedure [dbo].[up_read_auth_agent]
as
set nocount on
set transaction isolation level read uncommitted
select
[Account],
[Password],
[permission]
FROM [dbo].[AgentAccount]
return @@error

View file

@ -0,0 +1,13 @@
CREATE PROCEDURE [dbo].[up_read_auth_blacklist]
AS
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT
IP,
Type
FROM dbo.BlackListTable where [Use] > 0
return @@error

View file

@ -0,0 +1,15 @@
CREATE PROCEDURE [dbo].[up_read_auth_pcroom]
AS
SET NOCOUNT ON
set transaction isolation level read uncommitted
SELECT
szIP
,szName
,Premium
,expireDate
FROM dbo.PCRoom where [Use] > 0
return @@error

View file

@ -0,0 +1,20 @@
CREATE procedure [dbo].[up_read_channelinfo]
@Code int,
@World int
as
set nocount on
set transaction isolation level read uncommitted
select
CH_Group,
CH_Type,
MinLevel,
MaxLevel,
CH_NUM
from dbo.ChannelOption
where Code = @Code AND WorldID = @World
return @@error

View file

@ -0,0 +1,10 @@
CREATE procedure [dbo].[up_read_inquiry]
as
set nocount on
set transaction isolation level read uncommitted
select * from dbo.InquiryTable
return @@error

View file

@ -0,0 +1,11 @@
CREATE procedure [dbo].[up_read_inquiry_character]
@character_id [uniqueidentifier]
as
set nocount on
set transaction isolation level read uncommitted
select * from dbo.InquiryTable with (nolock) where [character_id] = @character_id;
return @@error

View file

@ -0,0 +1,11 @@
create procedure [dbo].[up_read_pc_room_point]
@AuthID uniqueidentifier
as
set nocount on
set transaction isolation level read uncommitted
select [pc_room_point] from AuthTable where AuthID = @AuthID
return @@error

View file

@ -0,0 +1,11 @@
CREATE procedure [dbo].[up_read_realtimeevent]
as
set nocount on
set transaction isolation level read uncommitted
select * FROM [dbo].[RealTimeEventTable]
return @@error

View file

@ -0,0 +1,11 @@
CREATE procedure [dbo].[up_read_serverfile]
as
set nocount on
set transaction isolation level read uncommitted
select * FROM [dbo].[ServerFile]
return @@error

View file

@ -0,0 +1,7 @@
CREATE procedure [dbo].[up_read_world_server]
as
set nocount on select * FROM [dbo].[WorldServer] with (nolock) where UseAble = 'Y'
return @@error

View file

@ -0,0 +1,9 @@
create procedure [dbo].[up_save_first_character]
@auth_id uniqueidentifier
as
set nocount on
update AuthTable set [CTime] = GETDATE() from AuthTable where AuthID = @auth_id
return @@error

View file

@ -0,0 +1,13 @@
CREATE procedure [dbo].[up_save_ip]
@auth_id uniqueidentifier,
@real_ip varchar(16),
@server_ip varchar(16),
@host_id int,
@DBCIndex smallint
as
set nocount on
update AuthTable set [online]='1',[IP] = @real_ip, [ServerIP] = @server_ip, [ServerType]='G', [HostID]=@host_id, [DBCIndex]=@DBCIndex from AuthTable where AuthID = @auth_id
return @@error

View file

@ -0,0 +1,14 @@
CREATE procedure [dbo].[up_save_logout]
@auth_id uniqueidentifier
as begin
set nocount on
declare @last_time datetime
select @last_time = BTime from AuthTable where AuthID = @auth_id
update AuthTable set world_id=0, [online] = '0', [BTime] = GETDATE(), [LTime] = @last_time from AuthTable where AuthID = @auth_id
end
return @@error

View file

@ -0,0 +1,35 @@
CREATE procedure [dbo].[up_save_logout_log]
@auth_id uniqueidentifier,
@CharID [uniqueidentifier],
@server smallint,
@channelID int,
@name nvarchar(16),
@real_ip varchar(16),
@inven_gold int,
@storage_gold int,
@character_level int,
@character_exp bigint,
@log_type smallint,
@bcust_id nvarchar(50)
as begin
set nocount on
begin
exec [RustyHearts_LogDB].[RustyHearts_Log].[dbo].up_LogOut @log_type,
@server,
@auth_id,
@bcust_id,
@CharID,
@name,
@channelID,
@real_ip,
@inven_gold,
@storage_gold,
@character_level,
@character_exp
end
-------------------------------------------------------
end
return @@error

View file

@ -0,0 +1,10 @@
create procedure [dbo].[up_save_pc_room_point]
@AuthID uniqueidentifier,
@PCRoomPoint int
as
set nocount on
update AuthTable Set [pc_room_point] = @PCRoomPoint where AuthID = @AuthID
return @@error

View file

@ -0,0 +1,14 @@
CREATE procedure [dbo].[up_save_server_info]
@auth_id uniqueidentifier,
@real_ip varchar(16),
@server_ip varchar(16),
@host_id int,
@ServerType char(2),
@ServerID int
as
set nocount on
update AuthTable set [online]='1',[world_id]=@ServerID, [IP] = @real_ip, [ServerIP] = @server_ip, [ServerType]=@ServerType, [HostID]=@host_id from AuthTable where AuthID = @auth_id
return @@error

View file

@ -0,0 +1,10 @@
CREATE procedure [dbo].[up_server_down_log_out]
@host_id int,
@ServerID int
as
set nocount on
update AuthTable set [online]='0',[ServerType]='0', [HostID]=0 from AuthTable where [HostID] = @host_id and [world_id] = @ServerID
return @@error

View file

@ -0,0 +1,6 @@
CREATE procedure [dbo].[up_set_second_pass]
@auth_id uniqueidentifier,
@second_pass varchar(32)
as
set nocount on

View file

@ -0,0 +1,11 @@
create procedure [dbo].[up_update_agentaccount_md5]
as
set nocount on
begin
UPDATE AgentAccount
SET Password = SUBSTRING(master.dbo.fn_varbintohexstr( HashBytes('MD5', Password)), 3, 32)
end

View file

@ -0,0 +1,10 @@
CREATE procedure [dbo].[up_update_cash_mileage]
@auth_id uniqueidentifier,
@mileage int
as
set nocount on
UPDATE [dbo].[AuthTable] SET [CashMileage] = @mileage WHERE [AuthID] = @auth_id
return @@error

View file

@ -0,0 +1,12 @@
CREATE procedure [dbo].[up_update_event_inquiry]
@auth_id [uniqueidentifier],
@inquiry tinyint
as
begin
set nocount on
update AuthTable set event_inquiry = @inquiry where AuthID = @auth_id
end

View file

@ -0,0 +1,13 @@
CREATE procedure [dbo].[up_update_inquiry]
@character_id uniqueidentifier,
@type tinyint,
@memo nvarchar(255)
as
set nocount on
UPDATE [dbo].[InquiryTable] SET
[type] = @type,
[memo] = @memo WHERE [character_id] = @character_id
return @@error

View file

@ -0,0 +1,11 @@
CREATE procedure [dbo].[up_update_inquiry_count]
@auth_id uniqueidentifier,
@count tinyint
as
set nocount on
--UPDATE [RustyHeartsLinkAuth].[RustyHearts_Auth].[dbo].[AuthTable] SET [InquiryCount] = @count WHERE [AuthID] = @auth_id
return @@error

View file

@ -0,0 +1,12 @@
CREATE procedure [dbo].[up_update_inquiry_type]
@character_id uniqueidentifier,
@type tinyint
as
set nocount on
begin tran
UPDATE [dbo].[InquiryTable] SET [type] = @type WHERE [character_id] = @character_id
return @@error