• Net.Send - what's really the size limit?
    4 replies, posted
Hi coders :smile: I've been learning how to use the Net library in my code. I'm trying to enter text on the client and have it received by the server. This works even for long strings, however upon sending the same string back to the client I am getting a silly error saying the server refuses to send the net message because its 256 bytes whereas the limit is 255... Am I really stuck behind a really small character limit? What ways do I have of getting around it? [URL]http://wiki.garrysmod.com/page/Using_the_net_library[/URL] According to this the limit is 64kb... but given the state of the wiki who knows what that means, it certainly doesn't explain it in any amount of detail Thanks!
I think it's 64KB in total, not only for one net.WriteString() but for it used few times or used with others like WriteTable(), WriteEntiy() etc.
Thanks! I was doing something wrong, got it now. Can you tell me; I've got this code: [CODE] net.Receive("clienttoserver", function(len, ply) local nick = ply.Nick() local message = net.ReadString() message = (nick .. " has made a post: " .. message) net.Start("servertoclient") net.WriteString(message) net.Send(ply) end)[/CODE] but the ply.Nick function is not working, i get 'tried to use a null entity' What am I doing wrong?
ply:Nick() Make sure to check if the ply entity is valid with IsValid
[QUOTE=ms333;41742323]ply:Nick() Make sure to check if the ply entity is valid with IsValid[/QUOTE] I know - I should have that check in there, but it's not valid, its null, that's my problem... shouldn't the net.Receive pass ply on to its function? You can see I've use ply on line 8 to specify which client to send the "servertoclient" string to, and that works I don't really understand how to the ply entity works, to be honest, I've always just used it this way without issue EDIT: oh DERP I used a fullstop instead of a colon /facepalm Thanks :D
Sorry, you need to Log In to post a reply to this thread.