C-chat
communication.h
Go to the documentation of this file.
1 
6 #ifndef C_CHAT_COMMUNICATION_H
7 #define C_CHAT_COMMUNICATION_H
8 
9 #include "../common/packets.h"
10 #include "server.h"
11 
18 void broadcastRoom(Packet* packet, Room* room);
19 
26 void syncBroadcastRoom(Packet* packet, Room* room);
27 
34 void handleTextMessageRelay(Client* client, struct PacketText* packet);
35 
36 #endif //C_CHAT_COMMUNICATION_H
PacketText
This packet is sent to all clients of a room when a client sends a message.
Definition: packets.h:41
Packet
A generic union type for packets.
Definition: packets.h:221
Room
Definition: server.h:67
handleTextMessageRelay
void handleTextMessageRelay(Client *client, struct PacketText *packet)
Processes a received PacketText.
Definition: communication.c:29
Client
A type representing a connected client.
Definition: server.h:27
syncBroadcastRoom
void syncBroadcastRoom(Packet *packet, Room *room)
Broadcast a packet to all clients of the given room with room-lock acquirement.
Definition: communication.c:25
server.h
Header file for server.c.
broadcastRoom
void broadcastRoom(Packet *packet, Room *room)
Broadcast a packet to all clients of the given room.
Definition: communication.c:17