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

How to Force download of multiple files with one http connection


Post New Thread Reply   
 
Thread Tools Display Modes
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 03-06-2010 , 23:44   Re: How to Force download of multiple files with one http connection
Reply With Quote #11

The engine wouldn't be able to know if files on your pack are on client or not. It'd be download every time player connects (even map changes). You'd make it worse for the player.
Sammy-ROCK! is offline
Cooltad
Veteran Member
Join Date: Apr 2008
Old 03-07-2010 , 05:27   Re: How to Force download of multiple files with one http connection
Reply With Quote #12

Ah well. Well I at least am curious as to why on some servers all the files in the download tables seem like they all get downloaded in one sweep(one loading bar), while on mine, it seems to go one at a time with the white loading bar.
__________________
Please, give me some rep if you found what I posted useful. :]
Cooltad is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-07-2010 , 06:23   Re: How to Force download of multiple files with one http connection
Reply With Quote #13

Just use sv_downloadurl and any http server for storing files.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Cooltad
Veteran Member
Join Date: Apr 2008
Old 03-07-2010 , 07:31   Re: How to Force download of multiple files with one http connection
Reply With Quote #14

I do, actually. That's the strange part about it.
__________________
Please, give me some rep if you found what I posted useful. :]
Cooltad is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-07-2010 , 07:53   Re: How to Force download of multiple files with one http connection
Reply With Quote #15

Then I am almost sure that it doesn't work for some reason. Ensure that on the http server all files are placed relatively to mod-dir folder (/material/my_file.vmt but NOT cstrike/material/my_file.vmt). Also check that all files are available for public access.

p.s. or just post your link to http server
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Cooltad
Veteran Member
Join Date: Apr 2008
Old 03-07-2010 , 08:42   Re: How to Force download of multiple files with one http connection
Reply With Quote #16

I fixed the issue, it was a chmod issue.

Anyways;
Something discussed before but never explained:

Why is it that even though I use PrecacheSound(sounde1, true);
The client always has to restart their tf2 in order to play the custom sounds.

For some reason it doesn't work the first time around, ever. I would really like to know any possible solution to this. The sounds download just fine, it's just some type of caching issue where the user needs to restart tf2 to use the sounds.

EDIT:
I also need to know:
When you write a pack cell to unpack later via a timer, if it is a repeating timer, does the pack cell merely write the data that was true at the time of packing, or is it more of a link-type thing, where the data can be checked using the timer?
__________________
Please, give me some rep if you found what I posted useful. :]

Last edited by Cooltad; 03-07-2010 at 09:42.
Cooltad is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-07-2010 , 12:28   Re: How to Force download of multiple files with one http connection
Reply With Quote #17

Quote:
Originally Posted by Cooltad View Post
I fixed the issue, it was a chmod issue.

Anyways;
Something discussed before but never explained:

Why is it that even though I use PrecacheSound(sounde1, true);
The client always has to restart their tf2 in order to play the custom sounds.

For some reason it doesn't work the first time around, ever. I would really like to know any possible solution to this. The sounds download just fine, it's just some type of caching issue where the user needs to restart tf2 to use the sounds.
I've never experienced such problem. When do you precache sounds?
Quote:
Originally Posted by Cooltad View Post
I also need to know:
When you write a pack cell to unpack later via a timer, if it is a repeating timer, does the pack cell merely write the data that was true at the time of packing, or is it more of a link-type thing, where the data can be checked using the timer?
According to the name ("Datatpack") it only stores data itself and never any references (link). All data is held in the datapack until it closed via CloseHandle.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Cooltad
Veteran Member
Join Date: Apr 2008
Old 03-07-2010 , 12:34   Re: How to Force download of multiple files with one http connection
Reply With Quote #18

I figured for the second one.

And for the first one, you can only notice it if you set an event to play a sound, and you make sure you have never downloaded said sound before. When you go onto the server, you'll find the sound not working until you restart tf2.

I precache on map start, with preload being true. (it being false didn't affect the bs first-time-playing sound issue).
Code:
new String:sounde1[PLATFORM_MAX_PATH]    = "t3clan_custom/enter_server5.mp3";

public OnMapStart()
{
    decl String:buffere1[PLATFORM_MAX_PATH];
    Format(buffere1, sizeof(buffere1), "sound/%s", sounde1);
    AddFileToDownloadsTable(buffere1);
    PrecacheSound(sounde1, true);
}

public OnClientPostAdminCheck(client)
{
    if (IsClientInGame(client) && !IsFakeClient(client))
    {
        EmitSoundToClient(client, sounde1, SOUND_FROM_PLAYER, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, 0.8);
    }
}
Once again, I must note this issue disappears after you quit tf2, then start tf2. I believe it has to do with tf2 scanning the /tf/ directory in your steamapps and seeing what files to cache.
Though I thought precaching would do that; it doesn't.
__________________
Please, give me some rep if you found what I posted useful. :]

Last edited by Cooltad; 03-07-2010 at 12:36.
Cooltad is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-07-2010 , 12:44   Re: How to Force download of multiple files with one http connection
Reply With Quote #19

Well, emitting sound OnClientPostAdminCheck isn't the best idea. This forward may be called during player connection when player didn't actually join a server. Try move your code into the OnClientPutInServer (i'm still not sure about this but try).
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
toazron1
Senior Member
Join Date: Oct 2006
Old 03-07-2010 , 21:41   Re: How to Force download of multiple files with one http connection
Reply With Quote #20

PostAdminCheck is better to use, and is called after PutInServer
__________________
toazron1 is offline
Send a message via AIM to toazron1
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 16:10.


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