23 #include "rconprotocol.h" 24 #include "serverapi/server.h" 32 QList<Player> players;
33 QHostAddress serverAddress;
47 d->serverAddress = server->
address();
48 d->serverPort = server->port();
52 set_disconnectFromServer(&RConProtocol::disconnectFromServer_default);
53 set_sendCommand(&RConProtocol::sendCommand_default);
54 set_sendPassword(&RConProtocol::sendPassword_default);
57 RConProtocol::~RConProtocol()
64 POLYMORPHIC_DEFINE(
void, RConProtocol,
sendPassword, (const QString &password), (password))
66 const QHostAddress &RConProtocol::
address()
const 68 return d->serverAddress;
71 void RConProtocol::disconnectFromServer_default()
73 assert(0 &&
"RConProtocol::disconnectFromServer() is not implemented");
96 void RConProtocol::sendCommand_default(
const QString &cmd)
99 assert(0 &&
"RConProtocol::sendCommand() is not implemented");
102 void RConProtocol::sendPassword_default(
const QString &password)
105 assert(0 &&
"RConProtocol::sendPassword() is not implemented");
void setConnected(bool b)
Set this to true when connection is successfully established, set to false upon disconnect.
QList< Player > & playersMutable()
Accessor to players list that allows modification.
const QHostAddress & address() const
Address of the server to which this remote console should connect.
bool isConnected() const
Whether connection is established or not.
const QList< Player > & players() const
List of players present on the server.
Remote console protocol interface.
void sendPassword(const QString &password)
[Pure Virtual] Send remote console password.
QUdpSocket & socket()
UDP socket that can be used to communicate with remote server.
void sendCommand(const QString &cmd)
[Pure Virtual] Send command to remote server.
void disconnectFromServer()
[Pure Virtual] Close connection with the server.
quint16 port() const
Port of the server to which this remote console should connect.