ffrostfall
(ffrostfall)
August 12, 2022, 11:20pm
#42
Every single thing you need to interface with is in the BridgeNet
table. You shouldn’t be requiring any modules in the BridgeNet module.
Asides from that, as said the module uses symbols from Roact.
I’m pretty sure you just have a typo. Try Receive
How do I use it? Documentation kinda outdated.
ffrostfall
(ffrostfall)
August 13, 2022, 12:25am
#44
I’ll update the documentation on Sunday. For now,
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60
})
The rest of the documentation should be accurate.
Bulldo344
(LawMixer)
August 13, 2022, 12:26am
#45
This is not correct, as it gives me the same error as I stated. I just copied and pasted the same message that @commitblue said.
Here is my script it works now.
Client:
local BridgeNet = require(game.ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
local Remote1 = BridgeNet.CreateBridge("RemoteEvent1")
script.Parent.MouseButton1Click:Connect(function()
Remote1:Fire("Hello", "this is a test.")
end)
Script:
local BridgeNet = require(game.ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
local Remote1 = BridgeNet.CreateBridge("RemoteEvent1")
Remote1:Connect(function(Player, ...)
print(Player, ...)
end)
1 Like
How do I use BridgeNet.CreateIdentifier, how does it work?
Bulldo344
(LawMixer)
August 13, 2022, 12:48am
#48
Are you running the unstable release of BridgeNet? I’m using the latest stable build.
ffrostfall
(ffrostfall)
August 13, 2022, 12:49am
#49
BridgeNet.CreateIdentifier makes a shared static string that’s shared between the client and server.
ffrostfall
(ffrostfall)
August 13, 2022, 12:50am
#50
The latest stable build should be v1.4.3-beta
Only the global logging feature is unstable/not fully tested
I’m using the new version v.1.4.3
What are the functions for FireClient and FireAllClients?
Bulldo344
(LawMixer)
August 13, 2022, 12:51am
#54
Yep, didn’t know if it was fully released yet. I’ll start using it then.
ffrostfall
(ffrostfall)
August 13, 2022, 12:52am
#55
Read the documentation linked in the post before asking these questions, please.
1 Like
Bulldo344
(LawMixer)
August 13, 2022, 12:54am
#56
Alright, am I doing this properly?
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.BridgeNet)
local ServerBridge = require(ReplicatedStorage.BridgeNet.ServerBridge)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
BridgeNet.CreateBridge("Something"):Connect(function(player, test)
print(player.Name, test)
end)
local Bridge = BridgeNet.CreateBridge("Remote")
Bridge:FireTo(game.Players:WaitForChild("Bulldo344"), "Hello", "World!")
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
BridgeNet.CreateBridge("Something"):Fire("something")
local ClientBridge = require(ReplicatedStorage.BridgeNet.ClientBridge)
local Bridge = ClientBridge.new("Remote")
Bridge:Connect(function(text)
print(text)
end)
ffrostfall
(ffrostfall)
August 13, 2022, 1:05am
#58
Don’t require ClientBridge directly.
Also, I advise you not rely on order. Right now, creating the ClientBridge before the ServerBridge will end up having odd behavior.
I don’t think that test code would work either- the servers code runs before the client.
Both bridges need to have the same name to work, btw.
Bulldo344
(LawMixer)
August 13, 2022, 1:09am
#59
How would I yield until the ClientBridge is created?
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
local ServerBridge = require(ReplicatedStorage.BridgeNet.ServerBridge)
local Bridge1 = BridgeNet.CreateBridge("Remote")
Bridge1:FireTo(game.Players:WaitForChild("Bulldo344"), "This is server to client")
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60,
})
local ClientBridge = require(ReplicatedStorage.BridgeNet.ClientBridge)
local Bridge1 = ClientBridge.new("Remote")
Bridge1:Connect(function(text)
print(text)
end)
Schkr1
(Schkr1)
August 13, 2022, 1:49pm
#61
You do not require Client Bridge. Only require the main BridgeNet Module.
Server
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage:WaitForChild("BridgeNet"))
BridgeNet.Start({
[BridgeNet.DefaultSend] = 60,
[BridgeNet.DefaultReceive] = 60,
})
local Object = BridgeNet.CreateBridge("Test")
Object:Connect(function(plr, arg1)
end)
Object:FireAll("Received: FireAll", "Test")
Client
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local BridgeNet = require(ReplicatedStorage:WaitForChild("BridgeNet"))
BridgeNet.Start({
[BridgeNet.DefaultSend] = 60,
[BridgeNet.DefaultReceive] = 60,
})
local Object = BridgeNet.CreateBridge("Test")
Object:Connect(function(arg1)
end)
Object:Fire("Hello", "world", "testing!")
1 Like
ffrostfall
(ffrostfall)
August 13, 2022, 3:38pm
#63
That would be pretty cool for admin systems which require sending sensitive data over remote events. Thank you for the feature suggestion! I will definitely look into it.
@ffrostflame V1.4.3 is broken. Here’s the error
BridgeNet.rateManager:46: attempt to perform arithmetic (div) on number and nil.
Line 46 - function GetSendRate