Made statistics and userpages independant of each other.

This commit is contained in:
Thulinma 2014-06-20 11:05:04 +02:00
parent 80b905965e
commit 1206b76b4a

View file

@ -626,26 +626,25 @@ namespace Mist {
} }
void Output::stats(){ void Output::stats(){
if (!statsPage.getData()){ if (statsPage.getData()){
return; unsigned long long int now = Util::epoch();
} if (now != lastStats){
unsigned long long int now = Util::epoch(); lastStats = now;
if (now != lastStats){ IPC::statExchange tmpEx(statsPage.getData());
lastStats = now; tmpEx.now(now);
IPC::statExchange tmpEx(statsPage.getData()); tmpEx.host(myConn.getHost());
tmpEx.now(now); tmpEx.streamName(streamName);
tmpEx.host(myConn.getHost()); tmpEx.connector(capa["name"].asString());
tmpEx.streamName(streamName); tmpEx.up(myConn.dataUp());
tmpEx.connector(capa["name"].asString()); tmpEx.down(myConn.dataDown());
tmpEx.up(myConn.dataUp()); tmpEx.time(now - myConn.connTime());
tmpEx.down(myConn.dataDown()); if (currentPacket){
tmpEx.time(now - myConn.connTime()); tmpEx.lastSecond(currentPacket.getTime());
if (currentPacket){ }else{
tmpEx.lastSecond(currentPacket.getTime()); tmpEx.lastSecond(0);
}else{ }
tmpEx.lastSecond(0); statsPage.keepAlive();
} }
statsPage.keepAlive();
} }
int tNum = 0; int tNum = 0;
if (!playerConn.getData()){ if (!playerConn.getData()){