Add another network broadcast mode.
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
Reference in New Issue
Block a user