1
0
forked from mirrors/0ad

Add ENet stats to profile viewer.

This was SVN commit r7671.
This commit is contained in:
Ykkrosh
2010-07-03 13:15:01 +00:00
parent 41e786837e
commit c59e2c572b
6 changed files with 180 additions and 2 deletions
+7 -1
View File
@@ -22,6 +22,7 @@
#include "NetClient.h"
#include "NetMessage.h"
#include "NetSession.h"
#include "NetStats.h"
#include "NetTurnManager.h"
#include "ps/CLogger.h"
@@ -46,7 +47,7 @@ static CStr DebugName(CNetServerSession* session)
}
CNetServer::CNetServer() :
m_ScriptInterface(new ScriptInterface("Engine")), m_NextHostID(1), m_Host(NULL)
m_ScriptInterface(new ScriptInterface("Engine")), m_NextHostID(1), m_Host(NULL), m_Stats(NULL)
{
m_State = SERVER_STATE_UNCONNECTED;
@@ -59,6 +60,8 @@ CNetServer::CNetServer() :
CNetServer::~CNetServer()
{
delete m_Stats;
for (size_t i = 0; i < m_Sessions.size(); ++i)
{
m_Sessions[i]->Disconnect();
@@ -92,6 +95,9 @@ bool CNetServer::SetupConnection()
return false;
}
m_Stats = new CNetStatsTable(m_Host);
g_ProfileViewer.AddRootTable(m_Stats);
m_State = SERVER_STATE_PREGAME;
return true;