[Ban System is bugged] ..

12/05/2011 13:13 amjed#1
Hello guys, everytime i try to ban some one

it's says [ punishment job[register] is failed : db error ]

Well i'm sure 100% from id and time i put :(

but it's keep show up this error i tried to ban 30 account :D << mad

but nothing happen


is there anyway to fix it? or anyonther way?
12/05/2011 13:53 !x_~!#2
how it's bugged and 18andLife was ban some ppl's in his servers from PVP Sro to Insane sro !
12/05/2011 14:10 LastThief#3
just create php script and you won't need smc any more
12/05/2011 14:23 zikor1337#4
Quote:
Hello,
Here's my fixed Stored Procedures for a working Punishment system (Both AutoPunishment and SMC SR_UserPunishment)

All you need is to execute the following fixed SP:-

_RegisterPunishment
PHP Code:
Code:
USE [SRO_VT_ACCOUNT]
GO
/****** Object:  StoredProcedure [dbo].[_RegisterPunishment]    UPDATED BY KOC2000 at: 10/30/2011 ******/
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
    -- ?? ??? Blocking??? ?????
    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    -- insert??? ?? ??
        return
    end
    
    -- Getting username (KiMO)
    declare @UserID varchar(25)
    SELECT @UserID = StrUserID FROM TB_User WITH (NOLOCK) WHERE JID = @UserJID
    if( @@rowcount = 0 or @@error <> 0 or @UserID is null)
    BEGIN
        SELECT -1
        RETURN
    END
    /*
    declare @UserID varchar(128)
    select @UserID = sr_id from sr_member1 where sr_code = @UserJID
    if( @@rowcount = 0 or @@error <> 0 or @UserID is null)
    begin
        select - 2
        return
    end
    */
    
    -- ??? blocking? ????
    insert _BlockedUser values( @UserJID, @UserID, @Type, @NewSerialNo, @BlockStartTime, @BlockEndTime)
    select 0 

_UpdatePunishment
PHP Code:

USE [SRO_VT_ACCOUNT]
GO
/****** Object:  StoredProcedure [dbo].[_UpdatePunishment]    UPDATED BY KOC2000 at: 10/30/2011 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- 
ALTER procedure [dbo].[_UpdatePunishment]
    @SerialNo    int,
    @UserJID    int,
    @Type        int,
    @Executor    varchar(32),
    @Shard        smallint,
    @CharName    varchar(32),
    @CharInfo    varchar(256),
    @PosInfo    varchar(64),
    @Guide        varchar(512),
    @Description    varchar(1024),
    @RaiseTime    datetime,
    @BlockStartTime    datetime,
    @BlockEndTime    datetime,
    @PunishTime    datetime
as
    if( not exists( select SerialNo from _Punishment with(NOLOCK) where SerialNo = @SerialNo))
    begin
        select -1    -- valid?? ??
        RETURN
    end
    declare @NewSerialNo int    
    set @NewSerialNo = 0
    
    -- Getting username (KiMO)
    declare @UserID varchar(25)
    SELECT @UserID = StrUserID FROM TB_User WITH (NOLOCK) WHERE JID = @UserJID
    if( @@rowcount = 0 or @@error <> 0 or @UserID is null)
    BEGIN
        SELECT -1
        RETURN
    END
    /*
    declare @UserID varchar(128)
    select @UserID = sr_id from sr_member1 where sr_code = @UserJID
    if( @@rowcount = 0 or @@error <> 0 or @UserID is null)
    begin
        select -1
        return
    end
    */
    
    update _Punishment set Status = 1 where SerialNo = @SerialNo
    
    -- ?? blocking? ????
    delete _BlockedUser where UserJID = @UserJID
    
    insert _Punishment values( @UserJID, @Type, @Executor, @Shard, @CharName, @CharInfo,
                @PosInfo, @Guide, @Description, @RaiseTime, @BlockStartTime, @BlockEndTime, @PunishTime, 2)
    set @NewSerialNo = @@identity
    if( @@rowcount = 0 or @@error <> 0 or @NewSerialNo = 0 or @NewSerialNo is null)
    begin
        select -2    -- insert??? ?? ??
        return
    end
    -- ??? blocking? ????
    insert _BlockedUser values( @UserJID, @UserID, @Type, @NewSerialNo, @BlockStartTime, @BlockEndTime)
    select 0
_RegisterAutomatedPunishment

Code:
USE [SRO_VT_ACCOUNT]
GO
/****** Object:  StoredProcedure [dbo].[_RegisterAutomatedPunishment]    UPDATED BY KOC2000 at: 10/30/2011 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

ALTER PROCEDURE [dbo].[_RegisterAutomatedPunishment]
    @Account    VARCHAR(128),    --This is "strUserID"
    @Type          TINYINT,
    @Executor    VARCHAR(128),
    @Guide        VARCHAR(512),
    @Description    VARCHAR(1024),
    @BlockTimeElapse    INT
AS
    ------------------------------------------------------------------------------------
    -- novice with deepdark
    -- depend only on db time.. we dont have to sync the time between DB and GlobalManager for accuracy
    DECLARE @BlockStartTime    VARCHAR(128)
    DECLARE @BlockEndTime    VARCHAR(128)

    SET @BlockStartTime     = getdate()
    SET @BlockEndTime    = dateadd( mi, @BlockTimeElapse, @BlockStartTime)
    ------------------------------------------------------------------------------------

    DECLARE @UserJID INT
    SET @UserJID = 0

    -- Get UserJID from provided @Account.
    SELECT @UserJID = JID FROM TB_User WITH (NOLOCK) WHERE strUserID = @Account
    IF @@ERROR <> 0 OR @UserJID = 0
    BEGIN
        SELECT -1
        RETURN
    END
    
    DECLARE    @return_value int
    -- Check if user is blocked before and execute proper SP.
    IF( EXISTS ( SELECT UserJID FROM _BlockedUser WITH (NOLOCK) WHERE UserJID = @UserJID AND Type = @Type))
    BEGIN
        DECLARE @SerialNo INT
        SET @SerialNo = 0
        SELECT @SerialNo = SerialNo FROM _Punishment WITH (NOLOCK) WHERE UserJID = @UserJID
        EXEC    @return_value = [dbo].[_UpdatePunishment] @SerialNo, @UserJID, @Type, @Executor,0, '', '', '', @Guide, @Description, @BlockStartTime, @BlockStartTime, @BlockEndTime, @BlockStartTime
    END
    
    ELSE 
    BEGIN
        EXEC    @return_value = [dbo].[_RegisterPunishment] @UserJID, @Type, @Executor,0, '', '', '', @Guide, @Description, @BlockStartTime, @BlockStartTime, @BlockEndTime, @BlockStartTime
    END


    SELECT @UserJID
Credits to [Only registered and activated users can see links. Click Here To Register...]
12/05/2011 15:27 amjed#5
tnx u guys <3
my best wish's
12/05/2011 16:42 18andLife#6
Quote:
Originally Posted by !x_~! View Post
how it's bugged and 18andLife was ban some ppl's in his servers from PVP Sro to Insane sro !
because i fixed it already, when i opened my first server
12/05/2011 17:00 !x_~!#7
Quote:
Originally Posted by 18andLife View Post
because i fixed it already, when i opened my first server
mm
i was have no idea about that
sorry!