solving BUFF has 3 methods,
1:
edit database lin_GetUserDataByCharId
find
(SELECT * FROM user_ActiveSkill (nolock) WHERE char_id = @char_id) as uas
changed the red portion to a char without any buff on any acc ID
example:
(SELECT * FROM user_ActiveSkill (nolock) WHERE char_id = 1) as uas
this solves BUFF stacking problem,side-effects,when char goes online, no buffs
2:
simple fix for BUFF --- stored procedure need testing!
in lin2db,there's this stored procedure ap_GStat check it's element!
inside is transaction's code
change to:
/*CREATE PROCEDURE [dbo].[ap_GStat]
@account varchar(14), @uid int OUTPUT, @payStat int OUTPUT, @loginFlag int OUTPUT, @warnFlag int OUTPUT, @blockFlag int OUTPUT, @blockFlag2 int OUTPUT, @subFlag int OUTPUT, @lastworld tinyint OUTPUT
AS
SELECT @uid=uid, @payStat=pay_stat, @loginFlag = login_flag, @warnFlag = warn_flag, @blockFlag = block_flag, @blockFlag2 = block_flag2, @subFlag = subscription_flag , @lastworld=last_world FROM user_account WITH (nolock)
WHERE account=@account
GO*/
CREATE PROCEDURE [dbo].[ap_GStat]
@account varchar(14),
@uid int OUTPUT,
@payStat int OUTPUT,
@loginFlag int OUTPUT,
@warnFlag int OUTPUT,
@blockFlag int OUTPUT,
@blockFlag2 int OUTPUT,
@subFlag int OUTPUT,
@lastworld tinyint OUTPUT,
@block_end_date datetime OUTPUT
AS
DECLARE @JianGe INT
SET NOCOUNT ON
SELECT @uid=uid,
@payStat=pay_stat,
@loginFlag = login_flag,
@warnFlag = warn_flag,
@blockFlag = block_flag,
@blockFlag2 = block_flag2,
@subFlag = subscription_flag ,
@lastworld=last_world,
@block_end_date=block_end_date
FROM user_account WITH (nolock)
WHERE account=@account
SELECT @JianGe = DATEDIFF(ss, last_logout, getdate()) FROM user_account WITH (nolock) WHERE account=@account
IF @JianGe < 60
BEGIN
set @blockFlag2 = 1
END
GO
test first!!!!! can防BUFF叠加
IF @JianGe < 60 means delay of 60seconds
3:
edit ap_Gstat,solves BUFF
open ap_Gstat stored procedure,since this procedure reads account state info, solving this problem becomes alot easier
ok, in this procedure paste the code below above the word GO:
declare @lastlogin datetime
SELECT @lastlogin=last_login from user_account (nolock) where account=@account
if @lastlogin is not null and DateDiff(ss,@lastlogin,GetDate())<180
Begin
set @blockflag=1
End
|