Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 30.07.2007, 13:26   #1
Forcer
Архивный участник
 
Join Date: Apr 2006
Posts: 554
Default [Share] Anti Clan Penalty

Hi, im just looking procedures and find nice one.
I only corrected it, not tested.
But seems it will be work correct.
When player ousted from clan, clan\player will not receive any penalty.
Test it please, and don't forget about DB backup!
Btw: Fix me pls, if i re-wrote something wrong.
Btw2: This proc is not affects ally penalty, clan & clan wars only.
And sry for my bad eng.
Code:
CREATE PROCEDURE [DBO].[lin_UpdatePledgeInfo]
(
@fieldName	nvarchar(50),
@field_data	INT,
@char_id	INT
)
AS
SET NOCOUNT ON

IF @fieldName = N'pledge_dismiss_time' begin update user_data set pledge_dismiss_time = 0 where char_id =  @char_id end
ELSE IF @fieldName = N'pledge_ousted_time' begin update user_data set pledge_ousted_time = 0 where char_id =  @char_id end
ELSE IF @fieldName = N'pledge_withdraw_time' begin update user_data set pledge_withdraw_time = 0 where char_id =  @char_id end
ELSE IF @fieldName = N'surrender_war_id' begin update user_data set surrender_war_id = @field_data where char_id =  @char_id end
ELSE 
BEGIN 
	RAISERROR ('lin_UpdatePledgeInfo : invalid field [%s]', 16, 1, @fieldName)
	RETURN -1	
END

GO
You also can create procedure that removes current penalties from clan, clan wars and ally.
Code:
CREATE PROC ClearPenalty
AS
UPDATE user_data SET pledge_withdraw_time=0 WHERE pledge_withdraw_time>0
UPDATE user_data SET pledge_ousted_time=0 WHERE pledge_ousted_time>0
UPDATE Pledge SET dismiss_reserved_time=0 WHERE dismiss_reserved_time>0
UPDATE Pledge SET alliance_withdraw_time=0 WHERE alliance_withdraw_time>0
UPDATE Pledge SET alliance_dismiss_time=0 WHERE alliance_dismiss_time>0
UPDATE Pledge SET alliance_ousted_time=0 WHERE alliance_ousted_time>0
UPDATE Pledge SET oust_time=0 WHERE oust_time>0
UPDATE Alliance SET oust_time=0 WHERE oust_time>0
GO
Add calling "ClearPenalty" to your scheduler, and don't forget to reboot server after "Clean"
Forcer 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 16:34.