KDEGames
kmessageserver.h
This abstract base class represents one end of a message connections between two clients.
Definition kmessageio.h:44
void removeClient(KMessageIO *io, bool broken)
Removes the KMessageIO object from the client list and deletes it.
Definition kmessageserver.cpp:202
void clientConnected(KMessageIO *client)
A new client connected to the game.
KMessageIO * findClient(quint32 no) const
Find the KMessageIO object to the given client number.
Definition kmessageserver.cpp:267
quint32 adminID() const
Returns the clientID of the admin, if there is a admin, 0 otherwise.
Definition kmessageserver.cpp:281
void setMaxClients(int maxnumber)
sets the maximum number of clients which can connect.
Definition kmessageserver.cpp:243
virtual void getReceivedMessage(const QByteArray &msg)
This slot receives all the messages from the KMessageIO::received signals.
Definition kmessageserver.cpp:335
quint16 serverPort() const
Returns the TCP/IP port number we are listening to for incoming connections.
Definition kmessageserver.cpp:133
void addClient(KMessageIO *)
Adds a new KMessageIO object to the communication server.
Definition kmessageserver.cpp:156
void setAdmin(quint32 adminID)
Sets the admin to a new client with the given ID.
Definition kmessageserver.cpp:286
virtual void processOneMessage()
This slot is called whenever there are elements in the message queue.
Definition kmessageserver.cpp:354
quint32 uniqueClientNumber() const
Definition kmessageserver.cpp:308
bool initNetwork(quint16 port=0)
Starts the Communication server to listen for incoming TCP/IP connections.
Definition kmessageserver.cpp:109
void messageReceived(const QByteArray &data, quint32 clientID, bool &unknown)
This signal is always emitted when a message from a client is received.
void connectionLost(KMessageIO *client)
A network connection got broken.
virtual void broadcastMessage(const QByteArray &msg)
Sends a message to all connected clients.
Definition kmessageserver.cpp:315
virtual void sendMessage(quint32 id, const QByteArray &msg)
Sends a message to a single client with the given ID.
Definition kmessageserver.cpp:321
KMessageServer(quint16 cookie=42, QObject *parent=nullptr)
Create a KGameNetwork object.
Definition kmessageserver.cpp:89
bool isOfferingConnections() const
Are we still offer offering server connections?
Definition kmessageserver.cpp:149
QList< quint32 > clientIDs() const
returns a list of the unique IDs of all clients.
Definition kmessageserver.cpp:258
int clientCount() const
returns the current number of connected clients.
Definition kmessageserver.cpp:253
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:53:12 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:53:12 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.