Sourcebans

Connect with other users about what to run on your webhosting (and how to run it) here.
DarkJesture
A semi-regular
A semi-regular
Posts: 15
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Jun 25, 2014 12:34 am

Sourcebans

Post by DarkJesture »

New to using sourcebans, sorry. Anyways, banning someone online doesn't do anything, and banning in-game doesn't show on the dashboard. whenever I click administration, servers, and server configuration I get a

Code: Select all

The game server needs the following configuration to be able to communicate with the database.

Copy the "sourcebans" section below and place it on the game server in /[game]/addons/sourcemod/configs/databases.cfg, so that it looks similar to this:
I add the code into my databases.cfg, but still nothing. I'm stumped :? Any help would be appreciated

link: http://eliteteamgaming.site.nfoservers.com/sourcebans
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: Sourcebans

Post by rymax99 »

It appears it's working: http://eliteteamgaming.site.nfoservers. ... x.php/bans
If bans are showing up, then it must have some connectivity to the database.
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

It only shows bans made on the webpanel, but when you add the ban, it doesn't actually ban you from the server
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

Have you confirmed you put the correct RCON password when adding the server to the web panel?

The entry for sourcebans should look something like this in your databases.cfg

Code: Select all

"sourcebans"
	{
		"driver""default"
		"host""70.42.x.x"
		"database""gflclan_sourcebans"
		"user""user_name"
		"pass""password"
		//"timeout""0"
		"port""3306"
	}
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

Yes, I can send console commands through sourcebans... My database.cfg does look like that. The username and pass should be the database user and pass info right?
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

Have you checked "allow external connections" in the control panel for your databases?

Also check your addons/sourcemod/logs/ error log for the response from the MySQL server, that should narrow down the issue.
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

Only thing that I could find was

Code: Select all

