/[LeafOK_CVS]/pvpgn-1.7.4/src/bnetd/message.h
ViewVC logotype

Annotation of /pvpgn-1.7.4/src/bnetd/message.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Tue Jun 6 03:41:37 2006 UTC (19 years, 9 months ago) by sysadm
Branch: MAIN
Branch point for: GNU
Content type: text/x-chdr
Initial revision

1 sysadm 1.1 /*
2     * Copyright (C) 1998,1999,2001 Ross Combs (rocombs@cs.nmsu.edu)
3     *
4     * This program is free software; you can redistribute it and/or
5     * modify it under the terms of the GNU General Public License
6     * as published by the Free Software Foundation; either version 2
7     * of the License, or (at your option) any later version.
8     *
9     * This program is distributed in the hope that it will be useful,
10     * but WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12     * GNU General Public License for more details.
13     *
14     * You should have received a copy of the GNU General Public License
15     * along with this program; if not, write to the Free Software
16     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17     */
18     #ifndef INCLUDED_MESSAGE_TYPES
19     #define INCLUDED_MESSAGE_TYPES
20    
21     #ifdef MESSAGE_INTERNAL_ACCESS
22    
23     #ifdef JUST_NEED_TYPES
24     # include "common/packet.h"
25     # include "connection.h"
26     #else
27     # define JUST_NEED_TYPES
28     # include "common/packet.h"
29     # include "connection.h"
30     # undef JUST_NEED_TYPES
31     #endif
32    
33     #endif
34    
35     typedef enum
36     {
37     message_type_adduser,
38     message_type_join,
39     message_type_part,
40     message_type_whisper,
41     message_type_talk,
42     message_type_broadcast,
43     message_type_channel,
44     message_type_userflags,
45     message_type_whisperack,
46     message_type_friendwhisperack, // [zap-zero] 20020518
47     message_type_channelfull,
48     message_type_channeldoesnotexist,
49     message_type_channelrestricted,
50     message_type_info,
51     message_type_error,
52     message_type_emote,
53     message_type_uniqueid,
54     message_type_mode,
55     message_type_null
56     } t_message_type;
57    
58     typedef enum {
59     message_class_normal,
60     message_class_charjoin, /* use char*account (if account isnt d2 char is "") */
61     } t_message_class;
62    
63     typedef struct message
64     #ifdef MESSAGE_INTERNAL_ACCESS
65     {
66     unsigned int num_cached;
67     t_packet * * packets; /* cached messages */
68     t_conn_class * classes; /* classes of cached message connections */
69     unsigned int * dstflags; /* overlaid flags of cached messages */
70     t_message_class * mclasses; /* classes of cached messages */
71     /* ---- */
72     t_message_type type; /* format of message */
73     t_connection * src; /* originator message */
74     t_connection * dst; /* destination */
75     char const * text; /* text of message */
76     }
77     #endif
78     t_message;
79    
80     #endif
81    
82     /*****/
83     #ifndef JUST_NEED_TYPES
84     #ifndef INCLUDED_MESSAGE_PROTOS
85     #define INCLUDED_MESSAGE_PROTOS
86    
87     #define JUST_NEED_TYPES
88     #include <stdio.h>
89     #include "connection.h"
90     #undef JUST_NEED_TYPES
91    
92     extern char * message_format_line(t_connection const * c, char const * in);
93     extern t_message * message_create(t_message_type type, t_connection * src, t_connection * dst, char const * text);
94     extern int message_destroy(t_message * message);
95     extern int message_send(t_message * message, t_connection * dst);
96     extern int message_send_all(t_message * message);
97     extern int message_send_admins(t_connection * src, t_message_type type, char const * text);
98    
99     /* the following are "shortcuts" to avoid calling message_create(), message_send(), message_destroy() */
100     extern int message_send_text(t_connection * dst, t_message_type type, t_connection * src, char const * text);
101     extern int message_send_formatted(t_connection * dst, char const * text);
102     extern int message_send_file(t_connection * dst, FILE * fd);
103    
104     #endif
105     #endif

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1