Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 22.07.2007, 10:46   #1
ebosh
Архивный участник
 
Join Date: Sep 2006
Posts: 109
Default

Quote:
Originally Posted by hr View Post
посмотри как сделана проверка в lin_CreateChar
Спасибо за подсказку, сразу чтот и не подумал...

Тогда берем из процедуры lin_CreateChar следующее:
Quote:
declare @user_prohibit_word nvarchar(20)
select top 1 @user_prohibit_word = words from user_prohibit_word (nolock) where @char_name like '%' + words + '%'
if @user_prohibit_word is not null
begin
RAISERROR ('Character name has prohibited word: name = [%s], word[%s]', 16, 1, @char_name, @user_prohibit_word)
RETURN -1
end
И добавляем сюда:
Quote:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


/****** Object: Stored Procedure dbo.lin_SetUserNickname Script Date: 2003-09-20 ?? 11:51:57 ******/
ALTER PROCEDURE
[dbo].[lin_SetUserNickname] (@user_id INT, @nickname NVARCHAR(50))
AS

SET NOCOUNT ON

declare @user_prohibit_word nvarchar(20)
select top 1 @user_prohibit_word = words from user_prohibit_word (nolock) where @nickname like '%' + words + '%'
if @user_prohibit_word is not null
begin
RAISERROR ('Character title has prohibited word: name = [%s], word[%s]', 16, 1, @nickname, @user_prohibit_word)
RETURN -1
end

DECLARE @ret INT

UPDATE user_data
SET nickname = @nickname
WHERE char_id = @user_id

IF @@ERROR = 0 AND @@ROWCOUNT = 1
BEGIN
SELECT @ret = @user_id
END
ELSE
BEGIN
SELECT @ret = 0
END

SELECT @ret
Вроде все правильно, теперь добавляем в табличку user_prohibit_word, слова которые мы хотим запретить. Ушол на тесты...
ebosh is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 21:14.