Running astyle.
This commit is contained in:
@@ -417,21 +417,18 @@ void MyAvatarLabel::paintEvent(QPaintEvent*)
|
||||
QColor pingColor;
|
||||
if(myAvgPing > 0 && myAvgPing <= 1000) {
|
||||
pingColor.setNamedColor("green");
|
||||
}
|
||||
else if(myAvgPing > 1000 && myAvgPing <= 2000 ) {
|
||||
} else if(myAvgPing > 1000 && myAvgPing <= 2000 ) {
|
||||
pingColor.setNamedColor("yellow");
|
||||
}
|
||||
else if(myAvgPing > 2000) {
|
||||
} else if(myAvgPing > 2000) {
|
||||
pingColor.setNamedColor("red");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pingColor.setNamedColor("white");
|
||||
}
|
||||
QColor pen = pingColor.darker(200);
|
||||
// pen.setAlpha(130);
|
||||
// pen.setAlpha(130);
|
||||
painter.setPen(pen);
|
||||
QColor brush = pingColor;
|
||||
// brush.setAlpha(130);
|
||||
// brush.setAlpha(130);
|
||||
painter.setBrush(brush);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
painter.drawEllipse(1, 39, 10, 10);
|
||||
@@ -452,8 +449,7 @@ void MyAvatarLabel::refreshPing(unsigned minPing, unsigned avgPing, unsigned max
|
||||
toolTip.append("<br>"+tr("Minimum: ")+QString("%1").arg(myMinPing)+tr("ms"));
|
||||
toolTip.append("<br>"+tr("Maximum: ")+QString("%1").arg(myMaxPing)+tr("ms"));
|
||||
this->setToolTip(toolTip);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this->setToolTip("");
|
||||
}
|
||||
}
|
||||
|
||||
+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