Merge branch 'stable' into rejoin_rebuy

This commit is contained in:
sco44
2020-11-15 01:55:48 +01:00
12 changed files with 62499 additions and 41000 deletions
+4 -3
View File
@@ -8,14 +8,15 @@ Makefile.pokerth_protocol
Makefile.pokerth_server
Makefile.pokerth_dbofficial
bin/
chatcleaner
/chatcleaner
lib/
mocs/
obj/
pokerth
/pokerth
qrc_pokerth.cpp
uics/
make.sh
gitpush_serverstuff_stable
pokerth_server
.vscode/
.project
.classpath
+1 -1
View File
@@ -6,7 +6,7 @@ official_server {
SUBDIRS += pokerth_dbofficial.pro
}
client: {
SUBDIRS += pokerth_game.pro
# SUBDIRS += pokerth_game.pro
}
!mac:!gui_800x480:!client:!qml-client {
SUBDIRS += pokerth_server.pro chatcleaner.pro
+3 -3
View File
@@ -105,7 +105,7 @@ AsioReceiveBuffer::ScanPackets(boost::shared_ptr<SessionData> session)
size_t packetSize = ntohl(nativeVal);
if (packetSize > MAX_PACKET_SIZE) {
recvBufUsed = 0;
LOG_ERROR("Session " << session->GetId() << " - Invalid packet size: " << packetSize);
LOG_ERROR(session->GetClientAddr() << "Session " << session->GetId() << " - Invalid packet size: " << packetSize);
} else if (recvBufUsed >= packetSize + NET_HEADER_SIZE) {
try {
tmpPacket = NetPacket::Create(&recvBuf[NET_HEADER_SIZE], packetSize);
@@ -118,7 +118,7 @@ AsioReceiveBuffer::ScanPackets(boost::shared_ptr<SessionData> session)
} catch (const exception &e) {
// Reset buffer on error.
recvBufUsed = 0;
LOG_ERROR("Session " << session->GetId() << " - " << e.what());
LOG_ERROR(session->GetClientAddr() << "Session " << session->GetId() << " - " << e.what());
}
}
}
@@ -126,7 +126,7 @@ AsioReceiveBuffer::ScanPackets(boost::shared_ptr<SessionData> session)
if (validator.IsValidPacket(*tmpPacket)) {
receivedPackets.push_back(tmpPacket);
} else {
LOG_ERROR("Session " << session->GetId() << " - Invalid packet: " << tmpPacket->GetMsg()->messagetype());
LOG_ERROR(session->GetClientAddr() << "Session " << session->GetId() << " - Invalid packet: " << tmpPacket->GetMsg()->messagetype());
}
} else {
dataAvailable = false;
+3 -2
View File
@@ -63,6 +63,7 @@
#include <boost/algorithm/string.hpp>
#include <gsasl.h>
#include <ctime>
#include <string>
#define SERVER_MAX_NUM_LOBBY_SESSIONS 1536 // Maximum number of idle users in lobby.
#define SERVER_MAX_NUM_TOTAL_SESSIONS 2000 // Total maximum of sessions, fitting a 2048 handle limit
@@ -304,8 +305,8 @@ ServerLobbyThread::AddConnection(boost::shared_ptr<SessionData> sessionData)
// Create a new session.
m_sessionManager.AddSession(sessionData);
LOG_VERBOSE("Accepted connection - session #" << sessionData->GetId() << ".");
LOG_ERROR("Accepted connection - session #" << sessionData->GetId() << ".");
LOG_VERBOSE(sessionData->GetRemoteIPAddressFromSocket() << " Accepted connection - session #" << sessionData->GetId() << ".");
LOG_ERROR(sessionData->GetRemoteIPAddressFromSocket() << " Accepted connection - session #" << sessionData->GetId() << ".");
sessionData->StartTimerInitTimeout(SERVER_INIT_SESSION_TIMEOUT_SEC);
sessionData->StartTimerGlobalTimeout(SERVER_SESSION_FORCED_TIMEOUT_SEC);
+1563 -1111
View File
File diff suppressed because it is too large Load Diff
+1829 -947
View File
File diff suppressed because it is too large Load Diff
+32661 -25531
View File
File diff suppressed because it is too large Load Diff
+26425 -13386
View File
File diff suppressed because it is too large Load Diff
@@ -311,9 +311,10 @@ public:
* needed.
*/
timer_ptr set_timer(long duration, timer_handler callback) {
timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
lib::ref(*m_io_service),
lib::asio::milliseconds(duration)
timer_ptr new_timer(
new lib::asio::steady_timer(
*m_io_service,
lib::asio::milliseconds(duration))
);
if (config::enable_multithreading) {
@@ -461,8 +462,7 @@ protected:
m_io_service = io_service;
if (config::enable_multithreading) {
m_strand = lib::make_shared<lib::asio::io_service::strand>(
lib::ref(*io_service));
m_strand.reset(new lib::asio::io_service::strand(*io_service));
}
lib::error_code ec = socket_con_type::init_asio(io_service, m_strand,
@@ -191,8 +191,7 @@ public:
m_io_service = ptr;
m_external_io_service = true;
m_acceptor = lib::make_shared<lib::asio::ip::tcp::acceptor>(
lib::ref(*m_io_service));
m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service));
m_state = READY;
ec = lib::error_code();
@@ -660,9 +659,7 @@ public:
* @since 0.3.0
*/
void start_perpetual() {
m_work = lib::make_shared<lib::asio::io_service::work>(
lib::ref(*m_io_service)
);
m_work.reset(new lib::asio::io_service::work(*m_io_service));
}
/// Clears the endpoint's perpetual flag, allowing it to exit when empty
@@ -826,8 +823,7 @@ protected:
// Create a resolver
if (!m_resolver) {
m_resolver = lib::make_shared<lib::asio::ip::tcp::resolver>(
lib::ref(*m_io_service));
m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service));
}
tcon->set_uri(u);
@@ -168,8 +168,7 @@ protected:
return socket::make_error_code(socket::error::invalid_state);
}
m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
lib::ref(*service));
m_socket.reset(new lib::asio::ip::tcp::socket(*service));
m_state = READY;
@@ -193,8 +193,7 @@ protected:
if (!m_context) {
return socket::make_error_code(socket::error::invalid_tls_context);
}
m_socket = lib::make_shared<socket_type>(
_WEBSOCKETPP_REF(*service),lib::ref(*m_context));
m_socket.reset(new socket_type(*service, *m_context));
m_io_service = service;
m_strand = strand;