Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 6 7 8 9 10 … 18 Next »
Suggestion
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Suggestion
18-11-2017, 11:40 PM,
#1
4N0NYM Offline
absens
****
Posts: 561
Threads: 211
Joined: Dec 2014
Suggestion
Suggestion : net.canSend() for Server and Client side.
Find
Reply
19-11-2017, 10:54 AM,
#2
Kosmos Offline
GMod Admin
Posts: 180
Threads: 3
Joined: Dec 2013
RE: Suggestion
Unfortunately it's not that simple for net. On the client, this is just
Code:
net.bytesWritten() < net.quotaMax() - net.quotaUsed()
However, on the server it depends on how many people you send the message to (which you only know after sending).
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.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.