kmessageserver.h
TQ_UINT32 uniqueClientNumber() const
Definition: kmessageserver.cpp:335
KMessageIO * findClient(TQ_UINT32 no) const
Find the KMessageIO object to the given client number.
Definition: kmessageserver.cpp:291
TQ_UINT16 serverPort() const
Returns the TCP/IP port number we are listening to for incoming connections.
Definition: kmessageserver.cpp:146
int clientCount() const
returns the current number of connected clients.
Definition: kmessageserver.cpp:278
void removeClient(KMessageIO *io, bool broken)
Removes the KMessageIO object from the client list and deletes it.
Definition: kmessageserver.cpp:223
void addClient(KMessageIO *)
Adds a new KMessageIO object to the communication server.
Definition: kmessageserver.cpp:170
void clientConnected(KMessageIO *client)
A new client connected to the game.
TQ_UINT32 adminID() const
Returns the clientID of the admin, if there is a admin, 0 otherwise.
Definition: kmessageserver.cpp:306
KMessageServer(TQ_UINT16 cookie=42, TQObject *parent=0)
Create a KGameNetwork object.
Definition: kmessageserver.cpp:89
void messageReceived(const TQByteArray &data, TQ_UINT32 clientID, bool &unknown)
This signal is always emitted when a message from a client is received.
This abstract base class represents one end of a message connections between two clients.
Definition: kmessageio.h:56
bool initNetwork(TQ_UINT16 port=0)
Starts the Communication server to listen for incoming TCP/IP connections.
Definition: kmessageserver.cpp:118
A server for message sending and broadcasting, using TCP/IP connections.
Definition: kmessageserver.h:175
void setAdmin(TQ_UINT32 adminID)
Sets the admin to a new client with the given ID.
Definition: kmessageserver.cpp:311
virtual void getReceivedMessage(const TQByteArray &msg)
This slot receives all the messages from the KMessageIO::received signals.
Definition: kmessageserver.cpp:361
virtual void processOneMessage()
This slot is called whenever there are elements in the message queue.
Definition: kmessageserver.cpp:382
virtual void sendMessage(TQ_UINT32 id, const TQByteArray &msg)
Sends a message to a single client with the given ID.
Definition: kmessageserver.cpp:348
TQValueList< TQ_UINT32 > clientIDs() const
returns a list of the unique IDs of all clients.
Definition: kmessageserver.cpp:283
virtual void broadcastMessage(const TQByteArray &msg)
Sends a message to all connected clients.
Definition: kmessageserver.cpp:342
bool isOfferingConnections() const
Are we still offer offering server connections?
Definition: kmessageserver.cpp:163
void connectionLost(KMessageIO *client)
A network connection got broken.
void setMaxClients(int maxnumber)
sets the maximum number of clients which can connect.
Definition: kmessageserver.cpp:268