Register for your free account! | Forgot your password?

You last visited: Today at 16:13

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

Advertisement



Character Controller(Ban ip)

Discussion on Character Controller(Ban ip) within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2012
Posts: 6
Received Thanks: 1
Character Controller(Ban ip)

Hey Epvp

i found this somewhere so i wanted share it with you.

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







Credits not for me.
Valroller is offline  
Old 11/28/2012, 15:03   #2
Chat Killer In Duty


 
PortalDark's Avatar
 
elite*gold: 5
Join Date: May 2008
Posts: 16,307
Received Thanks: 6,469
#approved
PortalDark is offline  
Old 11/28/2012, 15:28   #3
 
elite*gold: 0
Join Date: Apr 2011
Posts: 1,251
Received Thanks: 519
ok thats good but ( 90% ) of the players don`t have static ip , so by restarting the router they will login again . any way to ban ppl with dynamic ip ? ( i think no but who knows )
CrazyGirL_ZSZC is offline  
Old 11/28/2012, 15:33   #4
 
xlinh's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 111
Received Thanks: 4
KIS have virus
xlinh is offline  
Old 11/29/2012, 22:01   #5
 
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
Quote:
Originally Posted by Valroller View Post
Credits not for me.
Then for...? *simply-can't-understand-it-face*
intercsaki is offline  
Old 12/01/2012, 16:33   #6
 
elite*gold: 41
Join Date: Oct 2012
Posts: 2,216
Received Thanks: 1,195
Thank's Bro
Crue* is offline  
Reply


Similar Threads Similar Threads
[Suche] Xbox 360 Controller / Ps3 Controller
06/12/2012 - Consoles Trading - 4 Replies
Hallo liebe Community ich suche einen Xbox 360 Controller oder eben einen der Sony Variante. Möchte damit gerne Fifa 12 am PC zocken, mein PS2 Controller kotzt mich an ;) Was ich dafür gebe? Geld. PSC/Bargeld bei RL Treff (Mannheim)/Banküberweisung Danke im Voraus
WTT iSRO(RedSea)lvl 106 character for rSRO Artemis character!
09/07/2010 - Silkroad Online Trading - 10 Replies
Hey guys/girls, I want to trade my lvl 106 rogue/bard on RedSea server. Rev6.com - The 6th Revolution Character information: -name : SrO_Diabolik -build : rogue/bard full STR -skills : rogue/bard lvl 106 with skills up to date with about 250 k sp left -items:+2 +3 items with blue,101+5 dagger crit 18,shield 101+5 br 18 -never banned



All times are GMT +2. The time now is 16:13.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.