mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Use lossy conversion for msgpack UInt64 decode in plugin (#1255)
This commit is contained in:
parent
9bbb1edd79
commit
988efb45b1
1 changed files with 7 additions and 0 deletions
|
|
@ -14,6 +14,13 @@ local Http = {}
|
||||||
Http.Error = HttpError
|
Http.Error = HttpError
|
||||||
Http.Response = HttpResponse
|
Http.Response = HttpResponse
|
||||||
|
|
||||||
|
-- Monkey patch msgpack.UInt64.new to lossily convert the low and high bits of the integer
|
||||||
|
-- to a native Luau number. We should change the upstream decoder to emit a native
|
||||||
|
-- integer, once those are live.
|
||||||
|
function msgpack.UInt64.new(mostSignificantPart: number, leastSignificantPart: number): number
|
||||||
|
return (mostSignificantPart % 2 ^ 32) * 2 ^ 32 + (leastSignificantPart % 2 ^ 32)
|
||||||
|
end
|
||||||
|
|
||||||
local function performRequest(requestParams)
|
local function performRequest(requestParams)
|
||||||
local requestId = lastRequestId + 1
|
local requestId = lastRequestId + 1
|
||||||
lastRequestId = requestId
|
lastRequestId = requestId
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue