BridgeNet | Insanely optimized, easy-to-use networking library full of utilities, now with roblox-ts! | v1.9.9-beta

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.

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.

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?

Are you running the unstable release of BridgeNet? I’m using the latest stable build.

BridgeNet.CreateIdentifier makes a shared static string that’s shared between the client and server.

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?

Yep, didn’t know if it was fully released yet. I’ll start using it then.

Read the documentation linked in the post before asking these questions, please.

1 Like

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)

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.

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)

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

Encrypted remotes!?

1 Like

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