Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
- Update the remote name profiler to instead pass every remote argument, including the player if called on the server
- Fix in-game packet chart resizer not properly taking core gui inset into account (-.- TIL that `GuiService:GetGuiInset()` returns 0,0 if called on game start)
- Fix packet chart code containers cutting into scrollbar
  • Loading branch information
Pyseph committed Aug 10, 2024
1 parent 3cfafc4 commit 1e58159
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
22 changes: 13 additions & 9 deletions src/Components/ChartResize.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")

local GUI_INSET = GuiService:GetGuiInset()

local PacketProfiler = script.Parent.Parent
local Modules = PacketProfiler.Modules
local Packages = require(Modules.Packages)
Expand Down Expand Up @@ -60,8 +58,10 @@ function ChartResize:init()
table.clear(self.Connections)

table.insert(self.Connections, RunService.RenderStepped:Connect(function()
local Mouse = UserInputService:GetMouseLocation() - GUI_INSET
local Position = Rbx.AbsolutePosition
local GUI_INSET = GuiService:GetGuiInset()

local Mouse = UserInputService:GetMouseLocation()
local Position = Rbx.AbsolutePosition + GUI_INSET
local Size = Rbx.AbsoluteSize

local BottomPosition = Position.Y + Size.Y + EdgeSize
Expand Down Expand Up @@ -150,13 +150,17 @@ function ChartResize:render()
end

function ChartResize:willUnmount()
self.StopResizing()

for _, Connection in self.Connections do
Connection:Disconnect()
if self.StopResizing then
self.StopResizing()
end

table.clear(self.Connections)
if self.Connections then
for _, Connection in self.Connections do
Connection:Disconnect()
end

table.clear(self.Connections)
end
end

local function ChartResizeInit(PacketChart)
Expand Down
6 changes: 3 additions & 3 deletions src/Components/PacketChart.luau
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ else
RemoteNameLabeler = require(RemoteNameModule)
end

local function GetRemoteData(RemoteObject: RemoteEvent, FirstArgument: any?): {{Name: string, Arguments: {any}}} | string
local RemoteData = RemoteNameLabeler and RemoteNameLabeler(RemoteObject, FirstArgument)
local function GetRemoteData(RemoteObject: RemoteEvent, ...: any): {{Name: string, Arguments: {any}}} | string
local RemoteData = RemoteNameLabeler and RemoteNameLabeler(RemoteObject, ...)
if not RemoteData then
local RemoteName = RemoteObject.Name
return `{RemoteObject.Parent}.{RemoteName}`
Expand Down Expand Up @@ -82,7 +82,7 @@ function PacketChart:didMount()
local ArcData = {}

for _, Packet in FrameData.Packets do
local RemoteData = GetRemoteData(Packet.Remote, Packet.Data[1])
local RemoteData = GetRemoteData(Packet.Remote, Packet.RawData)
if typeof(RemoteData) == "string" then
local RemoteName = RemoteData
local PacketSize = Packet.Size
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PacketChartItems.luau
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function DataChartItem:render()
Container = Roact.createElement("Frame", {
AutomaticSize = Enum.AutomaticSize.Y,
Size = self.props.ScrollBarChanged:map(function(Data)
return UDim2.new(1, Data.Visible and -6 or 0, 0, 0)
return UDim2.new(1, Data.Visible and -12 or 0, 0, 0)
end),
Position = UDim2.fromOffset(8, 24),
Transparency = 1,
Expand Down
1 change: 1 addition & 0 deletions src/Components/PacketFrames.luau
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function PacketFrames:init()
table.insert(self.CurrentFrame.Packets, {
Remote = Remote,
Data = RunService:IsClient() and {FirstArgument, ...} or {...},
RawData = {FirstArgument, ...},
Size = PacketSize,
RunContext = RunService:IsClient() and "Client" or "Server",
})
Expand Down
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pysephwasntavailable/packetprofiler"
version = "2.0.0"
version = "2.1.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
description = "Remote packet profiler"
Expand Down

0 comments on commit 1e58159

Please sign in to comment.