Raised This Month: $32 Target: $400
 8% 

.cfg file max size?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-29-2007 , 06:29   .cfg file max size?
Reply With Quote #1

This might sound strange but it's the only conclusion I can come to, that config files have a max size?

If I remove any chunk from my cfg, it will exec correctly. Any chunk not just the top or the bottom but anywhere in the middle.
Otherwise, it outputs all the variables and says "Unknown Command:value" where value is the value of each of the variables in the script.

It sounds like a mis-matched quote but it works fine if I remove 4 lines from anywhere in the config!!!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-29-2007 , 06:41   Re: .cfg file max size?
Reply With Quote #2

Letter to hlcoders...


Mornin all,

I added a few new cvars to my plugin and duly added them to my config file. So today I noticed a weird problem, it seemed the cfg wasn't being executed when loading - as cvars were all at their default values.

So I exec var/mycfg.cfg in the server console and it ouputs a huge string.

Here's a snippet...

-----------------------------------------------
Unknown command "10"
"some_cvar1" = "0" ( def. "0.0" ) min. 0.000000 max. 1.000000
- The Description.
Unknown command "0"
"some_cvar2" = "1" ( def. "1.0" ) min. 0.000000 max. 1.000000
- Another description
Unknown command "1"
"some_cvar3" = "1" ( def. "1.0" ) min. 0.000000 max. 4.000000
- Description numero 3.
...etc etc the entire contents of the config file.
-----------------------------------------------

Now, to me this looked like a mismatched quote or something so I went looking through the entire thing and I found nothing, nothing at all.
Fast forward a couple of hours and I'm still desperately searching for a reason, and out of desperation I look at another very large config belonging to someone else and notice how it doesn't use Tabs to prettify the cvars and their values. So I do a mass replace of Tab with Space and low and behold, the damn thing works.

Now, just incase I had in-advertantly brought the file size down below my previous thoughts about a mysterious maximum size, I copied the entire contents and pasted them at the bottom of itself, and it still worked.


So, the point of this email I suppose is to ask why Tab causes such a problem in large config files? Remember, all those tabs worked fine up to a character limit...

Thanks,
Jason "c0ldfyr3" Croghan
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
BAILOPAN
Join Date: Jan 2004
Old 04-29-2007 , 21:21   Re: .cfg file max size?
Reply With Quote #3

HL2 reads every line of the config file and stuffs it into a giant buffer. Most likely you're reaching some sort of silly limit in this buffer...
__________________
egg
BAILOPAN is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 04-29-2007 , 21:48   Re: .cfg file max size?
Reply With Quote #4

But why would tabs be any different than spaces?
Keeper is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-30-2007 , 05:02   Re: .cfg file max size?
Reply With Quote #5

BAIL ya that's what I thought, but if you read the whole email it's not an actual limit, its' very very strange! The 'other persons' config I was talking about was Mani's and it's about 20 times as big as mine, but he doesn't use tabs and all was well.

I can copy and paste my config 10 times into itself as long as there are no tabs.

WEIRD I TELLS YA!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-30-2007 , 10:17   Re: .cfg file max size?
Reply With Quote #6

There is a secret gaben-cfg coding language consisting of only the whitespace characters. I suspect that it was developed specifically to create VAC2.

You've obviously created a syntax error by adding a tab in the wrong place.
L. Duke is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-30-2007 , 11:30   Re: .cfg file max size?
Reply With Quote #7

Quote:
Originally Posted by L. Duke View Post
There is a secret gaben-cfg coding language consisting of only the whitespace characters. I suspect that it was developed specifically to create VAC2.

You've obviously created a syntax error by adding a tab in the wrong place.
See it keeps getting stranger, I could just remove some text from the middle of a long comment to get it to work, so all the tabs were in the same place and it was working no problem.

Of course the hlcoders mailing list fell silent again with this one. To be honest that list has never given me any help, it's just a pack of whingers and arse lickers!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-30-2007 , 17:57   Re: .cfg file max size?
Reply With Quote #8

Excellent, Yahn mailed me off list, this was a bug with the source engine.
Quote:
Originally Posted by Yahn
Yeah, the engine's "line" parser wasn't tokenizing the tabs correctly.
I'll check in a fix for the next engine.dll update.

And after I thanked him..
Quote:
Originally Posted by Yahn
No problem. I'm also going to put in a fix for the bug where the ui would wipe all but one binding:
http://developer.valvesoftware.com/c..._bug.cgi?id=64
Pestering rawks!
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Keeper
Senior Member
Join Date: Nov 2006
Old 04-30-2007 , 18:33   Re: .cfg file max size?
Reply With Quote #9

I saw he had asked for "borked" cfg files. Glad this is getting done...
Keeper is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-01-2007 , 05:13   Re: .cfg file max size?
Reply With Quote #10

Quote:
Originally Posted by Keeper View Post
I saw he had asked for "borked" cfg files. Glad this is getting done...
I think I called it b0rked at the start not sure
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode