KDEGames
9 #ifndef __KGAMENETWORK_H_
10 #define __KGAMENETWORK_H_
13 #include "libkdegamesprivate_export.h"
25 class KGameNetworkPrivate;
58 bool isNetwork()
const;
72 bool isMaster()
const;
91 quint32 gameId()
const;
103 bool offerConnections (quint16 port);
115 bool connectToServer(
const QString&
host, quint16 port);
123 quint16 port()
const;
136 bool stopServerConnection();
148 void setMaxClients(
int max);
173 bool sendSystemMessage(
const QByteArray& buffer,
int msgid, quint32 receiver=0, quint32 sender=0);
178 bool sendSystemMessage(
int data,
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);
201 void sendError(
int error,
const QByteArray&
message, quint32 receiver=0, quint32 sender=0);
207 bool isOfferingConnections()
const;
249 bool sendMessage(
const QByteArray& buffer,
int msgid, quint32 receiver=0, quint32 sender=0);
254 bool sendMessage(
const QDataStream &msg,
int msgid, quint32 receiver=0, quint32 sender=0);
259 bool sendMessage(
const QString& msg,
int msgid, quint32 receiver=0, quint32 sender=0);
264 bool sendMessage(
int data,
int msgid, quint32 receiver=0, quint32 sender=0);
271 virtual void networkTransmission(
QDataStream&,
int, quint32, quint32, quint32 clientID) = 0;
288 void electAdmin(quint32 clientID);
321 virtual void unlock();
329 void signalNetworkErrorMessage(
int error,
const QString &text);
335 void signalConnectionBroken();
346 void signalClientConnected(quint32 clientID);
359 void signalClientDisconnected(quint32 clientID,
bool broken);
366 void signalAdminStatusChanged(
bool isAdmin);
385 void receiveNetworkTransmission(
const QByteArray& a, quint32 clientID);
391 void slotAdminStatusChanged(
bool isAdmin);
397 void aboutToLoseConnection(quint32
id);
403 void slotResetConnection();
408 void tryStopPublishing();
411 std::unique_ptr<KGameNetworkPrivate>
const d;
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Base class for IO devices for games.
ScriptableExtension * host() const
The main KDE game object.
A server for message sending and broadcasting, using TCP/IP connections.
A client to connect to a KMessageServer.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue May 17 2022 03:46:11 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.