Skip to content

Commit

Permalink
Merge pull request #8 from sasial-dev/fix/GetRemoteData
Browse files Browse the repository at this point in the history
`GetRemoteData` Bugfixes
  • Loading branch information
Pyseph authored Aug 11, 2024
2 parents 1e58159 + b32337c commit 353d185
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Components/PacketChart.luau
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function PacketChart:didMount()
local ArcData = {}

for _, Packet in FrameData.Packets do
local RemoteData = GetRemoteData(Packet.Remote, Packet.RawData)
local RemoteData = GetRemoteData(Packet.Remote, unpack(Packet.RawData))
if typeof(RemoteData) == "string" then
local RemoteName = RemoteData
local PacketSize = Packet.Size
Expand All @@ -106,7 +106,7 @@ function PacketChart:didMount()
local PacketSize = PacketSizeCounter.GetPacketSize({
RunContext = Packet.RunContext,
RemoteType = "RemoteEvent",
PacketData = RemoteCall.Data,
PacketData = RemoteCall.Arguments,
}) - PacketSizeCounter.BaseRemoteOverhead

if Packet.RunContext == "Client" then
Expand All @@ -115,7 +115,7 @@ function PacketChart:didMount()

if not ArcData[RemoteName] then
ArcData[RemoteName] = {
Size = 0,
Size = PacketSizeCounter.BaseRemoteOverhead,
Data = {},
}
end
Expand All @@ -124,7 +124,7 @@ function PacketChart:didMount()
local PlacementIndex = #ArcData[RemoteName].Data + 1
ArcData[RemoteName].Data[PlacementIndex] = {
Name = RemoteCall.Name,
Packet = TableToSyntaxString(RemoteCall.Data, true)
Packet = TableToSyntaxString(RemoteCall.Arguments, true)
}
end
end
Expand Down
5 changes: 3 additions & 2 deletions src/Modules/TableToSyntaxString.luau
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@ local function TableToSyntaxString(Table, DontShowBytes, IgnoredTables, DepthDat
Index += 1
end

local Bracket = Depth == 1 and "" or c["}"]
local StartBracket = Depth == 1 and "" or c["{"]
local EndBracket = Depth == 1 and "" or c["}"]
local NewLine = Depth == 1 and "" or `\n`
local Result = table.concat(Lines, "")
return IsEmpty and `{Result}{Bracket}` or `{Result}{NewLine}{TrailingTab}{Bracket}`
return IsEmpty and `{StartBracket}{Result}{EndBracket}` or `{StartBracket}{Result}{NewLine}{TrailingTab}{EndBracket}`
end

return TableToSyntaxString

0 comments on commit 353d185

Please sign in to comment.