Running astyle.
This commit is contained in:
+13
-6
@@ -65,12 +65,19 @@ class PingData
|
||||
public:
|
||||
PingData() : pingTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start) {}
|
||||
|
||||
unsigned MinPing() {return *std::min_element(pingValues.begin(), pingValues.end());}
|
||||
unsigned MaxPing() {return *std::max_element(pingValues.begin(), pingValues.end());}
|
||||
unsigned AveragePing() {return std::accumulate(pingValues.begin(), pingValues.end(), 0) / (unsigned)pingValues.size();}
|
||||
void StartPing() {pingTimer.start();}
|
||||
void EndPing()
|
||||
{
|
||||
unsigned MinPing() {
|
||||
return *std::min_element(pingValues.begin(), pingValues.end());
|
||||
}
|
||||
unsigned MaxPing() {
|
||||
return *std::max_element(pingValues.begin(), pingValues.end());
|
||||
}
|
||||
unsigned AveragePing() {
|
||||
return std::accumulate(pingValues.begin(), pingValues.end(), 0) / (unsigned)pingValues.size();
|
||||
}
|
||||
void StartPing() {
|
||||
pingTimer.start();
|
||||
}
|
||||
void EndPing() {
|
||||
if (pingTimer.is_running()) {
|
||||
pingValues.push_back((unsigned)pingTimer.elapsed().total_milliseconds());
|
||||
if (pingValues.size() > SIZE_PING_BACKLOG) {
|
||||
|
||||
@@ -1771,8 +1771,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
|
||||
client->GetClientLog()->transformPlayerActionLog(PlayerAction(netActionDone.playeraction())),
|
||||
netActionDone.totalplayerbet() - tmpPlayer->getMySet()
|
||||
);
|
||||
if (tmpPlayer->getMyID() == 0)
|
||||
{
|
||||
if (tmpPlayer->getMyID() == 0) {
|
||||
client->EndPing();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ ServerAcceptWebHelper::validate(websocketpp::connection_hdl hdl)
|
||||
server::connection_ptr con = m_webSocketServer->get_con_from_hdl(hdl);
|
||||
if ((m_webSocketResource.empty() || con->get_resource() == m_webSocketResource)
|
||||
&& (m_webSocketOrigin.empty() ||
|
||||
(con->get_origin() != "null" &&
|
||||
(con->get_origin() == "http://" + m_webSocketOrigin || con->get_origin() == "http://www." + m_webSocketOrigin)))) {
|
||||
(con->get_origin() != "null" &&
|
||||
(con->get_origin() == "http://" + m_webSocketOrigin || con->get_origin() == "http://www." + m_webSocketOrigin)))) {
|
||||
retVal = true;
|
||||
}
|
||||
return retVal;
|
||||
|
||||
Reference in New Issue
Block a user