Add another network broadcast mode.

pull/16/head
Jonathan G Rennison 7 years ago
parent 49e922daa6
commit c70a60fd18

@ -1363,15 +1363,17 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
DEBUG(net, 0, "[server] received unknown chat destination type %d. Doing broadcast instead", desttype);
/* FALL THROUGH */
case DESTTYPE_BROADCAST:
case DESTTYPE_BROADCAST_SS:
FOR_ALL_CLIENT_SOCKETS(cs) {
cs->SendChat(action, from_id, false, msg, data);
cs->SendChat(action, from_id, (desttype == DESTTYPE_BROADCAST_SS && from_id == cs->client_id), msg, data);
}
NetworkAdminChat(action, desttype, from_id, msg, data, from_admin);
ci = NetworkClientInfo::GetByClientID(from_id);
if (ci != NULL) {
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas), false, ci->client_name, msg, data);
NetworkTextMessage(action, GetDrawStringCompanyColour(ci->client_playas),
(desttype == DESTTYPE_BROADCAST_SS && from_id == CLIENT_ID_SERVER), ci->client_name, msg, data);
}
break;
}

@ -81,6 +81,7 @@ enum NetworkPasswordType {
/** Destination of our chat messages. */
enum DestType {
DESTTYPE_BROADCAST, ///< Send message/notice to all clients (All)
DESTTYPE_BROADCAST_SS, ///< Send message/notice to all clients (All), but tag the broadcast to self as a self-send
DESTTYPE_TEAM, ///< Send message/notice to everyone playing the same company (Team)
DESTTYPE_CLIENT, ///< Send message/notice to only a certain client (Private)
};

Loading…
Cancel
Save