Net Library vs umsg

Would someone mind explaining, in detail, the pro/cons of these methods of sending information to clients.

The base understanding that I’ve been told is that net library is by far superior and should be used at all times and I’ve use net library for anything I created myself and have converted most of the gamemode we run to use it, but before I spend time prodding and converting other such addons I’d like to understand it better. While I know a few of the benefits of net library such as coding simplicity and easier for clients to return data to the server, I would like to know more about the performance aspects of these 2 methods. Mainly relating to both server and network performance.

Anyone who knows (No random guesses/idiocy) mind enlightening me?

With the .net lib you can send up to 64kb of data. Umsg had a size limitation that I personally didn’t like, but if you need ot send 64kb to the client in one go, you are doing something wrong.
You can also use Signed and Unsigned ints with the .net lib.

There are not many ways to compare them, They are 2 different system. I would strongly suggest just using the net lib, and just slowly forget about umsg.

I don’t ever use umsg myself anymore, havn’t done for a while, and I’m aware of the size limits and vastly increased functions of the net lib.

I was mainly looking into seeing if it was worth trawling through everything to replace the usmg with net lib code, mainly for performance.

I think net was meant more as a replacement for datastream than for usermessages, dunno if there’s a difference in performance though.

AFAIK usermessages are queued, whilst net messages are instantaneous.

i really don’t think it’s worth your time to go through and rewrite everything to use the net library

Net is two way, net is slightly faster as I’m pretty sure Usermessages aren’t flushed instantly.

Plus I personally see the Umsg system being removed in the future since as it’s redundant now, safer to use Net.

Net library: no queue, faster, more space/functionality
usermessage: queue, slower, less space/functionality

That’s about it.

To add on the queue for UMSG: They’re actually all run the NEXT frame. NetMSG are sent the same frame.

UMSG you could only send a small amount of data, I think 255 bytes, or something like that.

NetMSG you can send 64kb; or, if you do what I did, you can rewrite the way NetMSG’s are handled and remove the 64kb limit all in Lua. It’s simple. Basically if your message is larger than 64kb, you chunk the messages, generate a unique message id that can never collide, then sign the message with the id, which packet number it is, how many packets are to be expected, and the total size of the message. I personally downsize the message to 63kb to allow for a 1kb header ( even though I probably only use about 255 bytes with all information ).

As said above, UMSG you can only send from the server to the client, meaning if a client needs to respond, icky console commands and other crummy methods are what you’re stuck with.

NetMSG you can send from Client to Server ( Unfortunately no Client to Client yet, it needs to bounce off the server first ), Server can broadcast, or send to 1 client, or to a table of clients ( RecipientFilter doesn’t appear to work ).

It depends, you don’t need to convert your system from UMSG, but there are benefits to doing so. I would recommend changing out console commands you may be using though; at least the exploitable ones for sure!