• Net message receipt order
    1 replies, posted
Do net library messages use TCP-like error checking, i.e. is it guaranteed [i]at all[/i] that players will receive messages in the order they were sent by the server, regardless of latency? I'm working on an addon where I need to send multiple messages due to potential overflows — and I need to make [i]absolutely sure[/i] that one message is sent before all the others. Can I rely on messages arriving in order, even with severe latency or packet loss, or am I gonna have to make some kind of horrible back-and-forth system to make sure stuff arrives when it's supposed to? [b]2015 EDIT FOR POSTERITY:[/b] acecool's response is wrong - net seems to use Source reliable streams, which means the order of [b]any[/b] net message sent on the server is the order they're received on the client - no matter how large they are, or even if they're different types. you can send single bits between random 60 KB strings, and the client gets them in the same order as the server sends them.
In a sense, yes and no... I did a quick test for you with debug mode on, and size display on SENDING packets.. For receiving packets, it shows up with a message Packet # x or y and a packet ID if it is a multi-part packet. You'll notice that I took several screenshots, sent them to the server and bounced them back to myself. Those are several part packages. You'll notice that while I'm sending the messages, other messages are coming through. So, the individual packets are actually sent all at once. But, other data can mix in between the larger packets because it takes longer for that data to send. Hope this helps... If you're sending multi-part packets, you need to give it some unique id which won't collide. Every message I send does arrive so you shouldn't need to worry about that. [lua]an Screen: Allows you to see what they're seeing to scan for cheats. Packet #: 1 Packet Count: 1 for packet id: receiving data: 1admin_stick_active_tool39 Packet #: 1 Packet Count: 1 for packet id: 146.5078125KB Packet #: 1 Packet Count: 1 for packet id: 177.400390625KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB Loading models/weapons/w_rif_m4a1.mdl Loading: models/roller.mdl Loading models/roller.mdl 0.0458984375KB Loading: models/extras/info_speech.mdl Loading models/extras/info_speech.mdl 0.046875KB 0.0458984375KB 0.046875KB 0.0458984375KB 0.046875KB Packet #: 1 Packet Count: 3 for packet id: +T:1036847930; C:817; S:server;- 0.0458984375KB Packet #: 2 Packet Count: 3 for packet id: +T:1036847930; C:817; S:server;- Packet #: 3 Packet Count: 3 for packet id: +T:1036847930; C:817; S:server;- [h] = 720 [w] = 1280 Packet #: 1 Packet Count: 3 for packet id: +T:1190863563; C:12206; S:SERVER;- Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse 0.0458984375KB Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsolefalse Packet #: 1 Packet Count: 1 for packet id: receiving data: 1inconsoletrue Packet #: 2 Packet Count: 3 for packet id: +T:1190863563; C:12206; S:SERVER;- Packet #: 3 Packet Count: 3 for packet id: +T:1190863563; C:12206; S:SERVER;- [h] = 720 [w] = 1280 [/lua]
Sorry, you need to Log In to post a reply to this thread.