Raised This Month: $51 Target: $400
 12% 

[L4D2] Display a message to client while they are downloading a file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ChrisP
Member
Join Date: Jan 2010
Old 03-09-2010 , 08:33   [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #1

I just learned how to send files to a client via AddFileToDownloadsTable, but I have come across a problem. In Left4Dead 2 when a client connects, it starts to load and then their screen just turns black when they begin downloading. It displays no message or gives any indication that it is downloading a file. As a result of their screen blacking out, I often see clients disconnect from the server because they think that their game has messed up, bugged out, or they think that there is something wrong with the server.

So my question is, in L4D 2 is there any way of displaying a message or opening the player's console while they download custom files through SourceMod?

-Chris

Last edited by ChrisP; 03-09-2010 at 08:36.
ChrisP is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 03-10-2010 , 14:51   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #2

Hi there, I don't have an answer for you, but I would like to know what thread or information on the AddFileToDownloadsTable() function.

Can you give me an example for L4D2?
bman87 is offline
ChrisP
Member
Join Date: Jan 2010
Old 03-12-2010 , 10:26   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #3

Here is a line of code from an experience mod me and a friend are working on. Notice this needs to be run OnMapStart for it to work properly everytime.
Code:
public OnMapStart()
{
    AddFileToDownloadsTable("addons\\xpmod_alpha01.vpk");
}
In addition to this, you probably want to have the proper setup on your server for the clients to download from a URL instead of from your host server's precious upload speed. It looks like you are but even if you are not hosting a server, you should include this information to the end user of your plugin, as they will be having their clients subjected to the same lameness I first posted about here. Having a fast redirect URL shortens the download time and consequently lessens the probability of a frustrated disconnect. I also suggest putting the redirected URL file into a .bz2 compressed file on your redirect.

Last edited by ChrisP; 03-12-2010 at 10:32.
ChrisP is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 03-12-2010 , 11:05   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #4

Quote:
Originally Posted by ChrisP View Post
Here is a line of code from an experience mod me and a friend are working on. Notice this needs to be run OnMapStart for it to work properly everytime.
Code:
public OnMapStart()
{
    AddFileToDownloadsTable("addons\\xpmod_alpha01.vpk");
}
In addition to this, you probably want to have the proper setup on your server for the clients to download from a URL instead of from your host server's precious upload speed. It looks like you are but even if you are not hosting a server, you should include this information to the end user of your plugin, as they will be having their clients subjected to the same lameness I first posted about here. Having a fast redirect URL shortens the download time and consequently lessens the probability of a frustrated disconnect. I also suggest putting the redirected URL file into a .bz2 compressed file on your redirect.
Thank you!

I am just trying to add custom sounds to my server, I can host them as bz2 on my webhost. Should be quick enough I don't need to worry about the black screen.
bman87 is offline
Knappy
Member
Join Date: Feb 2010
Location: Apophis
Old 03-22-2010 , 23:57   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #5

Have we made any progress with this?
Knappy is offline
demarcelo
Junior Member
Join Date: Dec 2008
Old 04-10-2010 , 09:10   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #6

Hello friends I have a server and l4d2 VPK can not send files to clients, did the commands that are on this topic, most was not the file to the client what am I doing wrong?
demarcelo is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 09-25-2018 , 15:27   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #7

any progress with this ?
HarryPotter is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-25-2018 , 18:51   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #8

Quote:
Originally Posted by fbef0102 View Post
any progress with this ?
Lmao.

Nice necromancer skills raising a dead thread from 8 yeaes ago.
__________________
Neuro Toxin is offline
dustinandband
Senior Member
Join Date: May 2015
Old 09-25-2018 , 23:14   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #9

Please answer before thread gets locked - as it would be neat to know and something I’ve been curious about for a while now.

Some people say you can’t force clients to DL files in L4D2 anymore - but I know the ‘Mega Survival’ servers tied to the official Sourcemod steam group can do it - similarly to how OP described. So is the function ChrisP described OnMapStart still the preferred method? (I’m on mobile can’t copy it).

Tested on June 7 of this year - https://m.youtube.com/watch?v=eWrRiM...ature=youtu.be
dustinandband is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 09-25-2018 , 23:25   Re: [L4D2] Display a message to client while they are downloading a file?
Reply With Quote #10

Why would this thread get locked?

As far as I know, files like models and materials can be downloaded and used by clients. They'll still get that black screen though but I think MasterMind420 came up with a fix awhile back (I'm not sure if it's still relevant/working though).

For VPK files, I believe that clients can download them but they would have to restart their game to mount the custom content into their game. It's not like workshop mods where you simply subscribe and the game mounts the content right after downloading it in the main menu.
__________________
Psyk0tik 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 17:06.


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