Raised This Month: $ Target: $400
 0% 

[EXTENSION] Late Downloads


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GHartmann
Junior Member
Join Date: Feb 2018
Old 02-12-2018 , 13:50   Re: [EXTENSION] Late Downloads
Reply With Quote #1

This is pretty neat, wasn't aware it was possible!

I built it against TF2 with a few small changes:

Code:
179c179
<                       resendSuccess = chan->SendFile(activeDownload.filename, g_TransferID++);
---
>                       resendSuccess = chan->SendFile(activeDownload.filename, g_TransferID++, false);
301c301
<                       if (chan->SendFile(filename, g_TransferID)) {
---
>                       if (chan->SendFile(filename, g_TransferID, false)) {
334c334
<                               g_ActiveDownloads.Remove(g_ActiveDownloads.Count() - 1);
---
>                               g_ActiveDownloads.RemoveMultipleFromTail(1);
413c413
< }
---
> }
\ No newline at end of file
And tested it in-game, downloaded the text file.
Seems like this would be very useful for downloading non-essential files.

Edit: Actually, it seems it adds the files to the download list for new clients connecting, which means anyone connecting after a late download is added will still have to sit through the downloading of files. Wonder if there's a way around that?

Last edited by GHartmann; 02-12-2018 at 15:16.
GHartmann is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-14-2018 , 17:34   Re: [EXTENSION] Late Downloads
Reply With Quote #2

Quote:
Originally Posted by GHartmann View Post
I built it against TF2 with a few small changes
...
Thanks, I've added these changes into the source!

Quote:
Originally Posted by GHartmann View Post
Actually, it seems it adds the files to the download list for new clients connecting, which means anyone connecting after a late download is added will still have to sit through the downloading of files. Wonder if there's a way around that?
Yep, during the "latedl call", the file is also added into the download table (see function AddStaticDownloads). The reasoning behind this behaviour is simple - some player might connect while everybody else is getting the ingame download.
I might add a boolean parameter for cases when you don't need file consistency amongst the players and one more native for file removal from the download table. I'm curious - what exactly is your use case? How the fact that some players doesn't have the needed files doesn't break their experience?
__________________
Sorry for my english.
Backup is offline
GHartmann
Junior Member
Join Date: Feb 2018
Old 02-14-2018 , 18:11   Re: [EXTENSION] Late Downloads
Reply With Quote #3

Quote:
Originally Posted by Backup View Post
what exactly is your use case?
My thought was, you could have certain files that aren't required download in the background so new players joining the server won't have to sit through all those files being downloaded.

For example as a donor perk on a server I play on, each player has a texture that floats above their head at the end of the round. These sorts of files would be fine to load as needed in the background since they aren't essential for players to have.
GHartmann is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 02-15-2018 , 15:22   Re: [EXTENSION] Late Downloads
Reply With Quote #4

Quote:
Originally Posted by GHartmann View Post
My thought was, you could have certain files that aren't required download in the background so new players joining the server won't have to sit through all those files being downloaded.

For example as a donor perk on a server I play on, each player has a texture that floats above their head at the end of the round. These sorts of files would be fine to load as needed in the background since they aren't essential for players to have.
I've added parameters that can enable this behavior (set addAsStatic to false).

I'm not sure what the players that won't download the texture will see, my guess is pink-black checkerboard and console full of errors. Some network entity filtering should solve this quite easily tho.
__________________
Sorry for my english.
Backup is offline
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 11:56.


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