Net Message size

So if I were to send a netmessage to the client with the table like this


1:
		amount	=	-1
		itemName	=	-1
2:
		amount	=	-1
		itemName	=	-1
3:
		amount	=	-1
		itemName	=	-1
4:
		amount	=	-1
		itemName	=	-1
5:
		amount	=	-1
		itemName	=	-1
6:
		amount	=	-1
		itemName	=	-1
7:
		amount	=	-1
		itemName	=	-1
8:
		amount	=	6
		itemName	=	BANANA
9:
		amount	=	-1
		itemName	=	-1
10:
		amount	=	-1
		itemName	=	-1
11:
		amount	=	-1
		itemName	=	-1
12:
		amount	=	-1
		itemName	=	-1
13:
		amount	=	-1
		itemName	=	-1
14:
		amount	=	-1
		itemName	=	-1
15:
		amount	=	-1
		itemName	=	-1


How much data is that to send(kb or bytes) if you know, Or is there a way for me to find out?

I think oubliette’s DBugR will get net sizes



net.Receive("dumb", function(len)
    print(len)
end)


If this will just be numbers than try with WriteTable. I guess you want an inventory system. I already done that, basicaly when player comes on server I send a table of every items he has as Integers only. When the player is making a transaction with his inventory, I add to a temporary table the integer to add to the inventory/to remove, then when API function OnInventoryChanged(ply) is called, I send these temporary table and then I clear this temp table. Like that no need to send over 100 lines, it just sends the minimum requiered data to update inventory client side.

Next comes security, basicaly you don’t want CheatEngine to be able to add items to your client inventory and server able to read it, very simple to correct, just add an if block to know if player has the item he wants to drop in his serverside inventory. Then if it’s not the case, you can send email to yourself for example or BAN/Kick ! Myself I kick with a message that makes the user Raging !!!

If you know what the types are and how many there are going to be, use individual write/readwhatevers. Otherwise use write/readtable. Try and avoid sending tables through net messages, as they end up being really large.

15 string and 15 ints, Is that to much? xD

If only someone would accept meepen’s pull request for new WriteTable, it would be less expensive to send a table with a string than it would be sending a normal string via WriteString! Like, why on earth hasn’t this been accepted.

How about we get the super quick ‘hotfix’ actually released to fix the last damned patch first…