mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] adds a timeout to tgui payloads (#11535)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8bd4e1a84a
commit
b3e84aecb7
@@ -134,26 +134,9 @@
|
||||
if(type == "entry" || type == "force")
|
||||
var/id = href_list["packetId"]
|
||||
if(!isnull(id))
|
||||
id = text2num(id)
|
||||
|
||||
var/total = text2num(href_list["totalPackets"])
|
||||
if(id == 1)
|
||||
if(total > MAX_MESSAGE_CHUNKS)
|
||||
return
|
||||
|
||||
partial_packets = new /list(total)
|
||||
|
||||
partial_packets[id] = href_list["packet"]
|
||||
|
||||
if(id != total)
|
||||
return
|
||||
|
||||
var/assembled_payload = ""
|
||||
for(var/packet in partial_packets)
|
||||
assembled_payload += packet
|
||||
|
||||
payload = json_decode(assembled_payload)
|
||||
partial_packets = null
|
||||
payload = handle_packets(id, href_list["totalPackets"], href_list["packet"])
|
||||
if(!payload)
|
||||
return FALSE
|
||||
handle_entry(type, payload)
|
||||
return TRUE
|
||||
if(type == "lenwarn")
|
||||
|
||||
Reference in New Issue
Block a user