BridgeNet2, v1.0.0 | A blazing fast networking library for Roblox

Not finished yet.

I have to sort through the API docs that were made in a pull request, and then I have to publish it. Should be soon enough.

Hi,

I am trying to understand BridgeNet2 and have a question, below is a localscript and am I correct that you would make a Bridge for each call to the client?

Below I have a bridge for playing a sound on the client and a bridge that collects an item and give the player money.

Is this the correct was of doing it or should I combine in one call with an array?

local BridgeNet2 = require(game:GetService(ā€œReplicatedStorageā€).Modules.BridgeNet2)
local SoundBridge = BridgeNet2.ReferenceBridge(ā€œSoundBridgeā€)
local CollectBridge = BridgeNet2.ReferenceBridge(ā€œCollectBridgeā€)

Yes, this is the correct way of creating bridges.

How to use it so like yk i can create 2 bridges for server to server communication.
BridgeNet2.ServerBridge(ā€œName Hereā€) doesnt work. Idk if it was meant to work that way

Is it possible to set up BridgeNet to be run in parallel?

1 Like

whatā€™s your use case for this? Iā€™m not completely opposed to it, but that is fairly complex I think.

No specific use case other than to utilize multi-threading for performance. And because it uses a roblox signal (remote event), I thought it could be possible to setup.

But I imagine it would be really complex, thatā€™s why I was curious if BridgeNet could even support that, or if it would be to different from the core code.

I guess it isnā€™t worth the hassle.

Is it intentional for connections to bridges on the client to preserve even after the script for them has been deleted? Thatā€™s not the same behavior as receiving remoteevent calls, where it would normally disconnect once the script is gone.

Thereā€™s no realistic way I can replicate this behavior.

I can just defer all the bridge calls until its synchronized again.

Canā€™t exactly give actual support for it though

Jeez so we got Bridgenet, Fastnet, Red All of these resources are amazing specially for replication systems where packets need to be sent every step.

I love all of these resources I hope bridgenet and the other resources become more used by devs

1 Like

Does the :InvokeServerAsync() and OnServerInvoke functionality work, if so could someone provide an example of it in action. I canā€™t seem to get it to function.

I typed a 1 instead of an i nvm :frowning:

CombatMishimaBridge:Connect(function(player, count)

	local truecount = count[1]

The following bit worked with BridgeNet1 and let me sort through a nice array, but BridgeNet 2 is erroring out with ā€œattempt to index number with numberā€.

Can you explain the proper syntax and way to do this for BridgeNet2?

Is this whatā€™s happening? Every time I reset, I think Iā€™m getting phantom print()'s from the same bridge.

Show what youā€™re sending through as count.

Local script to send a ā€œcountā€ of where weā€™re at in a combo attack.

UIS.InputBegan:Connect(function(input,isTyping)
	if isTyping then return
	elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
		if Debounce == false then 
			Debounce = true
			CurrentTime = tick()
			local PassedTime = CurrentTime - PreviousTime
			if not Humanoid.Parent:GetAttribute("Stunned", true) then
				if PassedTime < 1.2 then
					-- Can continue the combo
					count = count + 1
					if count > 10 then
						count = 1
					end
				else -- Restarts the combo
					count = 1 		
				end
			else count = 1
			end
			CombatMishimaBridge:FireServer(count)

		end
	end
end)

Server script to receive it, below, count[1] worked with BridgeNet1.

CombatMishimaBridge:Connect(function(player, count)

	local truecount = count[1]
	print(truecount)

Error: Attempt to index number with number (server)

Additionally, I can resolve it by reformatting ā€œcount[1]ā€ to simply ā€œcountā€, but Iā€™m then getting phantom prints with the above script. Iā€™ll get very accurate counts until I reset, and then Iā€™ll still keep getting accurate counts, but Iā€™ll also get the old prints before the reset, which will constantly spam the last number the combo count was left at. Again, not an issue with BridgeNet1, only became an issue when I switched over. I suspect a syntax error. Any clues?

Hey nevermind, solved my own issue. Lots of reading through the documentation.

version 1.0.0: 10/20/2023

Added

  • Added an easy way to type payloads using generics. This will be elaborated on in documentation later

Fixes

Improvements

  • Added unique IDs to the invoke functionality. Should fix a multitude of bugs.
  • Re-did rate limiting. Iā€™m confident that itā€™s stable.

BridgeNet2 is now officially production-ready. Please let me know if thereā€™s anything I need to hotfix, Iā€™ll be watching closely for the next week or so.

7 Likes