ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/init.C
(Generate patch)

Comparing deliantra/server/socket/init.C (file contents):
Revision 1.11 by root, Wed Dec 13 02:55:51 2006 UTC vs.
Revision 1.12 by root, Thu Dec 14 00:01:35 2006 UTC

110 /* we should really do some checking here - if total clients overflows 110 /* we should really do some checking here - if total clients overflows
111 * we need to do something more intelligent, because client id's will start 111 * we need to do something more intelligent, because client id's will start
112 * duplicating (not likely in normal cases, but malicous attacks that 112 * duplicating (not likely in normal cases, but malicous attacks that
113 * just open and close connections could get this total up. 113 * just open and close connections could get this total up.
114 */ 114 */
115 ns->inbuf.len = 0; 115 ns->inbuf_len = 0;
116 ns->inbuf.buf = (unsigned char *) malloc (sizeof (unsigned char) * MAXSOCKBUF); 116
117 /* Basic initialization. Needed because we do a check in 117 /* Basic initialization. Needed because we do a check in
118 * HandleClient for oldsocketmode without checking the 118 * HandleClient for oldsocketmode without checking the
119 * length of data. 119 * length of data.
120 */ 120 */
121 memset (ns->inbuf.buf, 0, sizeof (unsigned char) * MAXSOCKBUF);
122 memset (&ns->lastmap, 0, sizeof (struct Map)); 121 memset (&ns->lastmap, 0, sizeof (struct Map));
123 memset (ns->faces_sent, 0, ns->faces_sent_len * sizeof (*ns->faces_sent)); 122 memset (ns->faces_sent, 0, ns->faces_sent_len * sizeof (*ns->faces_sent));
124 memset (&ns->anims_sent, 0, sizeof (ns->anims_sent)); 123 memset (&ns->anims_sent, 0, sizeof (ns->anims_sent));
125 memset (&ns->stats, 0, sizeof (struct statsinfo)); 124 memset (&ns->stats, 0, sizeof (struct statsinfo));
126 /* Do this so we don't send a face command for the client for 125 /* Do this so we don't send a face command for the client for
263 262
264 if (ns->stats.title) 263 if (ns->stats.title)
265 free (ns->stats.title); 264 free (ns->stats.title);
266 265
267 free (ns->host); 266 free (ns->host);
268 free (ns->inbuf.buf);
269} 267}
270 268
271/** Sends the 'goodbye' command to the player, and closes connection. */ 269/** Sends the 'goodbye' command to the player, and closes connection. */
272void 270void
273final_free_player (player *pl) 271final_free_player (player *pl)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines