decomp DBCServer_Release and inspect/document database
This commit is contained in:
parent
4b267cbe05
commit
7834b98bf0
28222 changed files with 843300 additions and 144 deletions
121
decomp/schema/RustyHearts/procs/up_mail_item_move.sql
Normal file
121
decomp/schema/RustyHearts/procs/up_mail_item_move.sql
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
CREATE PROCEDURE [dbo].[up_mail_item_move]
|
||||
@mail_id [uniqueidentifier],
|
||||
|
||||
@item_id01 [uniqueidentifier],
|
||||
@page_01 int,
|
||||
@slot_01 int,
|
||||
@over_item_id01 [uniqueidentifier],
|
||||
|
||||
@item_id02 [uniqueidentifier],
|
||||
@page_02 int,
|
||||
@slot_02 int,
|
||||
@over_item_id02 [uniqueidentifier],
|
||||
|
||||
@item_id03 [uniqueidentifier],
|
||||
@page_03 int,
|
||||
@slot_03 int,
|
||||
@over_item_id03 [uniqueidentifier]
|
||||
AS
|
||||
SET NOCOUNT ON
|
||||
|
||||
declare @src_item_count int
|
||||
, @mail_item_count int
|
||||
, @charID [uniqueidentifier]
|
||||
, @ERR INT
|
||||
|
||||
set @src_item_count = 0
|
||||
set @mail_item_count = 0
|
||||
|
||||
|
||||
BEGIN TRAN
|
||||
|
||||
UPDATE [dbo].[MailTable]
|
||||
SET [gold] = 0
|
||||
WHERE [ID] = @mail_id
|
||||
SET @ERR = @@ERROR
|
||||
IF @ERR <> 0
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN @ERR
|
||||
END
|
||||
|
||||
|
||||
--메일 아이템을 얻어 온다
|
||||
select @mail_item_count = [use_cnt]
|
||||
, @charID = [character_id]
|
||||
from [dbo].[N_MailItem] with (READUNCOMMITTED)
|
||||
where item_uid = @item_id01
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
|
||||
--인벤토리 아이템이 있는지 검사
|
||||
select @src_item_count = [use_cnt]
|
||||
from [dbo].[N_InventoryItem] with (READUNCOMMITTED)
|
||||
where item_uid = @over_item_id01
|
||||
and character_id = @charID
|
||||
and page_index = @page_01
|
||||
and slot_index = @slot_01
|
||||
|
||||
exec dbo.up_mail_item_move_sub_sqlroad @item_id01, @over_item_id01, @mail_item_count, @src_item_count, @page_01, @slot_01
|
||||
SET @ERR = @@ERROR
|
||||
IF @ERR <> 0
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN @ERR
|
||||
END
|
||||
END
|
||||
|
||||
set @src_item_count = 0
|
||||
set @mail_item_count = 0
|
||||
|
||||
select @mail_item_count = [use_cnt]
|
||||
, @charID = [character_id]
|
||||
from [dbo].[N_MailItem] with (READUNCOMMITTED)
|
||||
where item_uid = @item_id02
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
--인벤토리 아이템이 있는지 검사
|
||||
select @src_item_count = [use_cnt]
|
||||
from [dbo].[N_InventoryItem] with (READUNCOMMITTED)
|
||||
where item_uid = @over_item_id02
|
||||
and character_id = @charID
|
||||
and page_index = @page_02
|
||||
and slot_index = @slot_02
|
||||
|
||||
exec dbo.up_mail_item_move_sub_sqlroad @item_id02, @over_item_id02, @mail_item_count, @src_item_count, @page_02, @slot_02
|
||||
SET @ERR = @@ERROR
|
||||
IF @@ERROR <> 0
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN @ERR
|
||||
END
|
||||
END
|
||||
|
||||
set @src_item_count = 0
|
||||
set @mail_item_count = 0
|
||||
|
||||
select @mail_item_count = [use_cnt]
|
||||
, @charID = [character_id]
|
||||
from [dbo].[N_MailItem] with (READUNCOMMITTED)
|
||||
where item_uid = @item_id03
|
||||
IF @@ROWCOUNT > 0
|
||||
BEGIN
|
||||
--인벤토리 아이템이 있는지 검사
|
||||
select @src_item_count = [use_cnt]
|
||||
from [dbo].[N_InventoryItem] with (READUNCOMMITTED)
|
||||
where item_uid = @over_item_id03
|
||||
and character_id = @charID
|
||||
and page_index = @page_03
|
||||
and slot_index = @slot_03
|
||||
|
||||
exec dbo.up_mail_item_move_sub_sqlroad @item_id03, @over_item_id03, @mail_item_count, @src_item_count, @page_03, @slot_03
|
||||
SET @ERR = @@ERROR
|
||||
IF @@ERROR <> 0
|
||||
BEGIN
|
||||
ROLLBACK TRAN
|
||||
RETURN @ERR
|
||||
END
|
||||
END
|
||||
|
||||
COMMIT TRAN
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue