Filesize error for custom scripts

Report any bugs you find using HLDJ
Post Reply
Toad King
Game DJ
Posts: 5
Joined: Mon Jul 12, 2010 3:39 am

Filesize error for custom scripts

Post by Toad King »

This bug looks similar to, but not identical to the bug in this topic.
I've found that when I run the program with admin privileges (so it makes file links instead of copying the audio files), it also makes file links for the custom scripts. However, when TF2 tries to execute these scripts, either on startup or through "exec [SCRIPTNAME]", it gives this error:

Code: Select all

exec hldj_custom.cfg: file size larger than 1 MB!
(I can assure you the file is not that large.)
Playing audio without using custom scripts still works fine, and if I put the binds/aliases of my script in manually, they work perfectly. Also, if I run HLDJ without admin privileges so it copies the files instead, the script runs fine and everything's okay, other than the longer times to copy large audio files. This looks like it's just a problem with Source not handling file links for scripts correctly.

EDIT: I'm using 1.6.0a9.
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: Filesize error for custom scripts

Post by Renegade »

I've noticed it too and am pretty sure it's a Source quirk. From the topic you linked, I had concluded it occurred with empty scripts (although in the linked topic, they were empty due to a bug); however it's interesting that this happens even if your hldj_custom.cfg constains commands. The important thing is that it still executes those commands, but I'll keep an eye on it. If it poses a problem, I'll copy hldj_custom instead of linking it.

Also, just to confirm for alpha9 purposes, HLDJ now works in every case, even if not running as admin?
A few curious things:
* if symbolic linking fails, it should attempt to hardlink (with copying being the last resort). I'm hoping this is what it did. You can tell if it is a hardlink if you make changes to your hldj_custom.cfg and those changes appear in the hldj_custom.cfg located in the game folder. If not, is your HLDJ located on a different drive than Steam?
* Do you have Administrator permissions on your system?
Toad King
Game DJ
Posts: 5
Joined: Mon Jul 12, 2010 3:39 am

Re: Filesize error for custom scripts

Post by Toad King »

When running without admin privileges, everything works perfectly.

I've noticed when running HLDJ, Exlporer says the size of the symbolic linked files is 0kb, so that might be what's triggering this Source bug. It's not that the symbolic linking fails, it's that Source thinks the size of symbolic linked files is 0 and doesn't run the commands in hldj_custom.cfg. If this only includes keybinds, you only really need to run this script once and it doesn't matter that it fails after that, but my script includes aliases, which need to run every time.

The two directories are on different drives, so hard linking should fail if it ever tries to do it.
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: Filesize error for custom scripts

Post by Renegade »

So it doesn't execute the commands when hldj_custom.cfg is symbolic linked? In that case it is a problem.
If you open the created link in notepad, does it correctly display the contents of your hldj_custom.cfg? As long as the link isn't broken, the game should really only see the target file, but if is causing problems, then I will copy it instead.

I'm not sure why symbolic link privileges are being denied (if you are an admin), but one thing you can try to avoid having to run-as-admin all the time is: http://www.informit.com/guides/content. ... seqNum=762

Another suggestion is to place HLDJ on the same drive as your games so you can benefit from hardlinks, which are probably even (negligibly) faster than symbolic links.
Toad King
Game DJ
Posts: 5
Joined: Mon Jul 12, 2010 3:39 am

Re: Filesize error for custom scripts

Post by Toad King »

The symbolic links are being made okay, and I can open them up just fine and they display the contents of the script fine in Notepad. It's just that Source gives that 1 MB file error when I try to execute the symbolic linked scripts, so I think copying over the custom script when a hard link can't be made should fix the problem.
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: Filesize error for custom scripts

Post by Renegade »

That also explains why the problem doesn't occur on my XP machine (hardlinks only). But to confirm: when it symbolic links the script, the game does not execute any of the commands contained in it (i.e. if you defined any aliases, they are not present in the game)?
Toad King
Game DJ
Posts: 5
Joined: Mon Jul 12, 2010 3:39 am

Re: Filesize error for custom scripts

Post by Toad King »

That's correct. The couple of aliases that my binds use are not made.
Renegade
HLDJ Developer
HLDJ Developer
Posts: 1500
Joined: Sat Mar 01, 2008 2:02 pm
Contact:

Re: Filesize error for custom scripts

Post by Renegade »

ok, this should be fixed now in alpha 10. Let me know if it isn't.
Toad King
Game DJ
Posts: 5
Joined: Mon Jul 12, 2010 3:39 am

Re: Filesize error for custom scripts

Post by Toad King »

Looks like it's fixed in alpha 10. Thanks for the fast fix.
Post Reply