NetStats_BytesSent(playerid)
#1

Hola. How i can reset this number count? But it seems to me that this is impossible. I use divided resource types, this is like a primary, then player connecting to server, secondary, player download maps and other dlc resources loads in game processing. But all count of bytes from connecting to server appends to all resource types and i get general number count transferred byte data.
This needs me for download info, where in message writes how many resources you downloaded, types, time and etc like this:

Code:
	 	
format(M_String,sizeof M_String,""SI_OR" Compressed downloaded size: "OR_C"%s"WH_C", Unpacked size: "OR_C"%s"WH_C".", ConvertDS(NetStats_BytesSent(playerid)), ConvertDS(NetStats_BytesSent(playerid)*4));
SendClientMessage(playerid,COLOR_WHITE,M_String);
format(M_String,sizeof M_String,""SI_OR" Downloading time: "OR_C"%s"WH_C".", ConvertHMS(DownloadTime[playerid]));
SendClientMessage(playerid,COLOR_WHITE,M_String);
Sry for my bad Eng(
Reply
#2

Using OnPlayerFinishedDownloading you can determine the File that has been downloaded (you can get the file name from its CRC).

Then, using a plugin that is able to access the models/ folder (like FileManager) you could measure the file sizes and know how much they downloaded (note that the files get compressed when downloading, so you'd have the uncompressed size).

Or measure each file's size once and store it, as they won't change during runtime.

That's imo the best and most accurate way to determine the total download size (even if uncompressed), SAMP's network natives are unreliable in regards of download sizes as they include all other data.

Otherwise keep track of the value at the start of the download and calculate the difference everytime a file was downloaded.

The most useful info would be how much data needs to be downloaded in total anyway, or how many files. The players can see the progress and download speed in SAMP's Download Dialog.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)