[DEPERCATED] NetTS, just another networking library

Depercated due to idea of “maybe you do not need to use this module

I will introduce the network module that I made with TypeScript to you.
(Do not worry, you can use it with Roblox script)

for the TypeScript usage tutorial and source code, you can check GitHub source

Here is the Roblox module

Tutorials

Import
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')
Single Script
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('print params', function(params)
    print(params)
end)
myevents:emit('print params', { test = 111 })
Server To Server | Client To Client
-- Script 1
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('print params', function(params)
    print(params)
end)
-- Script 2
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:emit('print params', { test = 111 })
Server To Client
-- LocalScript
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('print params', function(params)
    print(params)
end, true) -- <--- you have to add extra ",true)" to specify this is a remote event
-- Script
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:emit('print params', { test = 111, _player = game.Players.Monotter }, true) -- <--- you have to add extra ",true)" to specify this is a remote event
-- also to specify a specific player you have to use "_player" parameter
Server To All Clients
-- LocalScript
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('print params', function(params)
    print(params)
end, true) -- <--- you have to add extra ",true)" to specify this is a remote event
-- Script
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:emit('print params', { test = 111 }, true) -- <--- you have to add extra ",true)" to specify this is a remote event
-- if you do not specify "_player" parameter, it will automatically act like FireAllClients
Client To Server
-- Script
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('kick itself', function(params)
    local Player = params._player
    local Reason = params.reason
    Player:Kick(Reason)
end, true) -- <--- you have to add extra ",true)" to specify this is a remote event
-- LocalScript
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:emit('kick itself', { reason = 'im so pro' }, true) -- <--- you have to add extra ",true)" to specify this is a remote event
Return
-- Script 1
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

myevents:addListener('add', function(params)
    return params.number1 + params.number2
end)
-- Script 2
local Net = require(game.ReplicatedStorage.NetTS).default
local myevents = Net.new('myevents')

local result = myevents:emit('add', { number1 = 30, number2 = 1 }, false, true)
print(result) -- 31

You can use this "return thing" on "Server To All Clients" too, it will give a result of the first returned function

To Do

  • data packing and queue system to reduce lag like BridgeNet does

that’s all, I hope you love it!

8 Likes

How is this different from bridgenet

2 Likes

uuh, probably this

  • easier to use
  • do not need a init script
  • you can use return functions

This is something that looks useful for Rojo projects. If you want to keep all the scripts, events, etc with partially managed Rojo, then this is perfect if you don’t want to mess around with the project Json or put the events in your place. I am using it for my project and it is just what I needed!

2 Likes

Have you test the connection and performance difference between this system and BridgeNet?

2 Likes

If you’re looking for a replacement for Roblox Events, this ain’t it:

  • the module is overtly complicated for zero reason, and any documentation is far more limited compared to Roblox’s;
  • the ‘Developer’ flags any post that disagrees with them, or states that their product is outright useless which is a massive red flag;
  • it is made totally redundant by BridgeNet, and other similar solutions, and per posting rules, this thread shouldn’t exist as it doesn’t even attempt to expand on such
  • this solution is not needed, nor wanted, and either serves a niche category or a non existent category, either way, this does not belong per posting rules;
  • Roblox’s pre-existing events are literally fine as they are, I have no idea why people are attempting to “improve” upon existing products, when there is no market for this; and
  • Roblox’s pre-existing events do not cause excess lag, and anyone who tells you otherwise is lying; stating that your product reduces lag is deceitful and dishonest in my opinion as any “optimization” to Roblox’s pre-existing remote functions and remote events is minimal, and not noticeable to the average user.
2 Likes

Significant overall ; your contributions must be more substantial than small scripts or a few individual assets. Resources that are not significant enough, too specific / not useful to many people, or too low quality should be posted in a different forum category.

I don’t agree with any of these,

  • The module is not complicated and still if you are thinking that is complicated you should tell more than your opinion, also documentation is good enough for this module
  • No, before flagging your last post I tried to get meaningful explanation from you but since you did not gave any reasonable answer I flagged your post as inappropriate because it is. DevForum Moderators accepted it so deleted it.
  • If you think it’s totally redundant, that’s only your opinion if you do not give a specific example instead of some words
  • Roblox’s pre-existing events have to be exist to use them. When you are using this module you do not need to create events anymore. I needed a module like this so I made it and used It for a long while. Now I am sharing this with community.
  • In this topic you can never see anyone tells “Roblox’s pre-existing events are cause excess lag”, I agree with you whoever tells this is lying. Also It’s dishonest and deceitful to populism on things that aren’t exist.

Small Note:

I did not ever specified anything about “why you should use my module” on the original post, this because it only offers simpler interface and you can already observe that interface with tutorials on it.
It is not my intention to market this module.

1 Like

No, I did not tested it. This system only a wrapper and few additions to Roblox events. This is only useful when you are object oriented programming.

It is significantly more complicated than Roblox’s current event systems, and I still argue there is zero point in using this.

It is redundant, it’s an objective fact, Roblox’s systems do what you’re trying to backdoor without any over complicated code.

This is a lie, I did clarify with you what was wrong, and specifically stated that your module was an over complication and had little practical uses; you then flagged my post because you disagreed with me, despite me providing constructive clarification via PMs when you reached out.

Roblox’s pre-existing events are far less complicated than what you are proposing, and there is no reason why you should not create a physical event; I cannot see any experienced or aspiring developer using this, who understand how to use remote events.

There are a lot of points that you brought up that I simply disagree with. I will try to express my arguments the most civil way possible.

Just looking at the docs, I don’t see it being “complex”. You setup a listener, and fire that listener from another place. In fact, working with pure remotes (not that this library somehow implements a custom networking object), is far complicated to do from code.

It is more of an opinion of yours. This library was created with the intention to be used with roblox-ts, which you would probably use rojo with, and you don’t know how pain it is to set up remotes (or any instances) in a rojo workflow without doing it from code.

If you are using a studio workflow, then I can understand it, however, just like I said before, this library was created to be used in a workflow like rojo.

Also, because you know how to use remote events doesn’t mean you shouldn’t find better solution for your own use-case. Even in studio workflow, it is pain to make your communication (server-client) infrastructure scale well without using a library that creates the remote events for you during run-time.


TIP: I have seen your other replies that apparently got deleted, and all what I can say is, unconstructive criticism isn’t welcomed in the OS community.

3 Likes