Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Simple Ban Script

Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
This is a script to ban in-game accounts, using it you can ban accounts for a period of time or permanently. Before using it, please ensure that all accounts on your server (Current Ones and Ones Being Registered) have the following values:
Code:
UPDATE account_tbl_detail set BlockTime = ''
UPDATE account_tbl_detail set WebTime = ''
UPDATE account_tbl_detail set EndTime = ''

***Edit your register script so that when new accounts are made all of the above fields are set to '' so that they are empty, yet NOT NULL.***

Table:

TBL_LOG_BLOCK_ACCOUNT
Code:
USE [ACCOUNT_DBF]
GO

/****** Object:  Table [dbo].[TBL_LOG_BLOCK_ACCOUNT]    Script Date: 02/05/2011 18:50:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TBL_LOG_BLOCK_ACCOUNT](
	[account] [varchar](50) NOT NULL,
	[code1] [char](8) NOT NULL,
	[code2] [char](8) NOT NULL,
	[code3] [char](8) NOT NULL,
	[old_block_day] [char](8) NOT NULL,
	[old_web_day] [char](8) NOT NULL,
	[block_day] [char](8) NOT NULL,
	[web_day] [char](8) NOT NULL,
	[input_id] [char](20) NOT NULL,
	[input_day] [datetime] NOT NULL,
	[reason] [varchar](500) NOT NULL,
	[num] [nchar](10) NOT NULL,
	[r_web_day] [char](8) NULL,
	[r_block_day] [char](8) NULL,
	[r_input_day] [char](8) NULL,
	[r_reason] [varchar](500) NULL,
	[r_input_id] [varchar](30) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[TBL_LOG_BLOCK_ACCOUNT] ADD  CONSTRAINT [DF_TBL_LOG_BLOCK_ACCOUNT_num]  DEFAULT ((0)) FOR [num]
GO

Screenies:
Alexsh - Simple Ban Script - RaGEZONE Forums

Alexsh - Simple Ban Script - RaGEZONE Forums


Ban Script: Download


Note: All End Dates for periodic banning must be entered in YYYYMMDD format!
 
Last edited:
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
As a side not to anyone using this, reomove the antisql() around the $_POST and $_GET values. This was a function that I did not include in this script.
 
Experienced Elementalist
Joined
Sep 8, 2009
Messages
296
Reaction score
78
how to ban someones ip?
To ban it in-game use IPCut.ini, to ban someone via your website use a simple IP ban script to disallow their IP address to view your website. For example:

1st Get their IP:
Code:
function getIp()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}

2nd Make a table in the ACCOUNT_DBF to insert IP addresses
Code:
You can make this yourself

3rd Disallow it from the website:
Code:
$ip = getIp();
$checkban = mssql_query("SELECT * FROM ACCOUNT_DBF.dbo.WEB_BAN_TBL WHERE ip = '$ip'");
if(mssql_num_rows($checkban) != '0'){ 
header("Location: http://google.com");
}
 
Elite Diviner
Joined
Feb 10, 2011
Messages
416
Reaction score
99
Is this script also available in SQL, for MSSQL.
 
Not working on UnitedFlyf
Loyal Member
Joined
Apr 21, 2009
Messages
1,385
Reaction score
934
To ban it in-game use IPCut.ini, to ban someone via your website use a simple IP ban script to disallow their IP address to view your website. For example:

1st Get their IP:
Code:
function getIp()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}

2nd Make a table in the ACCOUNT_DBF to insert IP addresses
Code:
You can make this yourself

3rd Disallow it from the website:
Code:
$ip = getIp();
$checkban = mssql_query("SELECT * FROM ACCOUNT_DBF.dbo.WEB_BAN_TBL WHERE ip = '$ip'");
if(mssql_num_rows($checkban) != '0'){ 
header("Location: http://google.com");
}

You can just check the IP at LOGIN_STR. That allows you to not have to duck with inis.
 
Experienced Elementalist
Joined
Jan 18, 2011
Messages
246
Reaction score
4
This is a script to ban in-game accounts, using it you can ban accounts for a period of time or permanently. Before using it, please ensure that all accounts on your server (Current Ones and Ones Being Registered) have the following values:
Code:
UPDATE account_tbl_detail set BlockTime = ''
UPDATE account_tbl_detail set WebTime = ''
UPDATE account_tbl_detail set EndTime = ''

***Edit your register script so that when new accounts are made all of the above fields are set to '' so that they are empty, yet NOT NULL.***

Table:

TBL_LOG_BLOCK_ACCOUNT
Code:
USE [ACCOUNT_DBF]
GO

/****** Object:  Table [dbo].[TBL_LOG_BLOCK_ACCOUNT]    Script Date: 02/05/2011 18:50:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[TBL_LOG_BLOCK_ACCOUNT](
	[account] [varchar](50) NOT NULL,
	[code1] [char](8) NOT NULL,
	[code2] [char](8) NOT NULL,
	[code3] [char](8) NOT NULL,
	[old_block_day] [char](8) NOT NULL,
	[old_web_day] [char](8) NOT NULL,
	[block_day] [char](8) NOT NULL,
	[web_day] [char](8) NOT NULL,
	[input_id] [char](20) NOT NULL,
	[input_day] [datetime] NOT NULL,
	[reason] [varchar](500) NOT NULL,
	[num] [nchar](10) NOT NULL,
	[r_web_day] [char](8) NULL,
	[r_block_day] [char](8) NULL,
	[r_input_day] [char](8) NULL,
	[r_reason] [varchar](500) NULL,
	[r_input_id] [varchar](30) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[TBL_LOG_BLOCK_ACCOUNT] ADD  CONSTRAINT [DF_TBL_LOG_BLOCK_ACCOUNT_num]  DEFAULT ((0)) FOR [num]
GO

Screenies:
Alexsh - Simple Ban Script - RaGEZONE Forums

Alexsh - Simple Ban Script - RaGEZONE Forums


Ban Script: Download


Note: All End Dates for periodic banning must be entered in YYYYMMDD format!

yoww, i got this weird problem, when i go to 127.0.0.1/ban.php
my apache gets crashed. i dont know why. but some of my php script are working like my register script.

have an idea on what's wrong? i used xampp 1.7.3
help me please :(:
 
Back
Top