mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-10 06:41:53 +00:00
Fixed log files not being created (fixes #99)
This commit is contained in:
parent
f5da5b151b
commit
506db84674
1 changed files with 13 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
local players = wolfa_requireModule("players.players")
|
||||
|
||||
local files = wolfa_requireModule("util.files")
|
||||
local settings = wolfa_requireModule("util.settings")
|
||||
|
||||
local logs = {}
|
||||
|
@ -26,6 +27,12 @@ function logs.writeChat(clientId, type, ...)
|
|||
return
|
||||
end
|
||||
|
||||
if not files.exists(settings.get("g_logChat")) then
|
||||
local fileDescriptor, _ = et.trap_FS_FOpenFile(settings.get("g_logChat"), et.FS_WRITE)
|
||||
|
||||
et.trap_FS_FCloseFile(fileDescriptor)
|
||||
end
|
||||
|
||||
local fileDescriptor, _ = et.trap_FS_FOpenFile(settings.get("g_logChat"), et.FS_APPEND)
|
||||
|
||||
local logLine
|
||||
|
@ -52,6 +59,12 @@ function logs.writeAdmin(clientId, command, victimId, ...)
|
|||
return
|
||||
end
|
||||
|
||||
if not files.exists(settings.get("g_logAdmin")) then
|
||||
local fileDescriptor, _ = et.trap_FS_FOpenFile(settings.get("g_logAdmin"), et.FS_WRITE)
|
||||
|
||||
et.trap_FS_FCloseFile(fileDescriptor)
|
||||
end
|
||||
|
||||
local fileDescriptor, _ = et.trap_FS_FOpenFile(settings.get("g_logAdmin"), et.FS_APPEND)
|
||||
|
||||
local logLine
|
||||
|
|
Loading…
Reference in a new issue