Example #1
0
C4Network2Stats::C4Network2Stats() : pSec1Timer(NULL) {
  // set self (needed in CreateGraph-fns)
  Game.pNetworkStatistics = this;
  // init callback timer
  pSec1Timer = new C4Sec1TimerCallback<C4Network2Stats>(this);
  SecondCounter = 0;
  ControlCounter = 0;
  // init graphs
  statObjCount.SetTitle(LoadResStr("IDS_MSG_OBJCOUNT"));
  statFPS.SetTitle(LoadResStr("IDS_MSG_FPS"));
  statNetI.SetTitle(LoadResStr("IDS_NET_INPUT"));
  statNetI.SetColorDw(0x00ff00);
  statNetO.SetTitle(LoadResStr("IDS_NET_OUTPUT"));
  statNetO.SetColorDw(0xff0000);
  graphNetIO.AddGraph(&statNetI);
  graphNetIO.AddGraph(&statNetO);
  statControls.SetTitle(LoadResStr("IDS_NET_CONTROL"));
  statControls.SetAverageTime(100);
  statActions.SetTitle(LoadResStr("IDS_NET_APM"));
  statActions.SetAverageTime(100);
  for (C4Player *pPlr = Game.Players.First; pPlr; pPlr = pPlr->Next)
    pPlr->CreateGraphs();
  C4Network2Client *pClient = NULL;
  while (pClient = Game.Network.Clients.GetNextClient(pClient))
    pClient->CreateGraphs();
}