Character Controller(Ban ip)

Results 1 to 15 of 15
  1. #1
    Newbie CProgrammer is offline
    MemberRank
    Nov 2012 Join Date
    14Posts

    thumbs up Character Controller(Ban ip)

    Hello Everyone!!

    I saw some of members was asking about ban charactername by ip.

    Therefor i did this simple tool to help you.

    Very simple to use.


    First lets use Capi query.

    1st Step

    PHP Code:
    USE Log_DB

    CREATE TABLE _IPLogs 


    [
    No.] int IDENTITY(1,1PRIMARY KEY
    [
    CharIDint
    [
    Charnamevarchar(max), 
    [
    IPvarchar(max), 
    [
    Datedatetime 
    ); 
    2nd Step

    PHP Code:
    USE [Log_DB
    GO 

    SET ANSI_NULLS ON 
    GO 
    SET QUOTED_IDENTIFIER ON 
    GO 


    ALTER   procedure 
    [dbo].[_AddLogChar]  
    @
    CharID        int
    @
    EventID        tinyint
    @
    Data1        int
    @
    Data2        int
    @
    strPos        varchar(64), 
    @
    Desc        varchar(128
    as 

        IF(@
    EventID OR @EventID 6
        
    BEGIN 

        
    declare @len_pos     int 
        
    declare @len_desc    int 
        set 
    @len_pos len(@strPos
        
    set @len_desc len(@Desc
        if (@
    len_pos and @len_desc 0
        
    begin     
            insert _LogEventChar values
    (@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)     
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2EventPosvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2strDescvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @Desc
        
    end 
        
    else 
        
    begin 
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2values(@CharIDGetDate(), @EventID, @Data1, @Data2
        
    end 
         
        
    --For the new IPLog table 
        
    Declare @DynIP varchar(max); 
        
    exec @DynIP SRO_VT_ACCOUNT.dbo.split_ip @Data2 
        INSERT INTO _IPLogs 
    (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE()) 
        -- 
    END 

        END 

    3rd Step

    PHP Code:
    use [Log_DB]
    CREATE TABLE _BannedIPs (
    [
    No.] int PRIMARY KEY IDENTITY (1,1),
    [
    IPvarchar(maxNOT NULL
    ); 

    4th Step

    PHP Code:
    USE [SRO_VT_ACCOUNT]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    CREATE PROCEDURE 
    [dbo].[_BannPlayerSP]         

    @
    CharName varchar(max),
    @
    Reason varchar(max)

    as
    --------------------------------                           
    DECLARE @
    ChrID INT;            
    DECLARE @
    AccJID INT;           
    ---------------------------------

    SET @ChrID=(SELECT CharID FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharName16=@CharName)
    SET @AccJID=(SELECT UserJID FROM SRO_VT_SHARD_INIT.dbo._User WHERE CharID=@ChrID)

    ----------------------

    DECLARE 
            @
    ID VARCHAR(64) = (Select STRuserID FROM TB_User Where JID = @AccJID),
            @
    Begin DATETIME GETDATE()-1,
            @
    End DATETIME GETDATE()+3650


    INSERT 
    [dbo].[_Punishment]
    (
    [
    UserJID],
    [
    Type],
    [
    Executor],
    [
    Shard],
    [
    CharName],
    [
    CharInfo],
    [
    PosInfo] ,
    [
    Guide],
    [
    Description],
    [
    RaiseTime],
    [
    BlockStartTime],
    [
    BlockEndTime],
    [
    PunishTime],
    [
    Status]
    )
    VALUES 
    (
    @
    AccJID,
    1,
    1,
    0,
    @
    CharName,
    1,
    1,
    @
    Reason,
    @
    Reason,
    @
    Begin,
    @
    Begin,
    @
    End,
    @
    End,
    0);
    ----------------------------------------------------------
    DECLARE @
    ReasonID INT
    SET 
    @ReasonID =
    (
    Select SerialNo FROM _Punishment Where UserJID = @AccJID)
    ----------------------------------------------------------
    INSERT [dbo].[_BlockedUser]
    (
    [
    UserJID],
    [
    UserID],
    [
    Type],
    [
    SerialNo],
    [
    TimeBegin],
    [
    TimeEnd])
    VALUES
    (
    @
    AccJID,
    @
    ID,
    1,
    @
    ReasonID,
    @
    Begin,
    @
    End);

    -----------------------------------------------------------------
    SELECT StrUserID FROM TB_User WHERE JID = @AccJID
    ----------------------------------------------------------------- 
    Last Step

    PHP Code:
    USE [Log_DB
    GO 

    SET ANSI_NULLS ON 
    GO 
    SET QUOTED_IDENTIFIER ON 
    GO 


    ALTER   procedure 
    [dbo].[_AddLogChar]  
    @
    CharID        int
    @
    EventID        tinyint
    @
    Data1        int
    @
    Data2        int
    @
    strPos        varchar(64), 
    @
    Desc        varchar(128
    as 

        IF(@
    EventID OR @EventID 6
        
    BEGIN 

        
    declare @len_pos     int 
        
    declare @len_desc    int 
        set 
    @len_pos len(@strPos
        
    set @len_desc len(@Desc
        if (@
    len_pos and @len_desc 0
        
    begin     
            insert _LogEventChar values
    (@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)     
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2EventPosvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @strPos
        
    end 
        
    else if (@len_pos and @len_desc 0
        
    begin      
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2strDescvalues(@CharIDGetDate(), @EventID, @Data1, @Data2, @Desc
        
    end 
        
    else 
        
    begin 
            insert _LogEventChar 
    (CharIDEventTimeEventIDData1Data2values(@CharIDGetDate(), @EventID, @Data1, @Data2
        
    end 
         
        
    --For the new IPLog table 
        
    Declare @DynIP varchar(max); 
        
    exec @DynIP SRO_VT_ACCOUNT.dbo.split_ip @Data2 
        INSERT INTO _IPLogs 
    (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE()) 
        -- 
    END
        
    -- Banned IP stuff
        
    IF exists (SELECT IP FROM _BannedIPs WHERE IP like @DynIP)
        
    BEGIN
        
    Declare @Charname varchar(max) = (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID)
        
        
    exec SRO_VT_ACCOUNT.dbo._BannPlayerSP @Charname,'usage of a banned IP'
        
    -- END banned IP stuff
        END

        END 
    P.S: Change your database names if different.

    Screen shot of the tool.



    VirusTotal

    Character Controller

    Press thanks if i helped you.


  2. #2
    Elite Member LeMbo is offline
    Member +Rank
    Sep 2012 Join Date
    241Posts

    Re: Character Controller(Ban ip)

    Msg 1046, Level 15, State 1, Procedure _AddLogChar, Line 39
    Subqueries are not allowed in this context. Only scalar expressions are allowed.

    At Second Query

    Msg 102, Level 15, State 1, Procedure _BannPlayerSP, Line 19
    Incorrect syntax near '('.
    Msg 102, Level 15, State 1, Procedure _BannPlayerSP, Line 19
    Incorrect syntax near ','.
    Msg 137, Level 15, State 2, Procedure _BannPlayerSP, Line 52
    Must declare the scalar variable "@Begin".
    Msg 137, Level 15, State 2, Procedure _BannPlayerSP, Line 73
    Must declare the scalar variable "@ID".

    At 4th step

    Msg 1046, Level 15, State 1, Procedure _AddLogChar, Line 39
    Subqueries are not allowed in this context. Only scalar expressions are allowed.
    Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 44
    Incorrect syntax near '('.
    Msg 137, Level 15, State 2, Procedure _AddLogChar, Line 46
    Must declare the scalar variable "@Charname".

    At Last Step ;)

  3. #3
    Newbie CProgrammer is offline
    MemberRank
    Nov 2012 Join Date
    14Posts

    Re: Character Controller(Ban ip)

    Check your database name.

    for example

    Declare @Charname varchar(max) = (SELECT CharName16 FROM SRO_VT_SHARD_INIT.dbo._Char WHERE CharID = @CharID)
    change the SRO_VT_SHARD_INIT database to yours in everywhere in script manual dont use replace.

    so change it to SRO_VT_SHARD without INIT if yours like that SRO_VT_SHARD

  4. #4
    Sorcerer Supreme InsaneDev is offline
    Member +Rank
    Jun 2012 Join Date
    EgyptLocation
    454Posts

    Re: Character Controller(Ban ip)

    why the program request internet access?
    i sell something weird
    please explain

  5. #5
    Elite Member LeMbo is offline
    Member +Rank
    Sep 2012 Join Date
    241Posts

    Re: Character Controller(Ban ip)

    I know that's
    i am changed database name
    but look at errors

  6. #6
    Member DieEyes is offline
    MemberRank
    Aug 2012 Join Date
    Inside youLocation
    79Posts

    Re: Character Controller(Ban ip)

    Useful tool keep sharing.

    Tested and working

  7. #7
    Newbie CProgrammer is offline
    MemberRank
    Nov 2012 Join Date
    14Posts

    Re: Character Controller(Ban ip)

    Quote Originally Posted by InsaneDev View Post
    why the program request internet access?
    i sell something weird
    please explain
    I don't know but its working for me without internet.

    Quote Originally Posted by LeMbo View Post
    I know that's
    i am changed database name
    but look at errors
    Maybe problem from sql2005 try to use it on 2008

    Quote Originally Posted by DieEyes View Post
    Useful tool keep sharing.

    Tested and working
    thank you

  8. #8
    Sorcerer Supreme denise456 is offline
    Member +Rank
    Feb 2012 Join Date
    BrasilLocation
    318Posts

    Re: Character Controller(Ban ip)

    100% Work Ban-IP.rar

    Thanks For Caipi And Nukertube

  9. #9
    Member 3oOomar is offline
    MemberRank
    Sep 2012 Join Date
    EgyptLocation
    96Posts

    Re: Character Controller(Ban ip)

    Thank's ;)

  10. #10
    (⌐■_■) NourAyman is offline
    Grand MasterRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: Character Controller(Ban ip)

    Nice Thread , keep sharing

  11. #11
    Newbie noobless is offline
    MemberRank
    Nov 2012 Join Date
    1Posts

    Re: Character Controller(Ban ip)

    work thnk you

  12. #12
    Newbie CProgrammer is offline
    MemberRank
    Nov 2012 Join Date
    14Posts

    Re: Character Controller(Ban ip)

    Quote Originally Posted by noobless View Post
    work thnk you
    You are welcome

  13. #13
    Elite Member modog1545 is offline
    Member +Rank
    Dec 2011 Join Date
    122Posts

    Re: Character Controller(Ban ip)

    This is the right scan
    have virus
    https://www.virustotal.com/file/065a...is/1352897147/

    Trojan.MSIL.Agent.agez
    This trojan download and install malicious code on a victim machine.
    The Trojan-Downloader programs contain information about the names and locations of malware programs to download and install. This information is usually stored as an encrypted block of data at the end of file.

  14. #14
    Grand Master RevoLand is offline
    Member +Rank
    Jan 2009 Join Date
    117Posts

    Re: Character Controller(Ban ip)

    Quote Originally Posted by modog1545 View Post
    This is the right scan
    have virus
    https://www.virustotal.com/file/065a...is/1352897147/

    Trojan.MSIL.Agent.agez
    This trojan download and install malicious code on a victim machine.
    The Trojan-Downloader programs contain information about the names and locations of malware programs to download and install. This information is usually stored as an encrypted block of data at the end of file.
    This is the right scan;
    clean.png

  15. #15
    Newbie CProgrammer is offline
    MemberRank
    Nov 2012 Join Date
    14Posts

    Re: Character Controller(Ban ip)

    [QUOTE=modog1545;7326305]This is the right scan
    have virus
    https://www.virustotal.com/file/065a...is/1352897147/

    its negative result dude ^^

    Quote Originally Posted by RevoLand View Post
    This is the right scan;
    clean.png

    Thanks for clear it to him.



Advertisement