Forum

X-Men Ravages of Apolcalypse Bug

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

X-Men Ravages of Apolcalypse Bug

Postby Baker » Wed Sep 22, 2010 5:19 am

In the first level, after getting all the keys you get a piece of the super weapon.

The message appears
"Well done. You have found the first part of the only weapon able to defeat Apocalypse. You will find other components that have been seperated and hidden by Apocalypse. If you are unsuccessful the age of Apocalypse will be unavoidable... Good luck. (pr"


... with a hologram of Magneto. And this message appears to be truncated.

This got reported as a modern ProQuake bug but it happens in every engine and doing some bug checking the string gets cut off at 255 characters. But the buffer reading the message is 1024 in size.

Is 255 or 256 some sort of message limitation in QuakeC or for centerprint in a way involving the protocol.

I'd just like to understand what is at play here. I'm not trying to extend a limit or anything ridiculous because I think 255 or 256 is plenty long. Just looking for infos.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Wed Sep 22, 2010 6:31 am

Ok ... here is why ...

Code: Select all
char *PF_VarString (int   first)
{
   int      i;
   static char out[256]; <------- Baker: Effective centerprint limit


Out is capped at 256 characters.

And ...

Code: Select all
/*
=================
PF_centerprint

single print to a specific client

centerprint(clientent, value)
=================
*/
void PF_centerprint (void)
{
   char      *s;
   client_t   *client;
   int         entnum;

   entnum = G_EDICTNUM(OFS_PARM0);
   s = PF_VarString (1); <--------- Baker: THIS IS WHY

   if (entnum < 1 || entnum > svs.maxclients)
   {
      Con_SafePrintf ("tried to sprint to a non-client\n");
      return;
   }

   client = &svs.clients[entnum-1];

   MSG_WriteChar (&client->message,svc_centerprint);
   MSG_WriteString (&client->message, s );
}
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Error » Wed Sep 22, 2010 6:33 am

User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Baker » Wed Sep 22, 2010 6:59 am



Doesn't look like it, I appear to be using that progs.dat as the filesize and date of July 2006 are identical.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest