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.62 by root, Mon Oct 12 14:00:59 2009 UTC vs.
Revision 1.67 by root, Mon Apr 12 05:22:38 2010 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001,2007 Mark Wedel
6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 5 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 6 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 7 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 8 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 9 * option) any later version.
20 * <http://www.gnu.org/licenses/>. 18 * <http://www.gnu.org/licenses/>.
21 * 19 *
22 * The authors can be reached via e-mail to <support@deliantra.net> 20 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 21 */
24 22
25/** 23/*
26 * \file
27 * Socket general functions 24 * Socket general functions
28 *
29 * \date 2003-12-02
30 *
31 * Mainly deals with initialization and higher level socket
32 * maintenance (checking for lost connections and if data has arrived.)
33 * The reading of data is handled in ericserver.c
34 */ 25 */
35 26
36#include <global.h> 27#include <global.h>
37#include <sproto.h> 28#include <sproto.h>
38#include <sys/types.h> 29#include <sys/types.h>
155 socket_ev.set (fd, EV_READ); 146 socket_ev.set (fd, EV_READ);
156 socket_ev.prio (2); // one higher than the ticker priority 147 socket_ev.prio (2); // one higher than the ticker priority
157 socket_ev.start (); 148 socket_ev.start ();
158 149
159 // initialisation done, kick it! 150 // initialisation done, kick it!
160 send_packet_printf ("version %d %d %s\n", VERSION_CS, VERSION_SC, VERSION_INFO); 151 INVOKE_CLIENT (CONNECT, this);
152
161 flush (); 153 flush ();
162 154
163 reset_stats (); 155 reset_stats ();
164 156
165 clients.insert (this); 157 clients.insert (this);
176} 168}
177 169
178void 170void
179client::do_destroy () 171client::do_destroy ()
180{ 172{
173 INVOKE_CLIENT (CLIENT_DESTROY, this);
181 attachable::do_destroy (); 174 attachable::do_destroy ();
182 175
183 if (pl) 176 if (pl)
184 pl->disconnect (); 177 pl->disconnect ();
185 178
230 223
231client * 224client *
232client::create (int fd, const char *peername) 225client::create (int fd, const char *peername)
233{ 226{
234 client *ns = new client (dup (fd), peername); 227 client *ns = new client (dup (fd), peername);
228
235 ns->instantiate (); // effectively a nop right now 229 ns->instantiate (); // effectively a nop right now
236 INVOKE_CLIENT (CONNECT, ns); 230
237 return ns; 231 return ns;
238} 232}
239 233

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines