Raised This Month: $51 Target: $400
 12% 

[ANY] Basic Donator Interface


Post New Thread Reply   
 
Thread Tools Display Modes
Malachi
Senior Member
Join Date: Jun 2010
Location: USA
Old 09-17-2013 , 08:58   Re: [ANY] Basic Donator Interface
Reply With Quote #191

Quote:
Originally Posted by serpentine View Post
I'm guessing it's looking for the database and calling it a config. I'll setup a sql version tonight and see if I can replicate.
If I remember correctly, you have to define a database in the SourceMod database config file (addons/sourcemod/configs/databases.cfg). Unless you change it in the plugin (and recompile), it's the one called "default".
Malachi is offline
serpentine
I don't have a problem
Join Date: Feb 2011
Location: Madison, WI
Old 09-17-2013 , 12:37   Re: [ANY] Basic Donator Interface
Reply With Quote #192

Okay then. @clad

I managed to get everything working with sql after a bit of trial and error, I'll post what I did, hopefully it helps you.

In donator.core.sp
Code:
//uncomment to use SQL
#define USESQL

#define DONATOR_VERSION "0.4"

#if defined USESQL

#define SQL_CONFIG		"donators"
#define SQL_DBNAME		"donators"
In databases.cfg

Code:
"donators"
	{
		"driver"        "mysql"
		"host"          "database.com"
		"database"    "databasename"
		"user"          "user"
		"pass"          "password"
	}
In your database, I used phpmyadmin, from the first post in this thread, run the sql to create the table
Code:
CREATE TABLE IF NOT EXISTS `donators` (
      `steamid` varchar(64) default NULL,
      `tag` varchar(128) NOT NULL,
      `level` tinyint(1) NOT NULL default '1'
    )
Now insert yourself as a "donator" by running this through sql
Code:
INSERT INTO `donators` ( `steamid` , `tag`, `level` ) VALUES ( 'POOTSTEAMIDHERE', 'THIS IS A TAG', 5 );
Restart server and give it a try.
__________________
serpentine is offline
clad
Senior Member
Join Date: Oct 2006
Old 09-17-2013 , 20:22   Re: [ANY] Basic Donator Interface
Reply With Quote #193

Thanks for trying it on your end serpentine.
I looked over your settings, and compared them to mine.
I have already had all of those settings correct, and i know the server is able to connect to the database (located in a separate location), due to Sourcebans connects.

I may be wrong, but i don't think it is a database issue or it would/should spit out connection errors to the DB.
My question next would be has anyone compiled all of these with snapshot "sourcemod-1.6.0-hg4126-windows" ? they compiled fine after i rounded up all of the .inc files.

Before anyone ask, i downloaded "sourcemod-1.5.1-windows" then over wrote it with "sourcemod-1.6.0-hg4126-windows".
__________________
clad is offline
serpentine
I don't have a problem
Join Date: Feb 2011
Location: Madison, WI
Old 09-17-2013 , 20:56   Re: [ANY] Basic Donator Interface
Reply With Quote #194

But the error you showed before was saying it was trying to connect with the default sql config yeah? It's looking inside the databases.cfg and it's reading the "default" setup there. You want it to read your donators setup.
__________________
serpentine is offline
clad
Senior Member
Join Date: Oct 2006
Old 09-17-2013 , 21:14   Re: [ANY] Basic Donator Interface
Reply With Quote #195

Hmm i see your point. let me check something.
__________________
clad is offline
clad
Senior Member
Join Date: Oct 2006
Old 09-17-2013 , 22:35   Re: [ANY] Basic Donator Interface
Reply With Quote #196

Well i tried to connect to a different DB in another location, but i get the same results.
Same errors as my original post.

Here is my DB info edited.
I have tried a local IP and external IP
Code:
        "donations"
        {
        "driver" "default"
        "host" "192.168.*.*"
        //"host" "OUTSIDE IP"
        "database" "mydb"
        "user" "myuser"
        "pass" "*************"
        //"timeout" "0"
        //"port" "3306"
        }
__________________
clad is offline
serpentine
I don't have a problem
Join Date: Feb 2011
Location: Madison, WI
Old 09-17-2013 , 22:43   Re: [ANY] Basic Donator Interface
Reply With Quote #197

Should "driver" be mysql?
__________________
serpentine is offline
clad
Senior Member
Join Date: Oct 2006
Old 09-17-2013 , 22:51   Re: [ANY] Basic Donator Interface
Reply With Quote #198

This was a default database.cfg file that comes with Sourcemod.
This is defined at the top:
Code:
"Databases"
{
    "driver_default"        "mysql"
    
    "storage-local"
    {
        "driver"            "sqlite"
        "database"            "sourcemod-local"
    }
i tried your suggestion but no luck.
__________________
clad is offline
Malachi
Senior Member
Join Date: Jun 2010
Location: USA
Old 09-18-2013 , 08:20   Re: [ANY] Basic Donator Interface
Reply With Quote #199

Quote:
Originally Posted by serpentine View Post
Should "driver" be mysql?
It should match what your database is. Only use sqlite for a local database.

Also, I'm pretty sure any database changes require a server restart.



The error "Unabled to load cfg file <name>" is generated when the plugin first starts if it can't find the <name> database defined in addons/sourcemod/configs/databases.cfg. The names have to match (and I would recommend changing it from 'default').

These two lines of code:
Code:
#define SQL_CONFIG        "tf2donators"
#define SQL_DBNAME        "donators"
Have to match (databases.cfg):
Code:
    "driver_default"        "mysql"

...

    "tf2donators" 
    { 
        "driver"     "default" 
        "host"     "1.2.3.4" 
        "database"     "dl_donator" 
        "user"     "dl_donator" 
        "pass"     "secret" 
        //"timeout" "0" 
        //"port"     "3306" 
    }

You need to have network connectivity to the database. So if Sourcebans is still working then all should be good there.
Malachi is offline
serpentine
I don't have a problem
Join Date: Feb 2011
Location: Madison, WI
Old 09-18-2013 , 08:30   Re: [ANY] Basic Donator Interface
Reply With Quote #200

Whoops, I meant "shouldn't" it be. Not sure what to tell ya, mine works fine with the settings I've posted. Be sure you're restarting the server when you make changes like he said.
__________________
serpentine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode