Okay. Nice to hear a fix for an issue found is being worked on, but still unsure if I am doing something wrong.
Since I am using the client->server event trigger. How should my setup look when using :FireServer without any additional arguments? Just to make sure I am understanding correctly.
I have added in the latest version 2.0.2. Still having issues. Not sure what is going on. I was really looking to get this setup and hopefully start seeing some benefits. Here is my setup below. Am I doing something wrong?
My Server Script:
My Local Script - Inside of ReplicatedStorage:
(You can see my previous :FireServer() disabled. That one works just fine.)
My ReplicatedStorage:
My Console Log:
(When I hit my âspacebarâ, this triggers the jump event - but you can see it returns a nil.)
*When the âJumpEventâ is triggered, it activates my vehicle to then jump for the player. As mentioned before, this all works with no problems and when I try to incorporate NetRay, the jump does not work.
You no longer need to call the setup function as it does it automatically once u require the module for the first time.
Also, youâre not listening to the event on the server and not sending any arguments (you donât necessarily need to)
Here is an updated Script for you to try
Server
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetRay = require(ReplicatedStorage:WaitForChild("NetRay"))
NetRay:RegisterEvent("JumpEvent")
NetRay:RegisterRequestHandler("JumpEvent", function(plr, args)
print(args) -- Will print what you sent, in this case "Testing"
end)
Client Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NetRay = require(ReplicatedStorage:WaitForChild("NetRay"))
-- Logic
NetRay:FireServer("JumpEvent","Testing")
Okay, I got it working. I did not realize I needed to also modify my event listeners to NetRay :RegisterRequestHandler as well.
I did notice the print log in my console being triggered twice everytime? Is that normal or is it something on my side? If it is not NetRay, I will look to resolve the issue.
No problem, if you have another other issues let me know or find any bugs. You can also delete the print in the module I accidentally left it there from testing
NetRayContinuousFireConnection = RunService.Heartbeat:Connect(function()
if IsNetRayContinuousFireActive then
for i = 1 , 200 do
NetRay:FireServer('NetRayContinuousFire', {
id = 'NetRay_CF_' .. os.time() .. '_' .. math.random(1, 1000),
payload = PAYLOAD
})
end
end
end)
RemoteEventContinuousFireConnection = RunService.Heartbeat:Connect(function()
if IsRemoteEventContinuousFireActive then
for i = 1 , 200 do
RemoteEvent:FireServer({
id = 'RE_CF_' .. os.time() .. '_' .. math.random(1, 1000),
type = 'Continuous Fire Event',
payload = PAYLOAD
})
end
end
end)
I tested them separately in the same game and place during same testing session
After testing with buffers, the benefits are not worth using them
I attempted to use buffers myself and another module (suphies packet module), and they both had the same issue. HUGE CPU usage and HUGE FPS and Ping increases wich doesnât justify the reduction in memory used when sending over events.
Some screenshots from testing
This was with suphis new packet module, The ping also reduced my frames to about 9fps
I am improving the binary encoder to encode everything before being sent over the event, which hopefully will reduce memory usage even more.
I am still going to keep at buffers until I can get them to be beneficial for me
I already tested packet and send a screen above, also sending the number 100 has no compressional advantage since you canât compress that short of a number down losslessly.
When I tried bytenet sending a 10kb payload 200 times a frame is just kept failing by erroring.
Iâll be able to show you once Iâm awake since itâs 2am for me right now