mirror of
https://github.com/wiremod/advdupe2.git
synced 2025-03-04 03:03:05 -05:00
Fix undo name
This commit is contained in:
parent
e8a103acd4
commit
115deefc61
@ -248,7 +248,7 @@ function AdvDupe2.InitializeUpload(ReadPath, ReadArea)
|
||||
local success, dupe, info, moreinfo = AdvDupe2.Decode(read)
|
||||
if(success)then
|
||||
AdvDupe2.PendingDupe = { read, dupe, info, moreinfo, name }
|
||||
RunConsoleCommand("AdvDupe2_InitReceiveFile")
|
||||
RunConsoleCommand("AdvDupe2_InitReceiveFile", name)
|
||||
else
|
||||
uploading = false
|
||||
AdvDupe2.Notify("File could not be decoded. ("..dupe..") Upload Canceled.", NOTIFY_ERROR)
|
||||
|
@ -221,7 +221,17 @@ local function AdvDupe2_InitReceiveFile( ply, cmd, args )
|
||||
|
||||
ply.AdvDupe2.Downloading = true
|
||||
ply.AdvDupe2.Uploading = true
|
||||
//ply.AdvDupe2.Name = args[1]
|
||||
--Sanitize the input name
|
||||
if args[1] then
|
||||
local _1, _2, _3 = string.find(args[1], "([%w_]+)")
|
||||
if _3 then
|
||||
ply.AdvDupe2.Name = string.sub(_3, 1, 32)
|
||||
else
|
||||
ply.AdvDupe2.Name = "Advanced Duplication"
|
||||
end
|
||||
else
|
||||
ply.AdvDupe2.Name = "Advanced Duplication"
|
||||
end
|
||||
|
||||
AdvDupe2.Network.ClientNetworks[id] = {Player = ply, Data = "", Size = 0, Timeout = CurTime() + AdvDupe2.Network.Timeout}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user