Register for your free account! | Forgot your password?

You last visited: Today at 18:43

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

Advertisement



How to Ban IP By CharName

Discussion on How to Ban IP By CharName within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 111
Received Thanks: 35
How to Ban IP By CharName



Press Thnx if work

My Query to Ban Player


PHP Code:
--By Leandro nukertube ) --
USE [
SRO_VT_SHARD]           
GO
--------------------------------                           
DECLARE @
ChrID INT;            
DECLARE @
CharName VARCHAR(64); 
DECLARE @
AccJID INT;           
---------------------------------
SET @CharName =    'CharNameHere'---
---------------------------------
SET @ChrID=(SELECT CharID FROM _Char WHERE CharName16=@CharName)
SET @AccJID=(SELECT UserJID FROM _User WHERE CharID=@ChrID)
-----------------------------------------------------------------
USE 
SRO_VT_ACCOUNT
DECLARE @ID VARCHAR (64)
DECLARE @
Reason VARCHAR(128)
DECLARE @
Begin DATETIME
DECLARE @End DATETIME
SET 
@ID = (Select STRuserID FROM TB_User Where JID = @AccJID)

---------------------------------
SET @Reason    =    'Ban Reason Here'
SET @Begin    =    '2012-05-01 00:00:00.000' --    Time Begin    --
SET @End    =    '2040-01-01 00:00:00.000' --    Time End    --
---------------------------------
---------------------------

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
-----------------------------------------------------------------
--
By Leandro nukertube ) -- 
Querry to Unban Player

PHP Code:
--By Leandro nukertube ) --
USE [
SRO_VT_SHARD]           
GO
--------------------------------                           
DECLARE @
ChrID INT;            
DECLARE @
CharName VARCHAR(64); 
DECLARE @
AccJID INT;           
---------------------------------
SET @CharName =    'CharNameHere'---
---------------------------------
SET @ChrID=(SELECT CharID FROM _Char WHERE CharName16=@CharName)
SET @AccJID=(SELECT UserJID FROM _User WHERE CharID=@ChrID)
--------------------------------
USE [
SRO_VT_ACCOUNT]
--------------------------------
DELETE FROM [dbo].[_BlockedUser]
WHERE UserJID = @AccJID
DELETE FROM 
[dbo].[_Punishment]
WHERE UserJID = @AccJID

--By Leandro nukertube ) --  

-----------------------------------------------------------------
SELECT StrUserID FROM TB_User WHERE JID = @AccJID
----------------------------------------------------------------- 
(Querry to ban and Unban by me! +1 Like )

Credits to @Caipi ->

query to create table to store the ip of the players

PHP Code:
USE Log_DB

CREATE TABLE _IPLogs 


