mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-25 21:51:38 +00:00
Fixed rename checker not being reset on client disconnect
This commit is contained in:
parent
87950f36ce
commit
5898b079bf
1 changed files with 11 additions and 9 deletions
|
@ -43,7 +43,7 @@ function admin.setPlayerLevel(clientId, level, invokerId)
|
|||
db.addsetlevel(playerId, level, invokerPlayerId, os.time())
|
||||
end
|
||||
|
||||
function admin.onconnectattempt(clientId, firstTime, isBot)
|
||||
function admin.onClientConnectAttempt(clientId, firstTime, isBot)
|
||||
if firstTime then
|
||||
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
|
||||
|
||||
|
@ -63,14 +63,9 @@ function admin.onconnectattempt(clientId, firstTime, isBot)
|
|||
|
||||
events.trigger("onClientConnect", clientId, firstTime, isBot)
|
||||
end
|
||||
events.handle("onClientConnectAttempt", admin.onconnectattempt)
|
||||
|
||||
function admin.onconnect(clientId, firstTime, isBot)
|
||||
-- only increase the counter on first connection (fixes counter increase on
|
||||
-- clientbegin which is also triggered on warmup/maprestart/etc)
|
||||
--[[ stats.set(clientId, "namechangeStart", os.time())
|
||||
stats.set(clientId, "namechangePts", 0) ]]
|
||||
events.handle("onClientConnectAttempt", admin.onClientConnectAttempt)
|
||||
|
||||
function admin.onClientConnect(clientId, firstTime, isBot)
|
||||
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
|
||||
local player = db.getplayer(guid)
|
||||
|
||||
|
@ -83,7 +78,14 @@ function admin.onconnect(clientId, firstTime, isBot)
|
|||
end
|
||||
end
|
||||
end
|
||||
events.handle("onClientConnect", admin.onconnect)
|
||||
events.handle("onClientConnect", admin.onClientConnect)
|
||||
|
||||
function admin.onClientDisconnect(clientId)
|
||||
if playerRenames[clientId] then
|
||||
playerRenames[clientId] = nil
|
||||
end
|
||||
end
|
||||
events.handle("onClientDisconnect", admin.onClientDisconnect)
|
||||
|
||||
function admin.onClientNameChange(clientId, oldName, newName)
|
||||
-- rename filter
|
||||
|
|
Loading…
Reference in a new issue