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

[EXTENSION] Late Downloads


Post New Thread Reply   
 
Thread Tools Display Modes
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 05-01-2018 , 07:46   Re: [EXTENSION] Late Downloads
Reply With Quote #31

Quote:
Originally Posted by Dragokas View Post
Looks like 2 header files is missed.
The first one is from sourcepawn. You need to clone the repository with all subrepositories. That is just shitty git behaviour. https://stackoverflow.com/questions/...ing-submodules
The second one is probably from stdlib, make sure you have 32bit libc installed.
Quote:
Originally Posted by Dragokas View Post
What SM ver. do you use?
If you have binaries of some version on server, use the branch of the same version.
__________________
Sorry for my english.
Backup is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-01-2018 , 07:56   Re: [EXTENSION] Late Downloads
Reply With Quote #32

ok, sorry. I forgot recursive flag when clone sm.

But there are another errors, I'm not sure I can handle this time:
Quote:
In file included from /home/alex/dev/hl2sdk-csgo/public/tier0/commonmacros.h:15:0,
from /home/alex/dev/hl2sdk-csgo/public/tier0/basetypes.h:11,
from /home/alex/dev/hl2sdk-csgo/public/tier0/dbg.h:15,
from /home/alex/dev/hl2sdk-csgo/public/tier1/convar.h:19,
from /home/alex/dev/hl2sdk-csgo/public/eiface.h:16,
from /home/alex/dev/metamod-source-master/core/ISmmAPI.h:45,
from /home/alex/dev/metamod-source-master/core/ISmmPlugin.h9,
from /home/alex/dev/sm/sourcemod/public/smsdk_ext.h:100,
from /home/alex/dev/latedl-master/extension.h:40,
from /home/alex/dev/latedl-master/extension.cpp2:
/home/alex/dev/hl2sdk-csgo/public/tier0/platform.h:727:0: error: "_stricmp" redefined [-Werror]
#define _stricmp stricmp
^
<command-line>:0:0: note: this is the location of the previous definition
/home/alex/dev/latedl-master/extension.cpp: In member function ‘virtual void CExtension::OnGameFrame(bool)’:
/home/alex/dev/latedl-master/extension.cpp:194:66: error: no matching function for call to ‘INetChannel::SendFile(const char*&, int, bool)’
resendSuccess = chan->SendFile(filename, g_TransferID++, false);
^
In file included from /home/alex/dev/latedl-master/extension.cpp6:0:
/home/alex/dev/hl2sdk-csgo/public/inetchannel.h:50:15: note: candidate: virtual bool INetChannel::SendFile(const char*, unsigned int)
virtual bool SendFile(const char *filename, unsigned int transferID) = 0;
^
/home/alex/dev/hl2sdk-csgo/public/inetchannel.h:50:15: note: candidate expects 2 arguments, 3 provided
/home/alex/dev/latedl-master/extension.cpp: In function ‘int SendFiles(const CUtlVector<const char*>&, int)’:
/home/alex/dev/latedl-master/extension.cpp29:52: error: no matching function for call to ‘INetChannel::SendFile(const char*&, int&, bool)’
if (chan->SendFile(filename, g_TransferID, false)) {
^
In file included from /home/alex/dev/latedl-master/extension.cpp6:0:
/home/alex/dev/hl2sdk-csgo/public/inetchannel.h:50:15: note: candidate: virtual bool INetChannel::SendFile(const char*, unsigned int)
virtual bool SendFile(const char *filename, unsigned int transferID) = 0;
^
/home/alex/dev/hl2sdk-csgo/public/inetchannel.h:50:15: note: candidate expects 2 arguments, 3 provided
cc1plus: all warnings being treated as errors
Quote:
In file included from /home/alex/dev/hl2sdk-csgo/public/tier0/commonmacros.h:15:0,
from /home/alex/dev/hl2sdk-csgo/public/tier0/basetypes.h:11,
from /home/alex/dev/hl2sdk-csgo/public/tier0/dbg.h:15,
from /home/alex/dev/hl2sdk-csgo/public/tier1/convar.h:19,
from /home/alex/dev/hl2sdk-csgo/public/eiface.h:16,
from /home/alex/dev/metamod-source-master/core/ISmmAPI.h:45,
from /home/alex/dev/metamod-source-master/core/ISmmPlugin.h9,
from /home/alex/dev/sm/sourcemod/public/smsdk_ext.h:100,
from /home/alex/dev/sm/sourcemod/public/smsdk_ext.cpp4:
/home/alex/dev/hl2sdk-csgo/public/tier0/platform.h:727:0: error: "_stricmp" redefined [-Werror]
#define _stricmp stricmp
^
<command-line>:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 05-01-2018 , 08:14   Re: [EXTENSION] Late Downloads
Reply With Quote #33

Did you downloaded sdk from this repository from correct branch?
https://github.com/alliedmodders/hl2sdk/tree/csgo
__________________
Sorry for my english.
Backup is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-01-2018 , 08:40   Re: [EXTENSION] Late Downloads
Reply With Quote #34

I downloaded wrong branch.

Backup, thanks again.
Successfully built with SDK I need.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 10:19   Re: [EXTENSION] Late Downloads
Reply With Quote #35

Hi, Backup!

1) Can you please describe more about behaviour of:
Quote:
* @param addAsStatic When true, files are also added into downloads table as static downloads. On the next call the files are checked against this table to avoid repeated downloads of the same files.
How is it actually work? I thought, you are adding file to AddFileToDownloadsTable in parallel. But I added AddLateDownload to OnMapStart() and I see no black screen.

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.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-22-2018 at 10:26.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 12:05   Re: [EXTENSION] Late Downloads
Reply With Quote #36

