Skip to content

Commit

Permalink
Fix: Rojo deletes Remotes when live-syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
YetAnotherClown committed Nov 2, 2023
1 parent 9bedcf2 commit 56a4445
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions default.project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "Net",
"tree": {
"$path": "lib"
"name": "net",
"tree": {
"$path": "lib",
"Remotes": {
"$className": "Folder",
"$ignoreUnknownInstances": true
}
}
}
}
6 changes: 3 additions & 3 deletions lib/Bridge.luau
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,17 @@ function Bridge.new(configuration: { any }?)
local remoteKey = channel .. "@" .. event

if RunService:IsServer() then
self.remote = script:FindFirstChild(remoteKey) or Instance.new("RemoteEvent")
self.remote = script.Parent.Remotes:FindFirstChild(remoteKey) or Instance.new("RemoteEvent")
self.remote.Name = remoteKey
self.remote.Parent = script
self.remote.Parent = script.Parent.Remotes

local function processIncoming(player, package)
self:_processIncoming(player, package)
end

self.remote.OnServerEvent:Connect(processIncoming)
elseif RunService:IsClient() then
self.remote = script:WaitForChild(remoteKey)
self.remote = script.Parent.Remotes:WaitForChild(remoteKey)

local function processIncoming(package)
self:_processIncoming("NET_SERVER", package)
Expand Down

1 comment on commit 56a4445

@YetAnotherClown
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves Issue #4

Please sign in to comment.