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
56
decomp/schema/RustyHearts/procs/up_add_friend.sql
Normal file
56
decomp/schema/RustyHearts/procs/up_add_friend.sql
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
CREATE PROCEDURE [dbo].[up_add_friend]
|
||||
(
|
||||
@character_id [uniqueidentifier],
|
||||
@friend_name nvarchar(16)
|
||||
)
|
||||
|
||||
|
||||
as
|
||||
set nocount on
|
||||
|
||||
declare @friend_id [uniqueidentifier];
|
||||
declare @friend_class int
|
||||
, @Block_Type tinyint
|
||||
, @friend_level int;
|
||||
set @friend_id = NULL
|
||||
|
||||
select TOP 1 @friend_id = [character_id]
|
||||
, @friend_class = [class]
|
||||
, @friend_level = [level]
|
||||
, @Block_Type = Block_Type
|
||||
from dbo.CharacterTable WITH(READUNCOMMITTED)
|
||||
WHERE [Name] = @friend_name
|
||||
|
||||
IF( @friend_id IS NOT NULL AND @Block_Type = 0 )
|
||||
BEGIN
|
||||
|
||||
if NOT EXISTS ( select TOP 1 character_id
|
||||
from dbo.FriendTableEx WITH(READUNCOMMITTED)
|
||||
where character_id = @character_id
|
||||
and friend_id = @friend_id )
|
||||
BEGIN
|
||||
|
||||
insert into dbo.FriendTableEx
|
||||
values(
|
||||
@character_id,
|
||||
@friend_id,
|
||||
@friend_name,
|
||||
@friend_class,
|
||||
0,
|
||||
'',
|
||||
GetDate()
|
||||
);
|
||||
|
||||
IF EXISTS ( SELECT TOP 1 [character_id] FROM dbo.FriendTableEx WITH(READUNCOMMITTED) WHERE [Name] = @friend_name )
|
||||
BEGIN
|
||||
|
||||
SELECT @friend_id [character_id], @friend_class [class], @friend_level [level]
|
||||
RETURN;
|
||||
|
||||
END
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
SELECT @friend_id , @friend_class , @friend_level
|
||||
RETURN;
|
||||
Loading…
Add table
Add a link
Reference in a new issue