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
+9 -1
View File
@@ -20,6 +20,7 @@
#include "NetClient.h"
#include "NetServer.h"
#include "NetMessage.h"
#include "NetStats.h"
#include "ps/CLogger.h"
#include "scriptinterface/ScriptInterface.h"
@@ -43,12 +44,14 @@ CNetClientSession::~CNetClientSession()
// between ENet and session and client and GUI
CNetClientSessionRemote::CNetClientSessionRemote(CNetClient& client) :
CNetClientSession(client), m_Host(NULL), m_Server(NULL)
CNetClientSession(client), m_Host(NULL), m_Server(NULL), m_Stats(NULL)
{
}
CNetClientSessionRemote::~CNetClientSessionRemote()
{
delete m_Stats;
if (m_Host && m_Server)
{
// Disconnect without waiting for confirmation
@@ -84,6 +87,9 @@ bool CNetClientSessionRemote::Connect(u16 port, const CStr& server)
m_Host = host;
m_Server = peer;
m_Stats = new CNetStatsTable(m_Server);
g_ProfileViewer.AddRootTable(m_Stats);
return true;
}
@@ -97,6 +103,8 @@ void CNetClientSessionRemote::Disconnect()
m_Host = NULL;
m_Server = NULL;
SAFE_DELETE(m_Stats);
}
void CNetClientSessionRemote::Poll()