[
No.] int IDENTITY(1,1PRIMARY KEY
[
CharIDint
[
Charnamevarchar(max), 
[
IPvarchar(max), 
[
Datedatetime 
); 
stored product to record the ip of the players at the table _IPlogs

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.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE()) 
    -- 
END 

    END 

Okay, now the ip will be archived and it will be possible to display the name of the char
EDITED
--> Only if the _IPLogs table doesn't contain already IP's of the Char you want to ban


PHP Code:
USE [Log_DB]

Declare @
Charname varchar(max);

SET @Charname 'CharNameHere'

SELECT Data2 INTO #temp_table FROM _LogEventChar 
WHERE CharID = (SELECT CharID FROM SRO_VT_SHARD.dbo._Char WHERE CharName16 like @Charname) AND (EventID OR EventID 6)
GROUP BY Data2
ORDER BY Data2 asc

Declare @Counter int = (SELECT MIN(Data2FROM #temp_table), @IP varchar(max);

CREATE TABLE #temp_table_result (
[IPvarchar(max)
);

WHILE (@
Counter <= (SELECT MAX(Data2FROM #temp_table))
    
BEGIN
        exec 
@IP SRO_VT_ACCOUNT.dbo.split_ip @Counter
        INSERT INTO 
#temp_table_result SELECT @IP
        
SET @Counter = (SELECT MIN(Data2FROM #temp_table WHERE Data2 > @Counter)
    
END

SELECT 
FROM #temp_table_result

DROP TABLE #temp_table
DROP TABLE #temp_table_result 
Now the table where the IP will be blocked

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

Now the stored product to block all accounts that connect the blocked ip

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.dbo._Char WHERE CharName16=@CharName)
SET @AccJID=(SELECT UserJID FROM SRO_VT_SHARD.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 stored product


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.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.dbo._Char WHERE CharID = @CharID)
    
    
exec SRO_VT_ACCOUNT.dbo._BannPlayerSP @Charname,'usage of a banned IP'
    
-- END banned IP stuff
    END

    END 




After Run all tables and stored products, to ban an ip you just run the query to find the ip by the name of the character, get the ip, and paste the table _bannedips (in log_DB)
alkaher1000 is offline  
Thanks
4 Users
Old 08/03/2012, 22:50   #2
Chat Killer In Duty


 
PortalDark's Avatar
 
elite*gold: 5
Join Date: May 2008
Posts: 16,309
Received Thanks: 6,470
#approved
PortalDark is offline  
Old 08/03/2012, 23:14   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 111
Received Thanks: 35
Quote:
Originally Posted by PortalDark View Post
#approved
Thanks ^^
alkaher1000 is offline  
Old 08/04/2012, 00:39   #4
 
elite*gold: 0
Join Date: Jun 2012
Posts: 28
Received Thanks: 6
well done
md999 is offline  
Old 08/04/2012, 03:27   #5
 
ThElitEyeS's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 333
Received Thanks: 186
i guess all the threads you release is copy past from r@gezone
ThElitEyeS is offline  
Thanks
1 User
Old 08/04/2012, 05:54   #6
Chat Killer In Duty


 
PortalDark's Avatar
 
elite*gold: 5
Join Date: May 2008
Posts: 16,309
Received Thanks: 6,470
Quote:
Originally Posted by ThElitEyeS View Post
i guess all the threads you release is copy past from r@gezone
in fact, also some that are already released here
im approving the ones that i haven't seen here
PortalDark is offline  
Thanks
1 User
Old 08/05/2012, 19:48   #7
 
elite*gold: 0
Join Date: May 2011
Posts: 111
Received Thanks: 35
up
alkaher1000 is offline  
Old 08/05/2012, 23:19   #8
 
elite*gold: 130
Join Date: Mar 2008
Posts: 2,485
Received Thanks: 934
Quote:
Originally Posted by alkaher1000 View Post
up
Bump your thread only in the market section.


Copypasting from RZ is f*ckin easy nowdays, I see...
It's okay that you share something with us, just don't try to make us feel it's your general idea. That makes you lame. Really lame, in fact.
intercsaki is offline  
Reply


Similar Threads Similar Threads
[RELEASE]How to Ban IP By CharName :D
09/06/2016 - SRO PServer Guides & Releases - 10 Replies
:mofo: Credits to :handsdown:@Caipi:handsdown: query to create table to store the ip of the players USE Log_DB CREATE TABLE _IPLogs ( int IDENTITY(1,1) PRIMARY KEY, int, varchar(max), varchar(max), datetime
Charname? Forgot :o
04/03/2011 - Flyff Private Server - 4 Replies
Hello ppl, An half year ago I started a flyff server, and had the error while making a char... "Charactername Already in use" But I didn't made a char yet... Now I made a server again and got the same error, but idk what to do now.. Someone knows how to fix?
sw2 charname offset
10/04/2010 - SRO Private Server - 1 Replies
i need sw2 charname offset plz
[Help]Charname need to have....
02/14/2009 - Dekaron Private Server - 4 Replies
Ok i editet soem stuff and dont get the massage XXXXX and then i get the massage Charakter need to have atleast 4 charaters in it. Anyone can help me or gimme a hint how i can pass that ? ->or need i any programms like OllyDbG ? greets and thx
Charname ändern?
11/17/2006 - World of Warcraft - 10 Replies
Hi, gibt es irgendwie eine möglichkeit einen GM so zu überzeugen das er mit den Nickname ändert? Mir gefällt meiner nicht mehr wikrlich. Hab wirklich bessere im Gedächtnis. Ich habe das mal versucht das ich immer beleidigt werde und immer beschimpft werde ob ich ein "na*i" sei. gut mich hat das mal einer gefragt wegen dem nickname aber is halt nicht so. Der Gm sagte nur nur eine möglichkeit wenn der Nickname gegen was verstößt. Das dürfte doch auch so gehen.



All times are GMT +2. The time now is 18:43.


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.