I would like to suggest better naming and better documentation of this module, as it is very confusing on what is what, as it took me more than an hour to set it up. I would suggest documenting how to do server → client and via versa.
This is a good module nonetheless, and I will be rewriting my game into this.
This is very interesting. Can you possibly explain in detail how this works and why this is much faster than RemoteEvents. Where do RemoteEvents go wrong, which this module corrects, which causes it to be so much faster? I could learn a thing or two.
Sorry for the wait! A lot of stuff that should’ve been pushed earlier- however I was not at my computer. Documentation updates coming most likely tomorrow - I’m tired and I just got home.
Would you consider adding a way to fire remotes to all clients in a given range (eg. from a part)?
I am building realistic “network repeaters”, and it would help out a lot if it was included as an utility;
I also need to figure out how to make the network repeaters communicate with each other and form a mesh network
Added ClientBridge:InvokeServer(), returns a promise instead of yielding.
Refactored some code to be better-organized.
Refactored project structure / testing code to allow for dependencies
Added Promise as a dependency
Added GoodSignal as a dependency
There is no documentation as of right now because I kind of rushed releasing this.
:InvokeServer(), :OnInvoke(), and :InvokeServerAsync() are all experimental features- please don’t rely on them. However if you do experience any bugs, please don’t be afraid to DM me about it, or open an issue on the GitHub repository.
Hello there,
I was using BridgeNet in my game and ran into a problem. When the player respawns, for some reason, I’m not able to fire remotes created using bridgenet. Here is an example script that has the same problem for me:
Server:
local BridgeNet = require(game.ReplicatedStorage.BridgeNet)
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60
})
Remote = BridgeNet.CreateBridge("Remote")
Remote:Connect(function(player, message)
print("\n" .. player.Name .. " wanted to say the following message:\n" .. message)
end)
Client:
local BridgeNet = require(game.ReplicatedStorage.BridgeNet)
local UserInputService = game:GetService("UserInputService")
local success, err = pcall(function()
BridgeNet.Start({
[BridgeNet.DefaultReceive] = 60,
[BridgeNet.DefaultSend] = 60
})
end)
if success then print("Started") elseif err then print("Already Started") end
local Remote = BridgeNet.CreateBridge("Remote")
UserInputService.InputBegan:Connect(function(key,gampross)
if gampross then return; end
if key.KeyCode == Enum.KeyCode.E then
Remote:Fire("I am the best")
end
end)
After resetting, the remote just doesn’t work. If there is a solution or if there is something that I’m doing wrong let me know.
The localscript is inside the “StarterCharacterScripts.”
I actually deleted all of the remote events from my game and shifted to bridgenet but I forgot to keep a backup file. It would really suck if I had to change everything back to being functional with remote events as it took me quite a lot of time.
Edit: After moving the BridgeNet.Start thing into a separate local script inside “StarterPlayerScripts”, the problem was solved. If possible I would still like to know to reason as to why it wasn’t working when respawning with the old code.
It’s most likely because you were running it in StarterCharacterScripts- BridgeNet.Start isn’t supposed to be ran multiple times. There’s supposed to be a check that runs when BridgeNet runs multiple times though.
BridgeNet.Start creates the instances required for BridgeNet to run, and handles a ton of internal logic like connecting to heartbeat. Connecting this logic multiple times can mess BridgeNet up.
Is there any limits to number of parmaters being sent over the BridgeEvent, or type of parmaters it can send?
I’m losing data through an event.
A Client Event, sends to the Server some Data, and then the Server sends back to another Client that Data, but all the Data is turning up nil upon receving of the signal.
There are not supposed to be limits. Can you send your code?
It may be because one of the parameters you’re sending is nil- BridgeNet doesn’t allow for that due to performance.
What I mean:
local Object = BridgeNet.CreateBridge("Remote")
Object:Fire("test", nil, "test2") -- Unpredictable behavior. May cut off parameters.
If this still isn’t the issue, I’ll be releasing a debug mode probably tonight that may help diagnose your issue.
Lol I was just about to come edit my post, one of my parmeters being sent was nil (when it wasnt supposed to be), so it was turning the entire tuple nil. I fixed the issue tho.
Thank you for the reply. Epic Module too, I think it improved network performance a lot… just wish I could like compare and see how much its improving compared to the old standard remote event usage.