Forcing a client to download a map

Post Reply
peterparker
New to forums
New to forums
Posts: 4
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 12, 2012 9:03 pm

Forcing a client to download a map

Post by peterparker »

Alright, so I've set up a forceDL file, and custom content like materials/models download flawless, but maps simply will not download for the client and they get disconnected. I've used resource.AddFile("maps/rp_townsend_v2.bsp") in my forceDL file and it STILL does not download, even though the rest of the files do. I have sv_allowdownload and sv_allowupload set to 1 and my net_maxfilesize set to 600. If anyone knows what the problem is, please tell me because I couldn't get this file to download for clients if my life depended on it.
Kropp
A regular
A regular
Posts: 48
Joined: Mon Apr 02, 2012 1:10 pm
Location: Canada, British Columbia
Contact:

Re: Forcing a client to download a map

Post by Kropp »

I think I have a fix for you.

Code: Select all

if SERVER then
AddCSLuaFile( "download.lua" )
resource.AddFile("maps/rp_townsend_v2.bsp")
end 
When using this make sure to make the file called download

Move this file into

garrysmod/garrysmod/lua/autorun/server/

If this does not work please post again.
This is untested btw.
Image
peterparker
New to forums
New to forums
Posts: 4
Joined: Thu Apr 12, 2012 9:03 pm

Re: Forcing a client to download a map

Post by peterparker »

This did not work, but thanks for trying to help.
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Forcing a client to download a map

Post by Edge100x »

The map should automatically go to clients whenever it's loaded, based on the behavior of the base game itself.

Is the game trying to download and having it fail? In the access log for your webhosting, do you see the attempt?
peterparker
New to forums
New to forums
Posts: 4
Joined: Thu Apr 12, 2012 9:03 pm

Re: Forcing a client to download a map

Post by peterparker »

I don't have access to the log but when I join in the corner it says the map is downloading for a split second, then it just goes onto the next download without downloading the map.
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Forcing a client to download a map

Post by Edge100x »

Please have the renter check that log through his "File manager" page for the webhosting, right after connecting and trying to load the map. It could be that the map name needs to be renamed to have a different upper/lowercase combination and the download is failing because of this, for instance.
peterparker
New to forums
New to forums
Posts: 4
Joined: Thu Apr 12, 2012 9:03 pm

Re: Forcing a client to download a map

Post by peterparker »

Thanks Edge, I renamed the map files and it worked perfectly. :)
User avatar
Edge100x
Founder
Founder
Posts: 12947
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Forcing a client to download a map

Post by Edge100x »

Awesome :)
TheLastPenguin
A semi-regular
A semi-regular
Posts: 25
Joined: Tue Aug 28, 2012 4:33 pm

Re: Forcing a client to download a map

Post by TheLastPenguin »

There is a file size limit on gmod downloads. If a file exceeds the limit it's skipped. There's a Convar for it net_maxdownload or something. It's in kb I think. I'd set it to arround 128000
User avatar
TimeX
Staff
Staff
Posts: 1730
Joined: Thu Jul 22, 2004 12:24 am
Location: Big Bear, CA

Re: Forcing a client to download a map

Post by TimeX »

The setting you are thinking of is net_maxfilesize and it is in MB. For example, this will allow downloading of files up to 64MB in size: net_maxfilesize 64
TimeX
TheLastPenguin
A semi-regular
A semi-regular
Posts: 25
Joined: Tue Aug 28, 2012 4:33 pm

Re: Forcing a client to download a map

Post by TheLastPenguin »

Thanks for clarification. I think I was thinking of net max packet size from those figures.
Post Reply