![]() |
|
Suggestion - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Suggestion (/thread-2511.html) |
Suggestion - 4N0NYM - 18-11-2017 Suggestion : net.canSend() for Server and Client side. RE: Suggestion - Kosmos - 19-11-2017 Unfortunately it's not that simple for net. On the client, this is just Code: net.bytesWritten() < net.quotaMax() - net.quotaUsed()Because quota is now counted by player, if you intend to broadcast you must check if you could send the message to every player. Note: net.quotaUsed now takes a player argument on the server to get quota for sending to them (see the starfall docs for more info). Bottom line, you should examine the quota you have left (which you should calculate yourself) to only send packets that are small enough. Note: Net messages also have a header, if you want to be precise you should check how much quota that uses. |