aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/database
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/database')
-rw-r--r--gamemode/core/database/sv_setup.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua
index 2fb7ed7..2cb69d1 100644
--- a/gamemode/core/database/sv_setup.lua
+++ b/gamemode/core/database/sv_setup.lua
@@ -34,13 +34,18 @@ local function connect()
MySQLite.initialize(config)
end
hook.Add("DatabaseInitialized","setup_table",function()
+ assert(MySQLite.isMySQL(),"Database wasn't mysqloo, something is probably wrong!")
local setup_success = function(res,li)
print("Set up connection to db")
end
print("Setup query:",setup_db)
MySQLite.query(setup_db,setup_success,q_fai)
end)
-connect()
+
+hook.Add("Initialize","initalizedbconnection",function()
+ connect()
+end)
+
--Retruns (PlayerData, MetaData) or nil
function sql.GetPlayerData(ply)
@@ -65,7 +70,7 @@ function sql.GetPlayerData(ply)
return
end
print("We were on the right server")
- --[[
+
print("Before finding data in the metatable, mtbl was ")
PrintTable(mtbl)
print(type(mtbl.lastlocation))
@@ -74,8 +79,8 @@ function sql.GetPlayerData(ply)
for k,v in pairs(vec) do vec[k] = tonumber(v) end
print("setting player pos to")
PrintTable(vec)
- ]]
- ply:SetPos(mtbl.lastlocation)
+
+ ply:SetPos(Vector(unpack(vec)))
q.deserialize_player(ply,plyd)
end
end