gmsv_networkstringtables

This dll allows you to change values of network string tables and also change their sizes.

Garry talks about network string tables here:
http://www.garry.tv/?p=581
And http://bugs.garrysmod.com/view.php?id=1001

Example:
[lua]
require(“networktables”)

// Sizes must be a power of 2.

NetTbl.DumpInfo(“modelprecache”)
NetTbl.SetTableSize(“modelprecache”, 8192)
NetTbl.DumpInfo(“modelprecache”)
[/lua]

Functions:
[lua]
NetTbl.GetTableNames() // Returns a table containing all the names of network string tables
NetTbl.GetTable(Tablename) // Returns a the networkstringtable’s members
NetTbl.SetTableMember(Tablename, Name, Userdata) // Sets a networkstringtable’s member
NetTbl.DumpInfo(Tablename) // Dumps some info about the table to console
NetTbl.SetTableSize(Tablename, Size) // Changes the tables max string count.
[/lua]

Download(includes source, binary and lua script):
http://solidfiles.com/info_imgs/Ol2L.jpg

AKA 8X more props are allowed? Nice.

8x different models can be spawned within the time the map starts and ends.

Is there much, if any risk in increasing the size? Or is it purely benificial?

In the LuaStringTable problem the table has never actually been full when the crash has occured.

Actual error: Host_Error: Overflow error writing string table baseline LuaStringTable.
Rough translation: Overflow error while writing a string to table LuaStringTable?

Guess 1: Writing too long string
Guess 2: Tries to write to the end of the table(array?) where no space exists, but there are unfilled slots?

If it’s the latter this might even help to an extent. I am definitely going to try this.

Only if the string is larger than 4kb. Which I doubt it is.

Very useful! Garry should add this to the code of Garry’s Mod! XD

The translation is more like Overflow error when writing to stringtable LuaStringTable, this happens when the table is full and you are writing something into the table.

I don’t think this fixes the problem, the table size doesn’t change on the client…

Well only the server crashes, so does it really matter?

I get a error message after the game is closed. And i get a 5 MB big crash log file.
(they are usually 80 - 400 KB small)

The crash log download link: http://www.mediafire.com/?qmmctndmzrd

The text of the error message is:
“The Output “unknown software exception” (0xc0000005) is in the application at 0x380db3a0 was occurred.”

This was a German text and I have translated it to English, the German text is:

“Die Ausgabe “unknown software exception” (0xc0000005) ist in der Anwendung an der Stelle 0x380db3a0 Aufgetreten.”

After much testing, Azu is exactly right.

This does change the table on the server which is great, except client DO still crash when THEY get to the default limit.

This entire thing is defined in the engine.dll which means that you have to include the methods to network the table size to the client or create a client module also, but of course many won’t download a client module and there’s no way a server owner can force that so you need to make it network the new values to the client.

My server has over 1024 models in the modelprecache table and is fine but my client crashed.

Of course it matters when the clients crash which is worse than just the server crashing.

This is entirely situational. If the gamemode isn’t competitive, eg, the player doesn’t lose anything for crashing, then the server is more important. Typically an RP / Sandbox gameode server is what matters, the clients can leave and join as much as they want. Especially if the server dies before people have a chance to come back.

On the other hand, if the gamemode is competitive, the client crashing is a lot worse since they lose out.

Of course, if the server is a listen server, the issue still exists that a client crashing could be fatal.

Does listen servers crash when the limit of the client’s table is reached?

I don’t know about the server itself, but the client can still crash. Listen Server host is a client.

Umm… you realize the server crashing without being able to save anything is ALWAYS worse in this case as a client reconnecting would instantly crash when trying to load entities and filling up the table yet again.

Either way the table is going to have to be increased on the client as well, maybe garry can use this code to change the table sizes for the client and server.

**EDIT: **So I was looking through your source code… most of the crap in there isn’t even used.

And what is with this: netTbl->a

Those don’t exist, why are you hiding things?

Ahh whoops, forgot to include the modified interface.

This just opens up access to those members.



class INetworkStringTable
{
public:

	virtual					~INetworkStringTable( void ) {};
		
	// Table Info
	virtual const char		*GetTableName( void ) const = 0;
	virtual TABLEID			GetTableId( void ) const = 0;
	virtual int				GetNumStrings( void ) const = 0;
	virtual int				GetMaxStrings( void ) const = 0;
	virtual int				GetEntryBits( void ) const = 0;

	// Networking
	virtual void			SetTick( int tick ) = 0;
	virtual bool			ChangedSinceTick( int tick ) const = 0;

	// Accessors (length -1 means don't change user data if string already exits)
	virtual int				AddString( bool bIsServer, const char *value, int length = -1, const void *userdata = 0 ) = 0; 

	virtual const char		*GetString( int stringNumber ) = 0;
	virtual void			SetStringUserData( int stringNumber, int length, const void *userdata ) = 0;
	virtual const void		*GetStringUserData( int stringNumber, int *length ) = 0;
	virtual int				FindStringIndex( char const *string ) = 0; // returns INVALID_STRING_INDEX if not found

	// Callbacks
	virtual void			SetStringChangedCallback( void *object, pfnStringChanged changeFunc ) = 0;

	int						a;
	char					*b;
	int						c;
	int						d;
};


Also the crap that isn’t used is just apart of my base dll setup, which allows me to hook into anything in the source engine.

Sorry for this bump, but do you want make a fix for clients?

ehm I got a small question, I just tryede to run this on a local dedicated server. I spawned so many props that my precachetable was on 1448 on the server, same goes for the client.

So my question is, why did en I crash? Do I need to “use” the models before the client actually precache em?

Also, my client model precache says it is 8192 “cl_precacheinfo modelprecache”