I'm sorry if this has been asked before, but are you replacing usermessage with the net library as well?
I'm sorry if this has been asked before, but are you replacing usermessage with the net library as well?
He's keeping the usermessage library as far as I know.
edit: But removing datastream
I was wondering this, is the net library faster for short messages as well? Or should we continue to use usermessages for that?
I don't know if the are faster but they have an increased max data limit.
He said somewhere that they're sent instantly, whereas user messages are sent on frame updates. (afaik)
I also suspect that a lot of small net messages will lag less than a lot of small umsgs, which will be nice.
Incidentally, has the NWVar system been moved from umsgs to this new system?
Post #46
By the way I couldn't find this in the thread anywhere, but the net.Receive callback is actually also gives another variable, which is a table:
The sending player and something else?Code:1 = Player [1][[RV] TJjokerR] n = 1
The n probably means the number of variables send.
No matter how many variables I send it stays at 1.
Updated my post sorry, what I meant is that it's given a table which contains 2 variables. The player and "n", which always seems to be 1.
Post whatever code relies on usermessages or datastream and i could convert it to use the net library if you want. It's actually really easy.
It's a bit redundant seeing as the net library is basically like usermessages 2.0, but if usermessages were removed it would probably break every older script that sends things to clients. So usermessages will be there for legacy support more or less.
So can I use RecipientFilter here or is there some sort of filtering thing I missed
Pfff, RecipientFilter was cooler
Are there any future plans to make it use RecipientFilter? Or is there a way to get members of a RecipientFilter? I'm planning to make usermessages and datastream use the net library and they both can take them in.
From what I saw earlier today it's still there, but I haven't tested it yet. I think Drakehawke came to the conclusion that it didn't though
I'd just override the recipientfilter metatable to store added players so you can get them later.
Ah shit you're right, I'm not thinking straight, thanks!
Will it support PVS and PAS? Maybe net.SendPVS() and net.SendPAS()?
It already does support PVS.
check the comments on my profile, twoski put a dump of the net library there, PAS and PVS are implemented
(thanks twoski)
And PAS
![]()
Excellent.
Im Currently Working On The Wiki Page If Anyone Wants To Help
http://wiki.garrysmod.com/?title=Net
I know PVS, but what is PAS?
PVS and PAS, what are they both?
PVS is what you can see from that spot, PAS is what you can hear from that spot
Oh my god. You just made me cum a little.
This is amazing.
Programming in Lua: 19.1 - Array Size posted:
Would anyone know what would cause the following behavior?
Net lib wont start sending messages (from server) until I execute sv_allowdownload 1 in server console. This was tested in both listen and dedicated, where download was allowed in both upon start-up of the server.
net.Send( ply ) sending net message to all players on server? ply being one player entity.
I'm just wondering if anyone is experiencing anything similar while I continue to comb my gamemode for anything I have done incorrectly.
edit:
This actually just seems to affect the first player that connects, subsequent players start receiving net messages, but messages sent to a single player still seem to be broadcasted.
Sending a Table that contains a Table in Net lib causes the sub table to be sent as a number (258)
Also seems to not send empty tables {}, can be annoying when sending tables structures.
Sends as a different number for me, I think it's taking a character from the key string and converts it to the numerical code.
Didn't report it as Garry said he was still working on it.
Yes. I figured that out, but when I:
- SetType on the server (for a table)
- read the byte on the client to check if it's a table and then net.ReadTable() it should work fine, instead it breaks at the recursive table where it gets a larger number as an index for the net.ReadVars then it should be.
It's late, so sorry if that didn't make sense.
I have two net messages that are sent to the clients by the server.
Here's the code I'm using to call them:Code:net.Receive("UpdateRoundInfo", function(size) ROUND_TIME = net.ReadFloat() ROUND_NUMBER = net.ReadFloat() print(ROUND_NUMBER) end) net.Receive("StartRound", function(size) ROUND_TIME = net.ReadFloat() ROUND_NUMBER = net.ReadFloat() RoundStart() print(ROUND_NUMBER) end)
The net message SHOULD be sent, because the server prints both A and B when they should be called.Code:if ROUND_NUMBER == 0 and #player.GetAll() >= MINIMUM_PLAYERS then net.Start("StartRound") net.WriteFloat(ROUND_TIME) net.WriteFloat(ROUND_NUMBER) net.Broadcast() RoundStart() print("A") else net.Start("UpdateRoundInfo") net.WriteFloat(ROUND_TIME) net.WriteFloat(ROUND_NUMBER) net.Broadcast() print("B") end
The client prints the round number (So it is receiving) "UpdateRoundInfo", but "RoundStart" is never called.
I've tried printing "HI" and stuff like that, so it's not a matter of ROUND_NUMBER being nil.
No errors or nothing it's driving me absolutely insane, plus I can't even check the Wiki since it decided to go down for a few hours.
My problem is similar Kopimi,
May not be related but try issuing sv_allowdownload 1 on the server console, before sending begin round net message. I found doing this (or reconnecting) tended to make the unsent net messages suddenly start sending/receiving.
Learn to spell receive please. I recreated the page Net.Receivebecause you had plenty of typos that would confuse people as to why net.recieve wouldn't work.
Also I improved your example.
It also doesn't only take a unique identifier as it's argument. It takes an identifier and a function, just like usermessage.Hook. It doesn't return a number either.
Those inconsistencies tend to bug me...
Cleaned up the page a bit more.
on net.Receive serverside, is there a way to know from which client the message originated? That would be good to know