• A question about net library.
    8 replies, posted
I'm using the net library for quite a while now, but I was always wondering how does it affect the server performance. For example, how much time ( lets say per second ) can I use net messages between server and client or vise versa without actually making the server laggy because of constant communication? Cheers.
[QUOTE=Konth;43369140]I'm using the net library for quite a while now, but I was always wondering how does it affect the server performance. For example, how much time ( lets say per second ) can I use net messages between server and client or vise versa without actually making the server laggy because of constant communication? Cheers.[/QUOTE] More about what data you send in them really.
[QUOTE=Pantho;43369218]More about what data you send in them really.[/QUOTE] Mostly short strings and floats; Should I be concerned about using them to often?
[QUOTE=Handsome Matt;43379655]Obviously sending net messages in a think hook is going to cause lag. Tell us what you intend to send and we can probably come up with the most optimized solution to it.[/QUOTE] Basically I'm working on a guild system, one of the perks is that 15% of the money you get goes to the guild bank, the thing is that I need to update the guild bank value on clientside of all the guild members( to display it when they open the guild gui for example ). I tried to using shared tables but once they're edited on serverside the clientside can't see them. So I ended up using net message to do that, but it sounds rather laggy that when someone in a guild gets money then it needs to send a net message for every single member of the guild.
[QUOTE=Konth;43388974]So I ended up using net message to do that, but it sounds rather laggy that when someone in a guild gets money then it needs to send a net message for every single member of the guild.[/QUOTE] You're seriously overestimating the performance cost of this.
Quick question on the topic of Net Library, so I don't need to make a new thread: I have a weapon that sends information to the client, both in a shared file (I used this to allow me to use the stencils). The code is simple and works flawlessly in single player, but in multiplayer it gives me the error: [code][ERROR] addons/weaponpack/lua/weapons/weapon_telekinesis/shared.lua:284: attempt to call field 'Send' (a nil value) 1. unknown - addons/weaponpack/lua/weapons/weapon_telekinesis/shared.lua:284 [/code] code: [code] net.Start("TelekHalos") net.WriteEntity(self.Owner) net.WriteString("1") net.Send(self.Owner) --this is line 284[/code] Why does it not like this in multiplayer?
Sorry, you need to Log In to post a reply to this thread.