[DB] Database Manager
19 Attachment(s)
Database manager
Description: Different plugins may require different tables to get user informations, like XP, level, money, kills, deaths and bla bla bla... This plugin/stock automatically select info from table, create columns where necessary and makes it easy for people that want to use the database How it works Database manager detects all columns from the sm_users. Plugins can enable,disable the selecting of each column, or create a new column if needed. Cvars
Installation:
FAQ:
Example See next post ChangeLog:
Notes: Put the globaldb.inc in addons\sourcemod\scripting\include |
Re: [MySQL] Database Manager
Exemples:
Simple bank plugin: PHP Code:
This function is called right after the server receives information from the database. DO NOT try to use DB_GetColumn on player OnClientConnect or anything of the type. PHP Code:
PHP Code:
Functions PHP Code:
|
Re: [MySQL] Database Manager
Ok, completely new here at this...so walk with me...do I need a mysql database to use this as well as the bank mod you have? Give me some insight here oh great one! :)
KippLitz |
Re: [DB] Database Manager
Which one do we need or do we need both?
|
Re: [DB] Database Manager
Just the a_mysql.sp
|
Re: [DB] Database Manager
I know this will be Noobish, but it would be nice if you had some kind of instalation instructions. We would like to use the Bank mod you fixed up. We are just not real Mysql savy. Thanks.
|
Re: [DB] Database Manager
I will try to come up with one as soon as i get the bank mod + the mysql Manager plugin to work.
|
Re: [DB] Database Manager
Thanks. I assume we can use the mysql database for our website? Waiting for some info.
|
Re: [DB] Database Manager
Ok... I just majorly update it... there was a major error...
And what do you mean by "use the mysql database for our website" |
Re: [DB] Database Manager
Well I am not sure how this mysql stuff works, but we have a msql that holds all the info to our forums and such. I was assuming we could use that to create a database for the server as well.
|
Re: [DB] Database Manager
you as in haveing a page that displays how much money you have on the server?
if so yes you can do that and if you pm me with your e-mail address i can send you a page but you will have to fill in the database info yourself Rainbow 6 |
Re: [DB] Database Manager
Ok. I sent you the pm. Thanks.
|
Re: [DB] Database Manager
it will take me some time to get it all worked out but when i am done i will send it your way
|
Re: [DB] Database Manager
Completely foreign to me at this point...I can't get the Database Manager to load and run without erroring. Here are snippets form logs and configs.
L 09/01/2007 - 16:39:28: [SM] Plugin encountered error 25: Call was aborted L 09/01/2007 - 16:39:28: [SM] Native "SetFailState" reported: [MYSQLmanager] Fail state: Could not connect to mysql L 09/01/2007 - 16:39:28: [SM] Debug mode is not enabled for "a_mysql.smx" L 09/01/2007 - 16:39:28: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 5 on L 09/01/2007 - 16:39:28: [a_mysql.smx] [MYSQLmanager] [2005]: Unknown MySQL server host 'db1107.perfora.net' (11004) "Databases" { "driver_default" "mysql" "default" { "driver" "mysql" "host" "db1107.perfora.net" "database" "db215923511" "user" "*********" "pass" "********" //"timeout" "0" //"port" "0" } "storage-local" { "driver" "sqlite" "database" "sourcemod-local" } } Any guidance appreciated. Thanks, KippLitz |
Re: [DB] Database Manager
Quote:
"driver" "mysql" as.... "driver" "default" still errors. |
Re: [DB] Database Manager
Did you read the part of:
Unknown MySQL server host 'db1107.perfora.net' Source mod could not connect to db1107.perfora.net |
Re: [DB] Database Manager
Yea turns out the host we were using did not allow this type of usage.
|
Re: [DB] Database Manager
ok, setup a free mysql database and I think it is working. It appears to connect to the data base (no more errors) and it appears to keep track of money. When myself and two others got in the server to try it, we immediately had these HUGE amounts of money in our accounts when we ran bank status. Then we deposited 1000 in to our accounts and then it said we had 50,000. Any ideas?
|
Re: [DB] Database Manager
ok...weird.
Last night after I setup the mysql database and the database manager along with bank mod, it acted all weird and in the database there was no data. Now today it appers fine and the database is populated. All new joining players start with 0. Maybe it is like a good bread and just needed time for the yeast to rise? lol. |
Re: [DB] Database Manager
I am confused... D:
|
Re: [DB] Database Manager
nice plugin, i'm using it on my server now in case it's required by bank.
I hope you write more awesome plugins ) |
Re: [DB] Database Manager
Questions
1-How does this work? How does this save the information? 2-Can you give some examples: -Creating a column if it doesn't exist -Reading and writing to columns named "xp"(integer) "name"(string) Suggestions 1-Can you remove 'add'(bool) and add 'todo'(string) to DB_SetInfo? ('todo' can be 'set', 'inc' or 'dec') 2-Saving and reading to custom ID's: PHP Code:
|
Re: [DB] Database Manager
Well, the whole idea of the plugin is people don't have to select tables, create users and bla bla bla...
SM Bank: MySQL is the only published plugin I finished that is based on this: http://forums.alliedmods.net/showthread.php?t=60110 I tried to make it as easy as possible... for example, for get player XP, you can just: PHP Code:
and maybe a cvar changing what player id will be |
Re: [DB] Database Manager
But you use "client". So it's saved with Name, IP or SteamID and it's not enough. Players' change names, some players have dynamic IP's and this can't be used to save plugin settings.
|
Re: [DB] Database Manager
if SteamID is not enough, I wonder how you are keeping data :O
and player data are saved when they disconnected, with their Steam_id as id |
Re: [DB] Database Manager
Yea even I am lost on that comment.
|
Re: [DB] Database Manager
i'm sorry. i'm a complete noobie to SourceMod. A mani transfer over.
So I'm trying to set up the bank. I have no idea how to setup mysql. So i'm not sure if I have a database made somewhere on my server, nor do I know if I dont have a db, what I do to set one up. If somebody could give me damn near a step by step instruction to installing both bank and the database manager I would really appreciate it |
Re: [DB] Database Manager
The same way you setup a plugin...
Just put both .smx files into your plugins folder |
Re: [DB] Database Manager
Hey "Nican" how can I get rid of this error. Thanks for your help. We are still using a "free" Mysql Database. I was thinking maybe the database was being slow or something.
L 10/01/2007 - 00:19:45: [SM] Native "SQL_FetchRow" reported: Invalid query Handle 0 (error: 4) L 10/01/2007 - 00:19:45: [SM] Debug mode is not enabled for "a_mysql.smx" L 10/01/2007 - 00:19:45: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 6 on |
Re: [DB] Database Manager
Change to SQLite
Apparently your MySQL is not being able to make complete requests, and failing in gathering player data |
Re: [DB] Database Manager
Where does the sql lite make the database at when you do the local database thing ?
Ive looked through all my files and cant find the database it has created |
Re: [DB] Database Manager
/sourcemod/data/sqlite/sourcemod-local.sq3
|
Re: [DB] Database Manager
Ok.. What exactly does it take to get this to store locally. When we try to transfer money we get "no one connected". and this error is showing up.
Code:
L 10/21/2007 - 21:42:03: [SM] Native "SQL_FetchRow" reported: Invalid query Handle 0 (error: 4)Code:
L 10/21/2007 - 20:11:01: [a_mysql.smx] DB MANAGER SAYS:Code:
sm_db_config storage-localWell I am lost. Still getting errors even after adding the storage local line. Still cannot transfer money between players. Code:
L 10/22/2007 - 18:39:16: Info (map "de_dust2") (file "errors_20071022.log") |
Re: [DB] Database Manager
Can you tell me what Version of this plugin are you using (type "sm plugin list" in console) and can you attach the DB you were using? (/sourcemod/data/sqlite/sourcemod-local.sq3)
I am sorry for the late response, I am having a horrible time lately |
Re: [DB] Database Manager
1 Attachment(s)
Sorry to hear that. Hopefully things will loosen up for you.
Code:
metamod_version "1.4.2.414" |
Re: [DB] Database Manager
hey Nican,
any chance you'd be able to implement an option to creat all the tables based on the date? For example: when no new information has been recorded for a cetrain steam_ID that then all those table entries are deleted. This would help to keep the database small. |
Re: [DB] Database Manager
What exactly does this "There is not one connected" message mean? That may be a start in finding out what is going on. With the bank and transfering money.
This error is filling my logs. Code:
L 10/26/2007 - 22:37:05: [SM] Native "SQL_FetchRow" reported: Invalid query Handle 0 (error: 4) |
Re: [DB] Database Manager
just realised sm_db_mapload is not even defined in the .sp file. Is it still working?
|
Re: [DB] Database Manager
Ops... my bad
I removed it after I discovered that all players are disconnected and reconnected when map changes, so client_disconnect is taking care of it |
Re: [DB] Database Manager
I am back on-line.
I updated this plugin, and tested on saving string, float and integer values, and they are all working. I am now working to add: - Key / Value table - Allow plugins to force the MySQL to update / select information from the database. - Added cvars to allow more frequent UPDATE queries. |
| All times are GMT -4. The time now is 18:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.