USE [SRO_VT_ACCOUNT] GO /****** Fixed by Jangan @ RageZone ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- ALTER procedure [dbo].[_RegisterPunishment] @UserJID int, @Type tinyint, @Executor varchar(128), @Shard smallint, @CharName varchar(16), @CharInfo varchar(256), @PosInfo varchar(64), @Guide varchar(512), @Description varchar(1024), @RaiseTime datetime, @BlockStartTime datetime, @BlockEndTime datetime, @PunishTime datetime as -- Author: Jangan @ RageZone if( exists( select UserJID from _BlockedUser with(NOLOCK) where UserJID = @UserJID and Type = @Type)) begin select -1 RETURN end declare @NewSerialNo int set @NewSerialNo = 0
insert _Punishment values( @UserJID, @Type, @Executor, @Shard, @CharName, @CharInfo, @PosInfo, @Guide, @Description, @RaiseTime, @BlockStartTime, @BlockEndTime, @PunishTime, 0) set @NewSerialNo = @@identity if( @@rowcount = 0 or @@error <> 0 or @NewSerialNo = 0 or @NewSerialNo is null) begin select -2 return end declare @UserID varchar(128) set @UserID = (SELECT StrUserID FROM TB_User where JID = @UserJID) if( @@rowcount = 0 or @@error <> 0 or @UserID is null) begin select - 2 return end insert _BlockedUser values( @UserJID, @UserID, @Type, @NewSerialNo, @BlockStartTime, @BlockEndTime) select 0