2 * Copyright (C) Volition, Inc. 2005. All rights reserved.
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
10 #ifndef PXO_CHAT_API_HEADER_FILE
11 #define PXO_CHAT_API_HEADER_FILE
15 #define PXO_CHAT_PORT 7117
17 #define PXO_CHAT_PORT 7000
21 #define PXO_CHAT_MOTD_PREFIX "!MOTD$#!"
22 #define PXO_CHAT_END_OF_MOTD_PREFIX "!EMOTD$#!"
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
32 #define MAXLOCALSTRING 600
36 typedef struct _Chat_user
42 typedef struct _Chat_channel
44 char channel_name[33];
51 typedef struct _Chat_command
60 int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid);
61 void DisconnectFromChatServer();
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);
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);