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
14 #define PXO_CHAT_PORT 7117
17 #define PXO_CHAT_MOTD_PREFIX "!MOTD$#!"
18 #define PXO_CHAT_END_OF_MOTD_PREFIX "!EMOTD$#!"
21 #define CC_USER_JOINING 1 //A user had joined this channel (add him/her from the user listbox if any)
22 #define CC_USER_LEAVING 2 //A user has left the channel (remove him/her from the user listbox if any)
23 #define CC_DISCONNECTED 3 //We have been disconnected from the server (close the chat screen down)
24 #define CC_KICKED 4 //We were kicked out of the channel! (close the chat screen down?)
25 #define CC_NICKCHANGED 5 //Informing that your nickname has changed (data = "oldnick newnick")
26 #define CC_YOURCHANNEL 6 //data = name of the channel you are in. Only generated when you are joining #autoselect
28 #define MAXLOCALSTRING 600
32 typedef struct _Chat_user
38 typedef struct _Chat_channel
40 char channel_name[33];
47 typedef struct _Chat_command
56 int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid);
57 void DisconnectFromChatServer();
59 const char *SendChatString(const char *line, int raw=0);
60 Chat_command *GetChatCommand();
61 char *GetChatUserList();
62 int SetNewChatChannel(char *channel);
63 char *GetChannelList(void);
64 char *GetTrackerIdByUser(char *nickname);
65 char *GetChannelByUser(char *nickname);
67 char *ChatGetString(void);
68 const char *GetWordNum(int num, const char *l_String);
69 char * ParseIRCMessage(char *Line, int iMode);
70 int AddChatUser(const char *nickname);
71 int RemoveChatUser(char *nickname);
72 void RemoveAllChatUsers(void);
73 void AddChatCommandToQueue(int command, const void *data, int len);
74 Chat_command *GetChatCommandFromQueue(void);
75 void FlushChatCommandQueue(void);
76 void AddChannel(char *channel,unsigned short numusers,char *topic);
77 void FlushChannelList(void);