Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
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  
Old 30.07.2007, 16:26   #2
~Marquis~
Архивный участник
 
Join Date: Dec 2006
Posts: 252
Default

I guess you need a reboot to make the penalities be erased, but this is a great share, when i test it i'll report some bugs :P, thanks.
~Marquis~ is offline  
Old 30.07.2007, 18:22   #3
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

the idea is that if you use it in a SP that cached uses when putting the clan penalty it will not be necessary to reboot
m4rk is offline  
Old 30.07.2007, 19:38   #4
ateh
Архивный участник
 
Join Date: Apr 2006
Posts: 118
Default

You can hex penalties in server's exe, just find good offset. Convert penalty time into 4 byte hex and find it in exe. You will spot the correct place cos those 4 bytes will exist few times near each other. Order is same as result of command //show_bp
ateh is offline  
Old 30.07.2007, 20:24   #5
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Quote:
Originally Posted by m4rk View Post
the idea is that if you use it in a SP that cached uses when putting the clan penalty it will not be necessary to reboot
Thats not really true, cached only execute a SP, and that SP can do anything...

In that case... im sure you need a reboot.
FidoW is offline  
Old 31.07.2007, 14:10   #6
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

yes sorry, my reasoning was wrong...
m4rk is offline  
 


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 15:16.