]> icculus.org git repositories - taylor/freespace2.git/blob - include/chat_api.h
rendering functions mostly done; more complete shader setup
[taylor/freespace2.git] / include / chat_api.h
1 /*
2  * Copyright (C) Volition, Inc. 2005.  All rights reserved.
3  * 
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on the 
6  * source.
7  *
8 */
9
10 #ifndef PXO_CHAT_API_HEADER_FILE
11 #define PXO_CHAT_API_HEADER_FILE
12
13 // chat server port
14 #ifndef MAKE_FS1
15 #define PXO_CHAT_PORT           7117
16 #else
17 #define PXO_CHAT_PORT           7000
18 #endif
19
20 // motd prefix
21 #define PXO_CHAT_MOTD_PREFIX                            "!MOTD$#!"
22 #define PXO_CHAT_END_OF_MOTD_PREFIX             "!EMOTD$#!"
23
24 //Commands
25 #define CC_USER_JOINING         1       //A user had joined this channel (add him/her from the user listbox if any)
26 #define CC_USER_LEAVING         2       //A user has left the channel (remove him/her from the user listbox if any)
27 #define CC_DISCONNECTED         3       //We have been disconnected from the server (close the chat screen down)
28 #define CC_KICKED                               4       //We were kicked out of the channel! (close the chat screen down?)
29 #define CC_NICKCHANGED          5       //Informing that your nickname has changed (data = "oldnick newnick")
30 #define CC_YOURCHANNEL          6       //data = name of the channel you are in. Only generated when you are joining #autoselect
31
32 #define MAXLOCALSTRING 600
33 #define MSG_REMOTE 0
34 #define MSG_LOCAL  1
35
36 typedef struct _Chat_user
37 {
38         char nick_name[33];
39          _Chat_user *next;
40 }Chat_user;
41
42 typedef struct _Chat_channel
43 {
44         char channel_name[33];
45         unsigned short users;
46         char topic[100];
47          _Chat_channel *next;
48 }Chat_channel;
49
50
51 typedef struct _Chat_command
52 {
53         short command;
54         char    data[100];
55         _Chat_command *next;
56 }Chat_command;
57
58 //Prototypes
59 void ChatInit(void);
60 int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid);
61 void DisconnectFromChatServer();
62 char * GetChatText();
63 const char *SendChatString(const char *line, int raw=0);
64 Chat_command *GetChatCommand();
65 char *GetChatUserList();
66 int SetNewChatChannel(char *channel);
67 char *GetChannelList(void);
68 char *GetTrackerIdByUser(char *nickname);
69 char *GetChannelByUser(char *nickname);
70
71 char *ChatGetString(void);
72 const char *GetWordNum(int num, const char *l_String);
73 char * ParseIRCMessage(char *Line, int iMode);
74 int AddChatUser(const char *nickname);
75 int RemoveChatUser(char *nickname);
76 void RemoveAllChatUsers(void);
77 void AddChatCommandToQueue(int command, const void *data, int len);
78 Chat_command *GetChatCommandFromQueue(void);
79 void FlushChatCommandQueue(void);
80 void AddChannel(char *channel,unsigned short numusers,char *topic);
81 void FlushChannelList(void);
82
83 #endif