From 4b54252590f2639dc4577177fa3ce66b729e72ce Mon Sep 17 00:00:00 2001 From: thegrb93 Date: Tue, 14 Jan 2025 01:18:51 -0500 Subject: [PATCH] Show owner when writing temp files (#1970) --- lua/starfall/libs_cl/file.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/starfall/libs_cl/file.lua b/lua/starfall/libs_cl/file.lua index d1b018d35..1e3600904 100644 --- a/lua/starfall/libs_cl/file.lua +++ b/lua/starfall/libs_cl/file.lua @@ -54,7 +54,8 @@ do self.entries = entries end - function TempFileCache:Write(plyid, filename, data) + function TempFileCache:Write(ply, filename, data) + local plyid = ply:SteamID64() local dir = "sf_filedatatemp/"..plyid local path = dir.."/"..filename local ok, reason = self:CheckSize(plyid, path, #data) @@ -65,7 +66,7 @@ do end self.entries[path] = {path = path, plyid = plyid, time = os.time(), size = #data} file.CreateDir(dir) - print("[SF] Writing temp file: " .. path) + print("[SF owner=\""..tostring(ply).."\"] Writing temp file: " .. path) local f = file.Open(path, "wb", "DATA") if not f then SF.Throw("Couldn't open file for writing!", 3) end f:Write(data) @@ -276,7 +277,7 @@ function file_library.writeTemp(filename, data) checkExtension(filename) filename = string.lower(string.GetFileFromFilename(filename)) - local path = TempFileCache:Write(instance.player:SteamID64(), filename, data) + local path = TempFileCache:Write(instance.player, filename, data) tempfilewrites = tempfilewrites + 1 return path end