mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 06:41:53 +00:00
Updated !finger command
* added level and level name * version removed, since it is not sent by Legacy clients
This commit is contained in:
parent
2e2c471d98
commit
a660a13876
2 changed files with 15 additions and 21 deletions
|
@ -22,6 +22,7 @@ local commands = wolfa_requireModule("commands.commands")
|
||||||
local players = wolfa_requireModule("players.players")
|
local players = wolfa_requireModule("players.players")
|
||||||
|
|
||||||
local settings = wolfa_requireModule("util.settings")
|
local settings = wolfa_requireModule("util.settings")
|
||||||
|
local util = wolfa_requireModule("util.util")
|
||||||
|
|
||||||
function commandFinger(clientId, command, victim)
|
function commandFinger(clientId, command, victim)
|
||||||
local cmdClient
|
local cmdClient
|
||||||
|
@ -46,22 +47,21 @@ function commandFinger(clientId, command, victim)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local stats = {
|
local name = players.getName(cmdClient)
|
||||||
["name"] = players.getName(cmdClient),
|
local cleanname = util.removeColors(players.getName(cmdClient))
|
||||||
["cleanname"] = players.getName(cmdClient):gsub("%^[^^]", ""),
|
local codedname = players.getName(cmdClient):gsub("%^([^^])", "^^2%1")
|
||||||
["codedsname"] = players.getName(cmdClient):gsub("%^([^^])", "^^2%1"),
|
local slot = cmdClient
|
||||||
["slot"] = cmdClient,
|
local level = auth.getPlayerLevel(cmdClient)
|
||||||
["guid"] = players.getGUID(cmdClient),
|
local levelName = util.removeColors(auth.getLevelName(level))
|
||||||
["ip"] = players.getIP(cmdClient),
|
local guid = players.getGUID(cmdClient)
|
||||||
["version"] = players.getVersion(cmdClient)
|
local ip = players.getIP(cmdClient)
|
||||||
}
|
|
||||||
|
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dInformation about ^7"..stats["name"].."^d:\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dInformation about ^7"..name.."^d:\";")
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dName: ^2"..stats["cleanname"].." ("..stats["codedsname"]..")\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dName: ^2"..cleanname.." ("..codedname..")\";")
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dSlot: ^2"..stats["slot"]..(stats["slot"] < tonumber(et.trap_Cvar_Get("sv_privateClients")) and " ^9(private)" or "").."\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dSlot: ^2"..slot..(slot < tonumber(et.trap_Cvar_Get("sv_privateClients")) and " ^9(private)" or "").."\";")
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dGUID: ^2"..stats["guid"].."\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dLevel: ^2"..level.." ("..levelName..")\";")
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dIP: ^2"..stats["ip"].."\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dGUID: ^2"..guid.."\";")
|
||||||
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dVersion: ^2"..stats["version"].."\";")
|
et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dIP: ^2"..ip.."\";")
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,10 +51,6 @@ function players.getProtocol(clientId)
|
||||||
return data[clientId]["protocol"]
|
return data[clientId]["protocol"]
|
||||||
end
|
end
|
||||||
|
|
||||||
function players.getVersion(clientId)
|
|
||||||
return data[clientId]["version"]
|
|
||||||
end
|
|
||||||
|
|
||||||
function players.isBot(clientId)
|
function players.isBot(clientId)
|
||||||
return data[clientId]["bot"]
|
return data[clientId]["bot"]
|
||||||
end
|
end
|
||||||
|
@ -162,8 +158,6 @@ function players.onClientBegin(clientId)
|
||||||
|
|
||||||
-- this is now available
|
-- this is now available
|
||||||
local clientInfo = et.trap_GetUserinfo(clientId)
|
local clientInfo = et.trap_GetUserinfo(clientId)
|
||||||
|
|
||||||
data[clientId]["version"] = et.Info_ValueForKey(clientInfo, "cg_etVersion")
|
|
||||||
end
|
end
|
||||||
events.handle("onClientBegin", players.onClientBegin)
|
events.handle("onClientBegin", players.onClientBegin)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue