- Fixed the revision number not showing properly. Hopefully it's fixed for good this time, as it works off of logic, instead of line numbers.

- Standardized the database library code
- Deleted a few unused database related files (karma and forum activation), so they won't get in my way later. They work off of no longer existent database tables.
- Made it so the server maintains a constant connection with the database, which is established on world/New() and never broken, until the server ends. If 5 consecutive database connection attempts result in no connection getting established, the server will not attempt any more connections. Made all existing database connections use the global continuous connections. Currently we need two, as we have two databases, but the old database is going to get moved into the new one.
- Fixed the spaghetti-like report in the permissions panel, which happened when someone had many permissions enabled.
- Added database connection reports to display to dream daemon on server startup.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5015 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-11-06 17:21:13 +00:00
parent f4a559f183
commit abad9978b2
16 changed files with 264 additions and 732 deletions

View File

@@ -1,28 +0,0 @@
/mob/verb/check_karma()
set name = "Check Karma"
set category = "Special Verbs"
set desc = "Reports how much karma you have accrued"
if(config.sql_enabled)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
usr << "\red Unable to connect to karma database. This error can occur if your host has failed to set up an SQL database or improperly configured its login credentials.<br>"
return
else
usr.verbs -= /mob/verb/check_karma
spawn(300)
usr.verbs += /mob/verb/check_karma
var/DBQuery/query = dbcon.NewQuery("SELECT karma FROM karmatotals WHERE byondkey='[src.key]'")
query.Execute()
var/currentkarma
while(query.NextRow())
currentkarma = query.item[1]
if(currentkarma)
usr << "<b>Your current karma is:</b> [currentkarma]<br>"
else
usr << "<b>Your current karma is:</b> 0<br>"
dbcon.Disconnect()
else
usr << "<b>SQL is off, karma is not usable<b>"