mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 20:13:24 -08:00
[Server] Accept the database interface in the socket handler constructors
AbstractServerSocketInterface and its Tcp and Websocket subclasses still took a concrete Servatrice_DatabaseInterface pointer, so the handler could not be constructed with anything but the MySQL implementation even though its body now speaks only Server_DatabaseInterface. Retype the three constructors and drop the now-unused servatrice_database_interface.h include. Callers pass the pool's Servatrice_DatabaseInterface, which converts to the base pointer, so behaviour is unchanged.
This commit is contained in:
parent
4007a88e67
commit
9ef1bbed5d
2 changed files with 7 additions and 10 deletions
|
|
@ -37,7 +37,6 @@
|
|||
#include "main.h"
|
||||
#include "metrics_registry.h"
|
||||
#include "servatrice.h"
|
||||
#include "servatrice_database_interface.h"
|
||||
#include "server.h"
|
||||
#include "server_database_interface.h"
|
||||
#include "server_logger.h"
|
||||
|
|
@ -192,7 +191,7 @@ static const int protocolVersion = 14;
|
|||
static const int MAX_TCP_MESSAGE_SIZE = 1500000;
|
||||
|
||||
AbstractServerSocketInterface::AbstractServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
Server_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent)
|
||||
: Server_ProtocolHandler(_server, _databaseInterface, parent), servatrice(_server)
|
||||
{
|
||||
|
|
@ -3674,7 +3673,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdUpdateAdminNotes(const
|
|||
}
|
||||
|
||||
TcpServerSocketInterface::TcpServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
Server_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent)
|
||||
: AbstractServerSocketInterface(_server, _databaseInterface, parent), messageInProgress(false),
|
||||
handshakeStarted(false)
|
||||
|
|
@ -3869,7 +3868,7 @@ bool TcpServerSocketInterface::initTcpSession()
|
|||
}
|
||||
|
||||
WebsocketServerSocketInterface::WebsocketServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
Server_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent)
|
||||
: AbstractServerSocketInterface(_server, _databaseInterface, parent), socket(nullptr)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue