Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 02:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Correct DB SP for Punishment system.

Discussion on [Release] Correct DB SP for Punishment system. within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 48
Received Thanks: 9
Thumbs up [Release] Correct DB SP for Punishment system.

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:
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( 
existsselect UserJID from _BlockedUser with(NOLOCKwhere 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, @PunishTime0)
    
set @NewSerialNo = @@identity
    
if( @@rowcount or @@error <> or @NewSerialNo or @NewSerialNo is null)
    
begin
        select 
-2    -- insert??? ?? ??
        return
    
end
    
    
-- Getting username (KiMO)
    declare @
UserID varchar(25)
    
SELECT @UserID StrUserID FROM TB_User WITH (NOLOCKWHERE JID = @UserJID
    
if( @@rowcount or @@error <> 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 existsselect SerialNo from _Punishment with(NOLOCKwhere 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 (NOLOCKWHERE JID = @UserJID
    
if( @@rowcount or @@error <> 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, @PunishTime2)
    
set @NewSerialNo = @@identity
    
if( @@rowcount or @@error <> or @NewSerialNo or @NewSerialNo is null)
    
begin
        select 
-2    -- insert??? ?? ??
        return
    
end
    
-- ??? blocking? ????
    
insert _BlockedUser values( @UserJID, @UserID, @Type, @NewSerialNo, @BlockStartTime, @BlockEndTime)
    
select 0 

_RegisterAutomatedPunishment
PHP 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    dateaddmi, @BlockTimeElapse, @BlockStartTime)
    ------------------------------------------------------------------------------------

    DECLARE @
UserJID INT
    SET 
@UserJID 0

    
-- Get UserJID from provided @Account.
    
SELECT @UserJID JID FROM TB_User WITH (NOLOCKWHERE strUserID = @Account
    
IF @@ERROR <> 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 (NOLOCKWHERE UserJID = @UserJID AND Type = @Type))
    
BEGIN
        
DECLARE @SerialNo INT
        SET 
@SerialNo 0
        SELECT 
@SerialNo SerialNo FROM _Punishment WITH (NOLOCKWHERE 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 
KOC2000 is offline  
Thanks
4 Users
Old 10/30/2011, 18:50   #2
 
elite*gold: 0
Join Date: Aug 2010
Posts: 346
Received Thanks: 416
Posting RZ stuff and claiming it as yours is not a nice thing.
Miki Maus is offline  
Thanks
3 Users
Old 10/31/2011, 05:53   #3
 
elite*gold: 0
Join Date: Apr 2009
Posts: 302
Received Thanks: 46
If u check the RZ forums you'll see that there is the same owner of the thread.
alexutublade is offline  
Thanks
1 User
Old 10/31/2011, 15:21   #4
 
✗EpicSoul✗'s Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,189
Received Thanks: 531
nice copying skills..
✗EpicSoul✗ is offline  
Reply


Similar Threads Similar Threads
[Release] Getting/Writing correct strings
09/11/2011 - CO2 PServer Guides & Releases - 4 Replies
Yo... simple way to fix chat/name strings: BTW: I dunno if it was already posted here... so if it was ... sorry for the inconvenience :] public class StringPacker { public static string GetString(byte array, int offset, int count) { string pszWords = ""; for (int x = offset; x < offset + count; x++)
Anyone exactly know Blizzards policy on bot punishment?
11/27/2008 - WoW Bots - 2 Replies
Anyone exactly know Blizzards policy on bot punishment? What's the punishment for botting for first time offenders, second time offenders or third time offenders? I only bot for pve but I see people botting in wsg, ab, eots and av. I'm really scared to bot for pvp since I have a lot of level 70 characters, I don't want to be perma banned. Some people have lots of guts. They openly bot knowing people will recognize they are botting and report them. They have no fear. I really want to know...
BOT PUNISHMENT !!!
05/10/2008 - SRO Private Server - 8 Replies
Hi all i wana say u all true about bot baning and why they dont baning bots :) Here all true: -Why u dont baning bots ? -Answear: -Because boters they buing silk from u and other stuff and giving u many money thats why u dont baning bots :) -If any players cought botting.The we going to lvl down him to lvl 1 and take his gold :) and no ban !!!
Bot User List and Punishment Notice 05/14
05/14/2007 - Silkroad Online - 1 Replies
another bot punishment list from JM, it's a short 1 though, LOL, i wonder when the next big server 1s are gonna come out http://www.silkroadonline.net/sro_board/bh...4&am p;TopicID=21617
New Bot Punishment-list released
05/11/2007 - Silkroad Online - 31 Replies
A new bot punishment list is released in the official SRO-Forum: Troy: http://www.silkroadonline.net/sro_board/bh...4& ;TopicID=19316 Athens: http://www.silkroadonline.net/sro_board/bh...4& ;TopicID=19314 I cant really find my acc name in this list for Troy but for any reasons they banned me :/ Im not even in that list and idk any further information bout the reason of the bann, but as far as i know Joyscam they never would inform the ppl bout the reason, even if anyone would ask bout...



All times are GMT +1. The time now is 02:39.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.