diff options
Diffstat (limited to 'gamemode/config')
| -rw-r--r-- | gamemode/config/sv_newplayer.lua | 23 | ||||
| -rw-r--r-- | gamemode/config/sv_sql.lua | 26 |
2 files changed, 49 insertions, 0 deletions
diff --git a/gamemode/config/sv_newplayer.lua b/gamemode/config/sv_newplayer.lua new file mode 100644 index 0000000..9bb1420 --- /dev/null +++ b/gamemode/config/sv_newplayer.lua @@ -0,0 +1,23 @@ +local np = {} +local inv = nrequire("inventory/inventory.lua") +local itm = nrequire("inventory/item.lua") + +np.newdata = function() + return { + inventories = { + {"Equipment", inv.CreateInventory("Equipment"):Serialize()} + }, + skills = {}, + prayers = {}, + quests = {}, + } +end + +np.newmeta = function() + return { + lastserver = "67.163.245.187:27015", + lastlocation = "185 310 524" + } +end + +return np diff --git a/gamemode/config/sv_sql.lua b/gamemode/config/sv_sql.lua new file mode 100644 index 0000000..1c02a3c --- /dev/null +++ b/gamemode/config/sv_sql.lua @@ -0,0 +1,26 @@ +local sql = {} + +--SQL stuff, be careful to keep this secret! + +local parse = { + ["EnableMySQL"] = tobool, + ["Host"] = tostring, + ["Username"] = tostring, + ["Password"] = tostring, + ["Database_name"] = tostring, + ["Database_port"] = tonumber, + ["Preferred_module"] = tostring, + [""] = function() return nil end +} + +local mysqlconfig = file.Read("artery/mysql.txt") +for _,line in pairs(string.Explode("\n",mysqlconfig,false)) do + local key, value = unpack(string.Explode("=",line,false)) + assert(parse[key],string.format("SQL field unknown:%q known fields:\n\t%s",key,table.concat(table.GetKeys(parse),"\n\t"))) + sql[key] = parse[key](value) +end + +print("After parseing mysql config, it is") +PrintTable(sql) + +return sql |
