kgamenetwork.h
193 bool sendSystemMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
203 bool sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
208 bool sendSystemMessage(const TQString& msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
221 void sendError(int error, const TQByteArray& message, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
269 bool sendMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
291 virtual void networkTransmission(TQDataStream&, int, TQ_UINT32, TQ_UINT32, TQ_UINT32 clientID) = 0;
KMessageServer * messageServer() const
Don't use this unless you really know what you are doing!
Definition kgamenetwork.cpp:110
KMessageClient * messageClient() const
Don't use this unless you really know what youre doing!
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.
A server for message sending and broadcasting, using TCP/IP connections.
Definition kmessageserver.h:176
Trinity API Reference