++
Do you return client ID real-time (not time-delayed)? Mean, is it reliable that you use ClientID instead of UserID?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 05-22-2018 , 13:44   Re: [EXTENSION] Late Downloads
Reply With Quote #37

@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:
Originally Posted by Dragokas View Post
Is there any restriction for the number of consecutive calls of AddLateDownload()?
Mean, if I don't want to call array alternative - AddLateDownloads().
AddLateDownloads is pretty much just a wrapper around AddLateDownload. So call it as much as you want.

Quote:
Originally Posted by Dragokas View Post
Is it normal OnDownloadSuccess returns duplicate records:
- one for client ID == 0
- second for the actual client ID.
?
Yes, as stated in the documentation:
Code:
/**
 * Called when client successfully downloaded a file. This forward might be called before AddLateDownload(s) returns!
 *
 * @param iClient		Client index. Index 0 signals removal of the file from the download queue - all clients downloaded or failed to download the file.  
 * @param filename		Name of the successfully downloaded file. 
 */
Quote:
Originally Posted by Dragokas View Post
Do you return client ID real-time (not time-delayed)? Mean, is it reliable that you use ClientID instead of UserID?
Yes. You won't get fresher ClientID than this. I have the most real-timey ClientIDs in town.
__________________
Sorry for my english.
Backup is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 14:05   Re: [EXTENSION] Late Downloads
Reply With Quote #38

Thanks.

Quote:
Originally Posted by Backup
... what are you trying to achivie with this extension
Goal is: to avoid black screen (happened if you use AddFileToDownloadsTable() in OnMapStart()).
It was just a test. I don't plan to use in on map load. Instead, AddLateDownload() will be in OnClientPostAdminCheck().

Quote:
... it should immediately call the callback signaling succes. I'm not sure, I'd have to check.
It is not do that way. Using current version of your extension, I need to wait a long time while it re-download all files that already downloaded.
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.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-22-2018 at 14:05.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 16:05   Re: [EXTENSION] Late Downloads
Reply With Quote #39

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:
L 05/22/2018 - 19:59:04: [LATEDL] Lost client 1 when sending file 'models/survivors/alicew.mdl'!
because that msg spam with a LOT of lines in error log file.
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:
xx.xx.xx.xx:27243:send reliable stream overflow
xx.xx.xx.xx:27243:send reliable stream overflow
xx.xx.xx.xx:27243:send reliable stream overflow
Disconnect: Dragokas timed out.
After a while, my client is disconnected.

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:
L 05/23/2018 - 01:157: [LATEDL] Client 5 ('Zed3rs0n', xx.xx.xx.xx:27005) had insufficient bandwidth (<64 kbps), failed to receive 'materials/models/survivors/vipersa2iqs/alisa_head_wrp.vtf' in time! Kicking!
5) Also, not sure is it important, maybe this error in client console go from your extension:
Quote:
CNetChan::SetMaxBufferSize: cant preserve exiting data 5501>4000.
6) Is it possible, extention not to spam with .ztmp files all over the server with every file it try to download to client? At least, it could clear it right after successfull downloading (or if file already exist on client side)?

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.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-22-2018 at 19:00.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-22-2018 , 18:29   Re: [EXTENSION] Late Downloads
Reply With Quote #40

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"
It helped somehow, at least for me not to be kicked at map transition.
But other players get kicked even during gameplay.
Here is my full network settings:
Code:
sm_cvar sv_client_min_interp_ratio 0
sm_cvar sv_client_max_interp_ratio 2
sm_cvar sv_client_predict 1
sm_cvar nb_update_frequency 0.1
sm_cvar sv_unlag 1
sm_cvar sv_maxunlag 0.5
sm_cvar net_splitpacket_maxrate 1048576
sv_minupdaterate "20"
sv_maxupdaterate "66"
sv_mincmdrate "30"
sv_maxcmdrate "66"
sv_minrate "80000"
sv_maxrate "0"
Attached Files
File Type: sp Get Plugin or Get Source (sm_downloader.sp - 193 views - 14.8 KB)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply


Thread Tools
Display Modes

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 19:54.


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