ddnet / ddnet

DDraceNetwork, a free cooperative platformer game
https://ddnet.org
Other
578 stars 412 forks source link

Extend broadcast functionalities #4897

Open miguilimzero opened 2 years ago

miguilimzero commented 2 years ago

The idea is to extend the broadcast functionality by making the following detailed changes:

Handle correctly the break lines on broadcast (Client):

Details to discuss:

Add native bottom broadcast (Client & Server):

Details to discuss:

Add colors support for broadcast (Client & Server):

Details to discuss:

How the broadcast is colorized in Teeworlds 0.7:

CNetMsg_Sv_Broadcast chatMsg;
char msgBuff[256];
str_format(msgBuff, sizeof(msgBuff), "WAVE ^980%d ^999(%d zombies)", waveID + 1,
        m_WaveSpawnCount[waveID]);
chatMsg.m_pMessage = msgBuff;
Server()->SendPackMsg(&chatMsg, MSGFLAG_VITAL, -1);

Screenshot with the result on Zomb 0.7 version (From Teeworlds forum, didn't tested by myself):

image

def- commented 2 years ago

I‘m fine with enabling 0.7 style broadcasts, can probably also take some of the code.

Is this something you‘re interested in for your mods? DDNet itself doesn‘t use any fancy broadcasts, just map announcements

miguilimzero commented 2 years ago

@def- Yes. These broadcast changes is mainly focused for mods. Bottom broadcast maybe fits only for mods. Colored broadcast could fits for normal broadcast by servers owners/moderators.

An hypothetical example for a use of DDNet would be to announce an event with the date highlighted in green.