for(int i=0; i<Stats::MAX; i++)
{
- perSec[i] = (current[i]-last[i])/diff;
+ perSec[i] = (unsigned)(current[i]-last[i])/diff;
last[i] = current[i];
}
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
- unsigned int getCurrent(STAT s) {return current[s];}
+ unsigned long long int getCurrent(STAT s) {return current[s];}
- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
+ unsigned int perSec[Stats::MAX];
unsigned int lastUpdate;
};
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
#endif
// ------------------------------------------------
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
+ unsigned long long int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
+ unsigned long long int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
// up
for (int i=GB; i>0; --i)
for(int i=0; i<Stats::MAX; i++)
{
- perSec[i] = (current[i]-last[i])/diff;
+ perSec[i] = (unsigned)(current[i]-last[i])/diff;
last[i] = current[i];
}
void clear(STAT s) {current[s]=0;}
void add(STAT s,int n=1) {current[s]+=n;}
unsigned int getPerSecond(STAT s) {return perSec[s];}
- unsigned int getCurrent(STAT s) {return current[s];}
+ unsigned long long int getCurrent(STAT s) {return current[s];}
- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
+ unsigned int perSec[Stats::MAX];
unsigned int lastUpdate;
};
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
#endif
// ------------------------------------------------
char suffix[][3] = { "B", "KB", "MB", "GB" };
const int bufsize = 60;
char szUp[bufsize], szDown[bufsize];
- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
+ unsigned long long int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
+ unsigned long long int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
// up
for (int i=GB; i>0; --i)