[EXTENSION] Late Downloads
Late Downloads
What is this? This is a SourceMod extension that allows file transfers to players that are already in the game. How to build this? Just as any other AMBuild project:
How to use this? Simply copy the extension binary to the extensions folder and the include file into the scripting/include folder. Now just create a new plugin and include latedl.inc. Sample script PHP Code:
The extension exposes following cvars:
The first two cvars limit the maximal time that the download can take. The maximal duration (in seconds) is computed using following formula: maximalDelay / 1000 + (fileSizeInBytes * 8 ) / (minimalBandwidth * 1000) If the player fails to download the file in time, he's kicked. The last cvar kicks any player that rejects incoming files. Additional information
Sources and binaries Latest sources are availabe at github: https://github.com/jonatan1024/latedl Binaries for windows and linux should be availabe at the github releases page: https://github.com/jonatan1024/latedl/releases |
Re: [EXTENSION] Late Downloads
this plugin will work for download zip or rar archive?
|
Re: [EXTENSION] Late Downloads
Nope. Source don't supports zip archives.
|
Re: [EXTENSION] Late Downloads
This is pretty neat, wasn't aware it was possible!
I built it against TF2 with a few small changes: Code:
179c179 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? |
Re: [EXTENSION] Late Downloads
Quote:
|
Re: [EXTENSION] Late Downloads
Quote:
|
Re: [EXTENSION] Late Downloads
Quote:
Quote:
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? |
Re: [EXTENSION] Late Downloads
Quote:
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. |
Re: [EXTENSION] Late Downloads
Quote:
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. :D Some network entity filtering should solve this quite easily tho. |
Re: [EXTENSION] Late Downloads
Change for latest version to build against TF2:
Code:
257,259c257 Or like this, but I dunno if there's a cleaner way to do this without inheriting: Code:
template< class T, class A = CUtlMemory<T> > |
Re: [EXTENSION] Late Downloads
Quote:
https://github.com/jonatan1024/lated...1596de03d0f808 |
Re: [EXTENSION] Late Downloads
I've discovered some sort of memory(?) bug, but I'm not proficient enough with C++ to figure out the cause.
Apologies in advance if there's actually just something wrong on my end I'm not seeing. The test code: Code:
#pragma semicolon 1 Code:
testdl test/random_128K_00.bin Code:
testdl2 Code:
testdl3 Code:
testdl2b Code:
testdl4 |
Re: [EXTENSION] Late Downloads
Compiled with MSVC v14.0 against sdk2013 on windows x64, AddLateDownloads with addAsStatic=true always returns 0. This happens when filled addedFiles is passed to SendFiles function via pointer.
Before sending to SendFiles, FOR_EACH_VEC says it's filled, but within SendFiles FOR_EACH_VEC says it's empty. |
Re: [EXTENSION] Late Downloads
1 Attachment(s)
Quote:
testdl & testdl2b problems were indeed caused by bad memory handling, storing pointers to plugin's stack. I've fixed these in the new release, you can try it out. testdl4 is a bug in sourcepawn itself, you can try it out just by replacing AddLateDownload by PrintToServer. It is some kind of compiler issue, probably solved by now: https://github.com/alliedmodders/sou...014969e47f9396 You can work around this issue by moving the brackets behind the variable name. If you look at the attached image, you can clearly see the problem. Quote:
|
Re: [EXTENSION] Late Downloads
Quote:
Another bug: latedl_minimalbandwidth kicks clients if called within OnClientAuthorized and perhaps other connection stages, I guess since they aren't yet accepting the download. I modified the extension to add a function to send only to specified clients. Maybe this is a feature that could be added? The short use case is to cache which players have already downloaded a file to avoid resending. The longer version is: The plugin associates a list of files with a server, map, and player, adds those files to a download list for each connected client and has them download it. In order to do this properly, it needs to send files only to specific clients so it can avoid resending to any clients that already have those files. So for example, a server has: materials/foo/magic.vtf sound/foo/neat.wav The map cp_process_final has: materials/foo/processthing.vtf A player has: materials/foo/superspray.vtf Another player has: materials/foo/cooliospray.vtf It adds all those files to a list and sends them out to all clients that don't already have them. The list changes based on the current map and players in the server. |
Re: [EXTENSION] Late Downloads
Quote:
I've added another parameter, specifing the target client, zero index means all player as usual. |
Re: [EXTENSION] Late Downloads
Is there a way to use a third-party service just like a fastdl server? Or it is restricted to the game server upload?
|
Re: [EXTENSION] Late Downloads
Quote:
If you're a hardcore hacker, you might find a way how to downgrade client state to force re-download of resources via fastdl; and then upgrade the state back so the client won't get disconnected. If you're able to do the second part, please PM me :D |
Re: [EXTENSION] Late Downloads
This seems to be pretty much the same as >this< with more setting possibilities?
|
Re: [EXTENSION] Late Downloads
Maybe there is a way to redirect the traffic.
Quote:
Also, can it manage the downloads of a single player?? What are the restrictions for the directorye swhere the extension can save files on client and download from (if possible)? only from /cuntom/* ? My idea is if it is possible to download demo files from client or even screenshots, to implement some kind of anticheat plugin |
Re: [EXTENSION] Late Downloads
Quote:
Quote:
Quote:
Quote:
|
Re: [EXTENSION] Late Downloads
Quote:
Yes, but in theory, if the server can know the file path, can it be pulled? |
Re: [EXTENSION] Late Downloads
Quote:
>You can download anything from inside the Gamefolder, I dont know if this works on CSGO but in TF2 it worked fine and so i guess it does for most of the classy Games. Ime not exactly sure if its THAT easy to write an anti Cheat that uses demo Files. The bigger Problem i see is that you do not really have a Way to list Files, and so you need a different Way to gater the demo Filenames or need to invest some more Codelines. I was also thinking of downloading Windows desktop.ini Files but this is going a bit too far, or? ^^ As far as i know the Filename is build out of the [recording Methode(auto, etc.)}-{Date}-{Record Time}-{Mapname}.dem Quote:
I may edit SM Downloader a bit to implent this Extension |
Re: [EXTENSION] Late Downloads
You can prompt to the player a DialogType_Menu. It can trigger any console command on the client such as "record unique_name"
I talking about a competitive scenario. It surely is not viable on public servers, but a automatic POV upload whould be extremely usefull for competitive matches |
Re: [EXTENSION] Late Downloads
Quote:
Link > https://esports.easyanticheat.net/esports/signup/ |
Re: [EXTENSION] Late Downloads
I can't seem to compile this, does anyone have the extension for Windows and csgo?
Cheers |
Re: [EXTENSION] Late Downloads
Quote:
|
Re: [EXTENSION] Late Downloads
Hi, Backup!
Thanks a much for your extensions. Can you please take a look, why I got no files in "build" dir: Quote:
Also, is it can be build with another's game SDK? P.S. AMBuildScript script seems not correctly prepared. It require csgo sdk folder should have name "hl2sdk-csgo", but sdk from download link you provided has dir. name "hl2sdk-sdk2013" and can't be found by this python script. |
Re: [EXTENSION] Late Downloads
Quote:
I have a compile script on my unix machine that looks like this: Code:
#!/bin/sh It can be build against pretty much every source game sdk, just fetch different sdk repo, export different env var and specify different sdk in the command line. |
Re: [EXTENSION] Late Downloads
omg, must run ambuild. Thanks.
Two compilation threads raised errors: Quote:
What SM ver. do you use? |
Re: [EXTENSION] Late Downloads
Quote:
The second one is probably from stdlib, make sure you have 32bit libc installed. Quote:
|
Re: [EXTENSION] Late Downloads
ok, sorry. I forgot recursive flag when clone sm.
But there are another errors, I'm not sure I can handle this time: Quote:
Quote:
|
Re: [EXTENSION] Late Downloads
Did you downloaded sdk from this repository from correct branch?
https://github.com/alliedmodders/hl2sdk/tree/csgo |
Re: [EXTENSION] Late Downloads
I downloaded wrong branch.
Backup, thanks again. Successfully built with SDK I need. |
Re: [EXTENSION] Late Downloads
Hi, Backup!
1) Can you please describe more about behaviour of: Quote:
Personally, I need reliable downloading system. See: If I'm adding several paths and client disconnect on half-way, I don't want to waste traffic. I need to know what files he already downloaded. I cannot rely on OnDownloadSuccess() forward (server could reboot, client could reinstall client e.t.c.). And I cannot use AddLateDownload() again because I noticed it download file again even if client already downloaded that file. Is it possible somehow to know if client already downloaded file? (AddFileToDownloadsTable() function somehow know that information). P.S. I think, I could resolve it by setting client's cookie for each successfully downloaded file, so my downloader will check for them first before beginning actual download process. It's not a complete solution because user can manually delete some file (without reinstalling the game). 2) Is there any restriction for the number of consecutive calls of AddLateDownload()? Mean, if I don't want to call array alternative - AddLateDownloads(). 3) Is it normal OnDownloadSuccess returns duplicate records: - one for client ID == 0 - second for the actual client ID. ? Thanks again, looking forward for your answer, Alex. |
Re: [EXTENSION] Late Downloads
++
Do you return client ID real-time (not time-delayed)? Mean, is it reliable that you use ClientID instead of UserID? |
Re: [EXTENSION] Late Downloads
@Dragokas:
It would be much easier if you would tell me what is your use case, what are you trying to achivie with this extension. I have a strong feeling we're reinventing a wheel here. If you are calling AddLateDownload at map start, you don't need this extension at all, you can directly add the files into download table. There is no easy way of checking whether client has the file downloaded. But if I recall correctly, if you call the AddLateDownload function on already existing file, it should immediately call the callback signaling succes. I'm not sure, I'd have to check. Quote:
Quote:
Code:
/** Quote:
|
Re: [EXTENSION] Late Downloads
Thanks.
Quote:
It was just a test. I don't plan to use in on map load. Instead, AddLateDownload() will be in OnClientPostAdminCheck(). Quote:
Yes, extension show in console that file is already downloaded (but not at once) => it try to download it and it waste time and traffic. Anyway, I already made a plugin that uses client's cookies to store download history. I'll post it here if you don't mind as soon as I made little optimizations. |
Re: [EXTENSION] Late Downloads
1) Is it possible to implement StopDownload() method?
Because I'm getting "You have insufficient bandwidth" game engine message and get kicked from the server during map transition. 2) Can you hide or change msg err. level of: Quote:
To be honest, it is not informative; not sure admin needs that info especially in err. log together with a real errors raised by critical errors in plugins. It's better to just display it in console as usual msg type, not an error. 3) Also, during gameplay I got spam of such error with complete freeze of client: Quote:
Edit. So, my client is constantly freeze if it download file ~ 10 MB. Maybe, you know some server Cvar, responsible for the size of max. bandwidth? 4) Does "Late download" extension has the code to kick players? O_o Quote:
Quote:
7) What .ztmp actually intended for? What if several clients are trying to download the same file? (so, as I can see, extension will use the same .ztmp file name? and will fail?) 8 ) Is it possible somehow to increase download speed? For me currently it's like ~ from 2 to 7 KB/s. Terribly. |
Re: [EXTENSION] Late Downloads
1 Attachment(s)
As I promised before, here is sm_downloader plugin by SWAT_88, forked by me to support "Late Downloader" extension.
It doesn't download same file twice. It store successfully downloaded files in client's cookies. It also doesn't send all files in download queue together. It set new file for downloading right after successfull/failure with a previous file. For me, currently it's work quite well. But, I think currently it's useless until you at least fix "kick players" issue. I tryed to change server settings for max bandwidth: Code:
sv_maxrate "0" But other players get kicked even during gameplay. Here is my full network settings: Code:
sm_cvar sv_client_min_interp_ratio 0 |
All times are GMT -4. The time now is 22:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.