L 06/25/2014 - 01:27:05: [sourcebans.smx] Could not connect to the database. ([2003]: Can't connect to MySQL server on 'localhost' (10061))
L 06/25/2014 - 01:32:03: SourceMod error session started
L 06/25/2014 - 01:32:03: Info (map "") (file "errors_20140625.log")
L 06/25/2014 - 01:32:03: [SM] Detected parse error(s) in file "C:\servers\eliteteamgaming\cstrike\addons\sourcemod\configs\databases.cfg"
L 06/25/2014 - 01:32:03: [SM] Line 45: Section declared without header
L 06/25/2014 - 01:32:03: Error log file session closed.
Should I change localhost to the hostlink instead?
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

DarkJesture wrote:Only thing that I could find was

Code: Select all

L 06/25/2014 - 01:27:05: [sourcebans.smx] Could not connect to the database. ([2003]: Can't connect to MySQL server on 'localhost' (10061))
L 06/25/2014 - 01:32:03: SourceMod error session started
L 06/25/2014 - 01:32:03: Info (map "") (file "errors_20140625.log")
L 06/25/2014 - 01:32:03: [SM] Detected parse error(s) in file "C:\servers\eliteteamgaming\cstrike\addons\sourcemod\configs\databases.cfg"
L 06/25/2014 - 01:32:03: [SM] Line 45: Section declared without header
L 06/25/2014 - 01:32:03: Error log file session closed.
Should I change localhost to the hostlink instead?
Yes, you are defining the host for sourcebans as "localhost", which it isn't. Change the "host" section of your sourcebans entry in databases.cfg to your website hostname(eliteteamgaming.site.nfoservers.com).

EDIT: It also looks like you have a problem in your databases.cfg, make sure you have brackets open and close at appropriate places, and if necessary, start fresh with a new databases.cfg included in the sourcemod package.
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

Code: Select all

"Databases"
{
{
	"driver_default"		"mysql"
	
	"sourcebans"
	{
		"driver"			"mysql"
		"host"			"eliteteamgaming.site.nfoservers.com"
		"database"		"eliteteamgaming_Sourcebans"
		"user"			"eliteteamgaming"
		"pass"			"***********"
		//"timeout"		"0"
		"port"			"3306"
	}
This is the top part of my database.cfg (censored password of course)
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

DarkJesture wrote:

Code: Select all

"Databases"
{
{
	"driver_default"		"mysql"
	
	"sourcebans"
	{
		"driver"			"mysql"
		"host"			"eliteteamgaming.site.nfoservers.com"
		"database"		"eliteteamgaming_Sourcebans"
		"user"			"eliteteamgaming"
		"pass"			"***********"
		//"timeout"		"0"
		"port"			"3306"
	}
This is the top part of my database.cfg (censored password of course)
You are closing the brackets for the databases before you add any databases to the list. Use this:

Code: Select all

"Databases"
{

	"driver_default"		"mysql"
	
	"sourcebans"
	{
		"driver"			"mysql"
		"host"			"eliteteamgaming.site.nfoservers.com"
		"database"		"eliteteamgaming_Sourcebans"
		"user"			"eliteteamgaming"
		"pass"			"***********"
		//"timeout"		"0"
		"port"			"3306"
	}
}
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

Still not working :( Here's my ENTIRE database.cfg, is something possibly interfering with it?

Code: Select all

"Databases"
{
	"driver_default"		"mysql"
	
	"sourcebans"
	{
		"driver"			"mysql"
		"host"			"eliteteamgaming.site.nfoservers.com"
		"database"		"eliteteamgaming_Sourcebans"
		"user"			"eliteteamgaming"
		"pass"			"**********"
		//"timeout"		"0"
		"port"			"3306"
	}

	"psstats"
	{
		"driver"			"mysql"
		"host"				"eliteteamgaming.stats-ps3.nfoservers.com"
		"database"			"eliteteamgaming"
		"user"				"eliteteamgaming"
		"pass"				"****************"
		//"timeout"			"0"
		"port"				"3306"
	}
	"driver_default"		"mysql"
	
	// When specifying "host", you may use an IP address, a hostname, or a socket file path
	
	"default"
	{
		"driver"			"default"
		"host"				"localhost"
		"database"			"sourcemod"
		"user"				"root"
		"pass"				""
		//"timeout"			"0"
		//"port"			"0"
	}
	
	"storage-local"
	{
		"driver"			"sqlite"
		"database"			"sourcemod-local"
	}

	"clientprefs"
	{
		"driver"			"sqlite"
		"host"				"localhost"
		"database"			"clientprefs-sqlite"
		"user"				"root"
		"pass"				""
		//"timeout"			"0"
		//"port"			"0"
	}

}
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

Check your sourcemod error log again, and see if there are any new entries that may display what's going on.
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

soja wrote:Check your sourcemod error log again, and see if there are any new entries that may display what's going on.
Got like 30 of these now

Code: Select all

L 06/25/2014 - 23:30:10: [sourcebans.smx] Failed to query database. (Cannot add or update a child row: a foreign key constraint fails (`eliteteamgaming_Sourcebans`.`sb_actions`, CONSTRAINT `action_server` FOREIGN KEY (`server_id`) REFERENCES `sb_servers` (`id`) ON DELETE CASCADE))
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Sourcebans

Post by soja »

DarkJesture wrote:
soja wrote:Check your sourcemod error log again, and see if there are any new entries that may display what's going on.
Got like 30 of these now

Code: Select all

L 06/25/2014 - 23:30:10: [sourcebans.smx] Failed to query database. (Cannot add or update a child row: a foreign key constraint fails (`eliteteamgaming_Sourcebans`.`sb_actions`, CONSTRAINT `action_server` FOREIGN KEY (`server_id`) REFERENCES `sb_servers` (`id`) ON DELETE CASCADE))
Great! You are halfway done, the game server can now communicate with the database. Since this is a new install, I would just say wipe and re-install the database, if you don't want to do that, we can try to work on this error you are getting :)
Not a NFO employee
DarkJesture
A semi-regular
A semi-regular
Posts: 15
Joined: Wed Jun 25, 2014 12:34 am

Re: Sourcebans

Post by DarkJesture »

Which would be easier? Also, sorry, do I delete just the database, or delete the database and have to reupload and reinstall sourcebans to the directory?
Post Reply