mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Fix long chat messages causing net command failures
This commit is contained in:
parent
159be00109
commit
1377824799
1 changed files with 9 additions and 5 deletions
|
@ -634,7 +634,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
SINT8 target;
|
||||
UINT8 flags;
|
||||
const char *dispname;
|
||||
char *msg;
|
||||
char msgbuf[HU_MAXMSGLEN + 1];
|
||||
char *msg = msgbuf;
|
||||
boolean action = false;
|
||||
char *ptr;
|
||||
INT32 spam_eatmsg = 0;
|
||||
|
@ -643,8 +644,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
|||
|
||||
target = READSINT8(*p);
|
||||
flags = READUINT8(*p);
|
||||
msg = (char *)*p;
|
||||
SKIPSTRINGN(*p, HU_MAXMSGLEN);
|
||||
READSTRINGN(*p, msgbuf, HU_MAXMSGLEN);
|
||||
|
||||
if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum)))
|
||||
{
|
||||
|
@ -913,7 +913,11 @@ static void HU_sendChatMessage(void)
|
|||
if (c >= ' ' && !(c & 0x80))
|
||||
buf[ci] = c;
|
||||
};
|
||||
buf[ci] = '\0';
|
||||
if (ci-2 < HU_MAXMSGLEN)
|
||||
{
|
||||
buf[ci] = '\0';
|
||||
ci++;
|
||||
}
|
||||
|
||||
memset(w_chat, '\0', sizeof(w_chat));
|
||||
c_input = 0;
|
||||
|
@ -981,7 +985,7 @@ static void HU_sendChatMessage(void)
|
|||
{
|
||||
buf[0] = teamtalk ? -1 : target; // target
|
||||
buf[1] = 0; // flags
|
||||
SendNetXCmd(XD_SAY, buf, 2 + strlen(&buf[2]) + 1);
|
||||
SendNetXCmd(XD_SAY, buf, ci);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue