Source/ThunderBeast/QuakeToon/server/sv_ents.c
void SV_RecordDemoMessage (void)
{
	int			e;
	edict_t		*ent;
	entity_state_t	nostate;
	sizebuf_t	buf;
	byte		buf_data[32768];
	int			len;

	if (!svs.demofile)
		return;

	memset (&nostate, 0, sizeof(nostate));
	SZ_Init (&buf, buf_data, sizeof(buf_data));

	// write a frame message that doesn't contain a player_state_t
	MSG_WriteByte (&buf, svc_frame);
	MSG_WriteLong (&buf, sv.framenum);

	MSG_WriteByte (&buf, svc_packetentities);

	e = 1;
	ent = EDICT_NUM(e);
	while (e < ge->num_edicts) 
	{
		// ignore ents without visible models unless they have an effect
		if (ent->inuse &&
			ent->s.number && 
			(ent->s.modelindex || ent->s.effects || ent->s.sound || ent->s.event) && 
			!(ent->svflags & SVF_NOCLIENT))
			MSG_WriteDeltaEntity (&nostate, &ent->s, &buf, false, true);

		e++;
		ent = EDICT_NUM(e);
	}

	MSG_WriteShort (&buf, 0);		// end of packetentities

	// now add the accumulated multicast information
	SZ_Write (&buf, svs.demo_multicast.data, svs.demo_multicast.cursize);
	SZ_Clear (&svs.demo_multicast);

	// now write the entire message to the file, prefixed by the length
	len = LittleLong (buf.cursize);
	fwrite (&len, 4, 1, svs.demofile);
	fwrite (buf.data, buf.cursize, 1, svs.demofile);
}
/*
==================
SV_RecordDemoMessage

Save everything in the world out without deltas.
Used for recording footage for merged or assembled demos
==================
*/
SV_RecordDemoMessage
Save everything in the world out without deltas.
Used for recording footage for merged or assembled demos
SV_RecordDemoMessage Save everything in the world out without deltas . Used for recording footage for merged or assembled demos
void SV_RecordDemoMessage (void)
{
	int			e;
	edict_t		*ent;
	entity_state_t	nostate;
	sizebuf_t	buf;
	byte		buf_data[32768];
	int			len;
	if (!svs.demofile)
		return;
	memset (&nostate, 0, sizeof(nostate));
	SZ_Init (&buf, buf_data, sizeof(buf_data));
	MSG_WriteByte (&buf, svc_frame);
	MSG_WriteLong (&buf, sv.framenum);
	MSG_WriteByte (&buf, svc_packetentities);
	e = 1;
	ent = EDICT_NUM(e);
	while (e < ge->num_edicts) 
	{
		if (ent->inuse &&
			ent->s.number && 
			(ent->s.modelindex || ent->s.effects || ent->s.sound || ent->s.event) && 
			!(ent->svflags & SVF_NOCLIENT))
			MSG_WriteDeltaEntity (&nostate, &ent->s, &buf, false, true);
		e++;
		ent = EDICT_NUM(e);
	}
	MSG_WriteShort (&buf, 0);		
	SZ_Write (&buf, svs.demo_multicast.data, svs.demo_multicast.cursize);
	SZ_Clear (&svs.demo_multicast);
	len = LittleLong (buf.cursize);
	fwrite (&len, 4, 1, svs.demofile);
	fwrite (buf.data, buf.cursize, 1, svs.demofile);
}
void SV_RecordDemoMessage ( void ) { int e ; edict_t * ent ; entity_state_t nostate ; sizebuf_t buf ; byte buf_data [ 32768 ] ; int len ; if ( ! svs . demofile ) return ; memset ( & nostate , 0 , sizeof ( nostate ) ) ; SZ_Init ( & buf , buf_data , sizeof ( buf_data ) ) ; MSG_WriteByte ( & buf , svc_frame ) ; MSG_WriteLong ( & buf , sv . framenum ) ; MSG_WriteByte ( & buf , svc_packetentities ) ; e = 1 ; ent = EDICT_NUM ( e ) ; while ( e < ge -> num_edicts ) { if ( ent -> inuse && ent -> s . number && ( ent -> s . modelindex || ent -> s . effects || ent -> s . sound || ent -> s . event ) && ! ( ent -> svflags & SVF_NOCLIENT ) ) MSG_WriteDeltaEntity ( & nostate , & ent -> s , & buf , false , true ) ; e ++ ; ent = EDICT_NUM ( e ) ; } MSG_WriteShort ( & buf , 0 ) ; SZ_Write ( & buf , svs . demo_multicast . data , svs . demo_multicast . cursize ) ; SZ_Clear ( & svs . demo_multicast ) ; len = LittleLong ( buf . cursize ) ; fwrite ( & len , 4 , 1 , svs . demofile ) ; fwrite ( buf . data , buf . cursize , 1 , svs . demofile ) ; }
SV_RecordDemoMessage
Save everything in the world out without deltas.
SV_RecordDemoMessage Save everything in the world out without deltas .
// write a frame message that doesn't contain a player_state_t // ignore ents without visible models unless they have an effect // end of packetentities // now add the accumulated multicast information // now write the entire message to the file, prefixed by the length