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 (#7852)
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
99bdcebf2e
commit
35232cbcf1
2 changed files with 7 additions and 10 deletions
|
|
@ -37,7 +37,7 @@
|
|||
#include <server_protocolhandler.h>
|
||||
|
||||
class Servatrice;
|
||||
class Servatrice_DatabaseInterface;
|
||||
class Server_DatabaseInterface;
|
||||
class DeckList;
|
||||
class ServerInfo_DeckStorage_Folder;
|
||||
class Command_AddToList;
|
||||
|
|
@ -247,7 +247,7 @@ private:
|
|||
|
||||
public:
|
||||
AbstractServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
Server_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent = 0);
|
||||
~AbstractServerSocketInterface()
|
||||
{
|
||||
|
|
@ -264,9 +264,7 @@ class TcpServerSocketInterface : public AbstractServerSocketInterface
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TcpServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent = 0);
|
||||
TcpServerSocketInterface(Servatrice *_server, Server_DatabaseInterface *_databaseInterface, QObject *parent = 0);
|
||||
~TcpServerSocketInterface();
|
||||
|
||||
QHostAddress getPeerAddress() const
|
||||
|
|
@ -312,7 +310,7 @@ class WebsocketServerSocketInterface : public AbstractServerSocketInterface
|
|||
Q_OBJECT
|
||||
public:
|
||||
WebsocketServerSocketInterface(Servatrice *_server,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
Server_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent = nullptr);
|
||||
~WebsocketServerSocketInterface();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue