C-chat
Functions
communication.h File Reference

Regroup functions that aim to communicate with clients. More...

#include "../common/packets.h"
#include "server.h"

Go to the source code of this file.

Functions

void broadcastRoom (Packet *packet, Room *room)
 Broadcast a packet to all clients of the given room. More...
 
void syncBroadcastRoom (Packet *packet, Room *room)
 Broadcast a packet to all clients of the given room with room-lock acquirement. More...
 
void handleTextMessageRelay (Client *client, struct PacketText *packet)
 Processes a received PacketText. More...
 

Detailed Description

Regroup functions that aim to communicate with clients.

Function Documentation

◆ broadcastRoom()

void broadcastRoom ( Packet packet,
Room room 
)

Broadcast a packet to all clients of the given room.

Parameters
packetThe packet to broadcast
roomThe room

◆ handleTextMessageRelay()

void handleTextMessageRelay ( Client client,
struct PacketText packet 
)

Processes a received PacketText.

Parameters
clientThe client who sent the packet
packetThe received packet

◆ syncBroadcastRoom()

void syncBroadcastRoom ( Packet packet,
Room room 
)

Broadcast a packet to all clients of the given room with room-lock acquirement.

Parameters
packetThe packet to broadcast
roomThe room