kgamenetwork.cpp
71 kdDebug(11001) << k_funcinfo << "this=" << this <<", cookie=" << cookie() << " sizeof(this)="<<sizeof(KGameNetwork) << endl;
140 connect (d->mMessageClient, TQ_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList<TQ_UINT32>&)),
232 emit signalAdminStatusChanged(false); // as we delete the connection above isAdmin() is always false now!
385 bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
393 bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
396 bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
441 bool KGameNetwork::sendMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
444 bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
447 bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
450 void KGameNetwork::sendError(int error,const TQByteArray& message, TQ_UINT32 receiver, TQ_UINT32 sender)
461 void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, TQ_UINT32 clientID)
468 // kdDebug(11001) << k_funcinfo << "id=" << msgid << " sender=" << sender << " recv=" << receiver << endl;
KMessageServer * messageServer() const
Don't use this unless you really know what you are doing! You might experience some strange behaviour...
Definition: kgamenetwork.cpp:110
KMessageClient * messageClient() const
Don't use this unless you really know what youre doing! You might experience some strange behaviour i...
Definition: kgamenetwork.cpp:107
bool offerConnections(TQ_UINT16 port)
Inits a network game as network MASTER.
Definition: kgamenetwork.cpp:174
bool isAdmin() const
The admin of a game is the one who initializes newly connected clients using negotiateNetworkGame and...
Definition: kgamenetwork.cpp:104
void aboutToLoseConnection(TQ_UINT32 id)
Called when the network connection is about to terminate.
Definition: kgamenetwork.cpp:323
void receiveNetworkTransmission(const TQByteArray &a, TQ_UINT32 clientID)
Called by KMessageClient::broadcastReceived() and will check if the message format is valid.
Definition: kgamenetwork.cpp:461
virtual void lock()
You should call this before doing thigs like, e.g.
Definition: kgamenetwork.cpp:361
void signalClientDisconnected(TQ_UINT32 clientID, bool broken)
This signal is emitted whenever the KMessageServer sends us a message that a connection to a client w...
void slotResetConnection()
Called when the network connection is terminated.
Definition: kgamenetwork.cpp:329
void disconnect()
Disconnect the current connection and establish a new local one.
Definition: kgamenetwork.cpp:273
void signalClientConnected(TQ_UINT32 clientID)
This signal is emitted whenever the KMessageServer sends us a message that a new client connected.
bool sendSystemMessage(const TQByteArray &buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0)
Sends a network message msg with a given msg id msgid to all clients.
Definition: kgamenetwork.cpp:396
bool sendMessage(const TQByteArray &buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0)
Send a network message msg with a given message ID msgid to all clients.
Definition: kgamenetwork.cpp:447
bool isOfferingConnections() const
Are we still offer offering server connections - only for game MASTER.
Definition: kgamenetwork.cpp:270
void setMaxClients(int max)
Changes the maximal connection number of the KMessageServer to max.
Definition: kgamenetwork.cpp:348
void slotAdminStatusChanged(bool isAdmin)
This KGame object receives or loses the admin status.
Definition: kgamenetwork.cpp:498
void electAdmin(TQ_UINT32 clientID)
If you are the ADMIN of the game you can give the ADMIN status away to another client.
Definition: kgamenetwork.cpp:335
void signalConnectionBroken()
Our connection to the KMessageServer has broken.
void setDiscoveryInfo(const TQString &type, const TQString &name=TQString())
Announces game MASTER on network using DNS-SD.
Definition: kgamenetwork.cpp:150
void sendError(int error, const TQByteArray &message, TQ_UINT32 receiver=0, TQ_UINT32 sender=0)
Sends a network message.
Definition: kgamenetwork.cpp:450
KGameNetwork(int cookie=42, TQObject *parent=0)
Create a KGameNetwork object.
Definition: kgamenetwork.cpp:62
void signalNetworkErrorMessage(int error, TQString text)
A network error occurred.
bool connectToServer(const TQString &host, TQ_UINT16 port)
Inits a network game as a network CLIENT.
Definition: kgamenetwork.cpp:204
bool stopServerConnection()
Stops offering server connections - only for game MASTER.
Definition: kgamenetwork.cpp:259
virtual void networkTransmission(TQDataStream &, int, TQ_UINT32, TQ_UINT32, TQ_UINT32 clientID)=0
Called by ReceiveNetworkTransmission().
void signalAdminStatusChanged(bool isAdmin)
This client gets or loses the admin status.
void lock()
Once this function is called no message will be received anymore.
Definition: kmessageclient.cpp:354
void unlock()
Deliver every message that was delayed by lock() and actually deliver all messages that get received ...
Definition: kmessageclient.cpp:359
This abstract base class represents one end of a message connections between two clients.
Definition: kmessageio.h:57
A server for message sending and broadcasting, using TCP/IP connections.
Definition: kmessageserver.h:176