New version of the boost timer (addon lib).
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <net/socket_helper.h> // needed for correct order of header files.
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <core/boost/timer.hpp>
|
||||
#include <core/boost/timers.hpp>
|
||||
|
||||
#define CLIENT_INITIAL_STATE ClientStateInit
|
||||
|
||||
@@ -114,8 +114,6 @@ public:
|
||||
|
||||
virtual ~ClientStateStartConnect();
|
||||
|
||||
void SetTimer(boost::microsec_timer timer);
|
||||
|
||||
// Call connect.
|
||||
virtual int Process(ClientThread &client);
|
||||
|
||||
@@ -134,7 +132,7 @@ public:
|
||||
|
||||
virtual ~ClientStateConnecting();
|
||||
|
||||
void SetTimer(const boost::microsec_timer &timer);
|
||||
void SetTimer(const boost::timers::portable::microsec_timer &timer);
|
||||
|
||||
// "Poll" for the completion of the TCP/IP connect call.
|
||||
virtual int Process(ClientThread &client);
|
||||
@@ -146,7 +144,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
boost::microsec_timer m_connectTimer;
|
||||
boost::timers::portable::microsec_timer m_connectTimer;
|
||||
};
|
||||
|
||||
// State: Session init.
|
||||
|
||||
@@ -247,7 +247,7 @@ ClientStateStartConnect::Process(ClientThread &client)
|
||||
int errCode = SOCKET_ERRNO();
|
||||
if (errCode == SOCKET_ERR_WOULDBLOCK)
|
||||
{
|
||||
boost::microsec_timer connectTimer;
|
||||
boost::timers::portable::microsec_timer connectTimer;
|
||||
connectTimer.start();
|
||||
ClientStateConnecting::Instance().SetTimer(connectTimer);
|
||||
client.SetState(ClientStateConnecting::Instance());
|
||||
@@ -278,7 +278,7 @@ ClientStateConnecting::~ClientStateConnecting()
|
||||
}
|
||||
|
||||
void
|
||||
ClientStateConnecting::SetTimer(const boost::microsec_timer &timer)
|
||||
ClientStateConnecting::SetTimer(const boost::timers::portable::microsec_timer &timer)
|
||||
{
|
||||
m_connectTimer = timer;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ ServerLobbyThread::CloseSessionDelayed(SessionWrapper session)
|
||||
{
|
||||
m_sessionManager.RemoveSession(session.sessionData->GetSocket());
|
||||
|
||||
boost::microsec_timer closeTimer;
|
||||
boost::timers::portable::microsec_timer closeTimer;
|
||||
closeTimer.start();
|
||||
CloseSessionList::value_type closeSessionData(closeTimer, session.sessionData);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <net/servergamethread.h>
|
||||
#include <playerdata.h>
|
||||
#include <core/boost/timer.hpp>
|
||||
#include <core/boost/timers.hpp>
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -78,14 +78,14 @@ public:
|
||||
|
||||
virtual void Init();
|
||||
|
||||
const boost::microsec_timer &GetTimer() const {return m_timer;}
|
||||
const boost::timers::portable::microsec_timer &GetTimer() const {return m_timer;}
|
||||
|
||||
protected:
|
||||
|
||||
AbstractServerGameStateTimer();
|
||||
|
||||
private:
|
||||
boost::microsec_timer m_timer;
|
||||
boost::timers::portable::microsec_timer m_timer;
|
||||
};
|
||||
|
||||
// Abstract State: Game is running.
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <core/boost/timer.hpp>
|
||||
#include <core/boost/timers.hpp>
|
||||
|
||||
#define LOBBY_THREAD_TERMINATE_TIMEOUT 200
|
||||
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
|
||||
typedef std::deque<boost::shared_ptr<ConnectData> > ConnectQueue;
|
||||
typedef std::list<SessionWrapper> SessionList;
|
||||
typedef std::list<std::pair<boost::microsec_timer, boost::shared_ptr<SessionData> > > CloseSessionList;
|
||||
typedef std::list<std::pair<boost::timers::portable::microsec_timer, boost::shared_ptr<SessionData> > > CloseSessionList;
|
||||
typedef std::map<unsigned, boost::shared_ptr<ServerGameThread> > GameMap;
|
||||
typedef std::list<unsigned> RemoveGameList;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user