KDEGames
kgamenetwork.h
173 bool sendSystemMessage(const QByteArray &buffer, int msgid, quint32 receiver = 0, quint32 sender = 0);
183 bool sendSystemMessage(const QDataStream &msg, int msgid, quint32 receiver = 0, quint32 sender = 0);
188 bool sendSystemMessage(const QString &msg, int msgid, quint32 receiver = 0, quint32 sender = 0);
249 bool sendMessage(const QByteArray &buffer, int msgid, quint32 receiver = 0, quint32 sender = 0);
KMessageServer * messageServer() const
Don't use this unless you really know what you are doing!
Definition kgamenetwork.cpp:99
KMessageClient * messageClient() const
Don't use this unless you really know what you're doing!
Definition kgamenetwork.cpp:94
bool isAdmin() const
The admin of a game is the one who initializes newly connected clients using negotiateNetworkGame and...
Definition kgamenetwork.cpp:89
void signalClientConnected(quint32 clientID)
This signal is emitted whenever the KMessageServer sends us a message that a new client connected.
bool connectToServer(const QString &host, quint16 port)
Inits a network game as a network CLIENT.
Definition kgamenetwork.cpp:193
virtual void lock()
You should call this before doing thigs like, e.g.
Definition kgamenetwork.cpp:353
KGameNetwork(int cookie=42, QObject *parent=nullptr)
Create a KGameNetwork object.
Definition kgamenetwork.cpp:41
virtual void networkTransmission(QDataStream &, int, quint32, quint32, quint32 clientID)=0
Called by ReceiveNetworkTransmission().
void electAdmin(quint32 clientID)
If you are the ADMIN of the game you can give the ADMIN status away to another client.
Definition kgamenetwork.cpp:327
void slotResetConnection()
Called when the network connection is terminated.
Definition kgamenetwork.cpp:321
bool sendMessage(const QByteArray &buffer, int msgid, quint32 receiver=0, quint32 sender=0)
Send a network message msg with a given message ID msgid to all clients.
Definition kgamenetwork.cpp:444
void aboutToLoseConnection(quint32 id)
Called when the network connection is about to terminate.
Definition kgamenetwork.cpp:315
bool isOfferingConnections() const
Are we still offer offering server connections - only for game MASTER.
Definition kgamenetwork.cpp:268
void setMaxClients(int max)
Changes the maximal connection number of the KMessageServer to max.
Definition kgamenetwork.cpp:340
bool offerConnections(quint16 port)
Inits a network game as network MASTER.
Definition kgamenetwork.cpp:163
void slotAdminStatusChanged(bool isAdmin)
This KGame object receives or loses the admin status.
Definition kgamenetwork.cpp:489
void signalConnectionBroken()
Our connection to the KMessageServer has broken.
void signalNetworkErrorMessage(int error, const QString &text)
A network error occurred.
void signalClientDisconnected(quint32 clientID, bool broken)
This signal is emitted whenever the KMessageServer sends us a message that a connection to a client w...
void receiveNetworkTransmission(const QByteArray &a, quint32 clientID)
Called by KMessageClient::broadcastReceived() and will check if the message format is valid.
Definition kgamenetwork.cpp:459
bool stopServerConnection()
Stops offering server connections - only for game MASTER.
Definition kgamenetwork.cpp:257
void sendError(int error, const QByteArray &message, quint32 receiver=0, quint32 sender=0)
Sends a network message.
Definition kgamenetwork.cpp:449
void signalAdminStatusChanged(bool isAdmin)
This client gets or loses the admin status.
bool sendSystemMessage(const QByteArray &buffer, int msgid, quint32 receiver=0, quint32 sender=0)
Sends a network message msg with a given msg id msgid to all clients.
Definition kgamenetwork.cpp:390
This abstract base class represents one end of a message connections between two clients.
Definition kmessageio.h:44
A server for message sending and broadcasting, using TCP/IP connections.
Definition kmessageserver.h:167
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
bool disconnect(const QMetaObject::Connection &connection)
QObject * parent() const const
QObject * sender() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:50:36 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:50:36 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.