PIPE - Experimental Networked Variables

[release][tab]Name:[/tab] PIPE

[tab]Version:[/tab] 1

[tab]Description:[/tab] Creates a second network connection to the game server, which is dedicated to networked variables.

[tab]Requirements:[/tab] All Clients Need gm_luasocket - http://www.facepunch.com/showthread.php?t=495940

[tab]SVN:[/tab] http://gmod-haza.googlecode.com/svn/trunk/PIPE/[/release]

**This is experimental and is only for ADVANCED server admins and developers**

How does this work?
When a client connects to the game server with PIPE installed, an additional TCP connection is created, all networked variables are then sent over this connection instead of the main game connection.

What are the benefits of this?
At the moment, source parses the network packets in a single thread. This is fine, but when you start sending down large amounts of data it starts to get congested.

Even though PIPE runs on the same thread as the game, the networked variables are no longer mixed in the same packet Que. This ensures that physics data etc are processed with more priority, the data packets are smaller and can get ordered faster.

By reducing the extra data strain on the main game connection, we eliminate the main cause of Reliable Buffer Overflow errors.

What does the client need?
Each client that connects to a server with PIPE on it, must install the gm_luasocket.dll addon by Anders1.

What does the server need?

  • The gm_luasocket.dll addon by Anders1.
  • The PIPE addon.
  • Custom settings in addons/PIPE/lua/pipe/pipe_sh.lua

What settings do I need in pipe_sh.lua?
The IP must be the same as the game server.
The port must be ** different** from the game server. Eg Game server port is 27015, PIPE port is 27020.
[lua]const_ServerIP = “”;
const_BindPort = 27080;[/lua]

This is awesome.

This is cool but limited as clients must have the module.

Sure. But Im sure garry might include it if Anders1 contacts him

I’d really like to see this implemented in GMod.

This is very nifty, well done.

garry needs to add this to GMod.

Great for those huge servers, especially the RP ones. They always have RBO errors… It’s part of the reason I no longer RP

This is what we need in GMod, this would speed up things a lot.

Emailed garry.

Released 4 hours ago and should already be added to GMod instead of stuff like renderx? And this would require Garry to add some form of sockets which arises questions whether this is safe or not.

They’re suggesting garry add the gm_luasocket.dll module to Gmod ( http://www.facepunch.com/showthread.php?t=495940 ) released over a year ago.

Um… no? I didn’t say immediately, I said it might be something to look at.

I believe renderx should be added too but all I did was recommend this. Why would it not be safe?

edit: above is basically it

“Emailed to garry”: Really looked like you wanted it immediately, I was wrong :slight_smile:
Not safe if servers can make you connect wherever they want. This needs some hacking or it’s not safe. Can still be done though. Let’s just not rush it like with datastream.

Where are they gonna connect you to harmfully?

I agree.

Although the same concerns could be raised with the HTTP ability in GMod.

Perhaps gm_luasocket could be restricted to connect to the currently connected game server only, otherwise the user is prompted to see if they want to allow it.

I haven’t tested it yet, but by looking at your code, I believe this also allows you to send networked tables, thanks to the usage of glon.


Comments? Was this done on purpose, am I wrong, or is this an inadvertent side-effect of using glon?

Also, it needs to override SetGlobal<var type>, too.

If my datastream got added to Garry’s Mod, this sure as hell needs to be.

Yes because opening sockets on the server is really unsafe for clients…


(User was permabanned for this post ("Flaming; breaking rules on an alt" - mahalis))

Me and Kogitsune agree that garry needs to add code signing so we can send modules over just like AddCSLuaFile, but only if it is signed by garry. It wouldn’t be a hassle, considering there are only 20 or so modules released.


When you loaded this page, you opened a socket on your computer. Oh noes, we need to call the FBI, all web browsers have a huge security flaw in them /sarcasm