aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gamemode/config/sv_sql.lua14
-rw-r--r--tutorials/tut000_setup.md5
2 files changed, 17 insertions, 2 deletions
diff --git a/gamemode/config/sv_sql.lua b/gamemode/config/sv_sql.lua
index 44e76ff..a4b5daa 100644
--- a/gamemode/config/sv_sql.lua
+++ b/gamemode/config/sv_sql.lua
@@ -12,8 +12,22 @@ local parse = {
["Preferred_module"] = tostring,
[""] = function() return nil end
}
+local default_file = [[
+EnableMySQL=true
+Host=localhost
+Username=root
+Password=root
+Database_name=artery
+Database_port=3306
+Preferred_module=mysqloo
+]]
local mysqlconfig = file.Read("artery/mysql.txt")
+if not mysqlconfig then
+ file.Write("artery/mysql.txt",default_file)
+ error("No sql setup defined, a default config has been given. edit garrysmod/data/artery/mysql.txt to configure it.")
+end
+
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")))
diff --git a/tutorials/tut000_setup.md b/tutorials/tut000_setup.md
index 05060f2..6d7fc55 100644
--- a/tutorials/tut000_setup.md
+++ b/tutorials/tut000_setup.md
@@ -16,8 +16,9 @@ First, you'll need to download the Artery gamemode base. This can be done for up
6. Clone the repository `git clone http://cogarr.net/source/cgit.cgi/artery`
7. Go back one level, then into your addons directory and clone the artery_editor addon (`cd ../addons` then `git clone http://cogarr.net/source/cgit.cgi/artery_editor`)
8. Another one `git clone https://cogarr.net/source/cgit.cgi/zones` _*_ Please note that this is a fork of [bobleheadbob's original api](https://github.com/Luabee/Zones), all it does is put the files into an addon format.
-9. Finally, be sure you are subscribed to PAC3 on the steam workshop
-10. Boot up gmod, select the artery addon, and load into gm_flatgrass to make sure it works! You can skip the next section, and go on to the next tutorial.
+9. Another one `git clone https://github.com/CapsAdmin/pac3.git`
+10. Finally, be sure clients are subscribed to PAC3 on the steam workshop
+11. Boot up gmod, select the artery addon, and load into gm_flatgrass to make sure it works! You can skip the next section, and go on to the next tutorial.
## Non-git setup