--- deliantra/server/socket/lowlevel.C 2007/04/23 19:10:17 1.39 +++ deliantra/server/socket/lowlevel.C 2007/05/28 21:22:26 1.42 @@ -1,26 +1,26 @@ /* - * CrossFire, A Multiplayer game for X-windows + * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. * - * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - * Copyright (C) 1992 Frank Tore Johansen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 1992,2007 Frank Tore Johansen + * + * Crossfire TRT is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. * - * The author can be reached via e-mail to mark@pyramid.com + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The authors can be reached via e-mail to */ - + /** * \file * Low-level socket-related functions. @@ -513,6 +513,22 @@ send_packet_printf ("drawinfo %d %s", flags, msg); } +void +client::send_msg (int color, const char *type, const char *msg) +{ + if (can_msg) + send_packet_printf ("msg %d %s %s", color, type, msg); + else if (color < 0) + return; // client cannot handle this + else if (strchr (msg, '<') || strchr (msg, '&')) + { + //TODO: should escape/modify to old syntax + send_packet_printf ("drawinfo %d %s", color, msg); + } + else + send_packet_printf ("drawinfo %d %s", color, msg); +} + /*********************************************************************** * * packet functions/utilities