mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 06:41:53 +00:00
Fixed greetings returning errors when database is not connected
This commit is contained in:
parent
2a71ab2bb1
commit
6d0ba325f1
1 changed files with 5 additions and 3 deletions
|
@ -17,6 +17,8 @@
|
|||
|
||||
local auth = require (wolfa_getLuaPath()..".auth.auth")
|
||||
|
||||
local db = require (wolfa_getLuaPath()..".db.db")
|
||||
|
||||
local players = require (wolfa_getLuaPath()..".players.players")
|
||||
|
||||
local constants = require (wolfa_getLuaPath()..".util.constants")
|
||||
|
@ -33,9 +35,9 @@ local userGreetings = {}
|
|||
local levelGreetings = {}
|
||||
|
||||
function greetings.get(clientId)
|
||||
if db.isConnected() and not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then
|
||||
local lvl = auth.getPlayerLevel(clientId)
|
||||
|
||||
if not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then
|
||||
if userGreetings[players.getGUID(clientId)] ~= nil then
|
||||
return userGreetings[players.getGUID(clientId)]
|
||||
elseif levelGreetings[lvl] ~= nil then
|
||||
|
|
Loading…
Reference in a new issue