X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fchannel.h;h=61346467cec71597023a659a4ad47a88ed4222fb;hb=454ad122eb158b4391e2690fe6a7e127d24c525b;hp=aeb21dc7dfb762c59bdee82f47a0448d1a431923;hpb=01e804f06e00c36c5680ebde07cbe17e6b256dc4;p=umurmur.git diff --git a/src/channel.h b/src/channel.h index aeb21dc..6134646 100644 --- a/src/channel.h +++ b/src/channel.h @@ -37,8 +37,8 @@ typedef struct channel { int id; - char name[MAX_TEXT]; - char desc[MAX_TEXT]; + char *name; + char *desc; struct channel *parent; bool_t temporary, noenter; struct dlist node; @@ -46,22 +46,31 @@ typedef struct channel { struct dlist clients; struct dlist flatlist_node; struct dlist channel_links; + int linkcount; struct dlist link_node; } channel_t; +typedef struct { + channel_t *chan; + struct dlist node; +} channellist_t; + void Chan_init(); void Chan_free(); void Chan_addChannel(channel_t *parent, channel_t *sub); void Chan_removeChannel(channel_t *c); void Chan_addClient(channel_t *c, client_t *client); void Chan_removeClient(channel_t *c, client_t *client); -int Chan_playerJoin(channel_t *ch, client_t *client); -int Chan_playerJoin_id(int channelid, client_t *client); -bool_t Chan_playerJoin_id_test(int channelid); +int Chan_userJoin(channel_t *ch, client_t *client); +int Chan_userJoin_id(int channelid, client_t *client); +int Chan_userLeave(client_t *client); +bool_t Chan_userJoin_id_test(int channelid); channel_t *Chan_iterate(channel_t **channelpptr); channel_t *Chan_iterate_siblings(channel_t *parent, channel_t **channelpptr); channel_t *Chan_createChannel(const char *name, const char *desc); channel_t *Chan_fromId(int channelid); void Chan_freeChannel(channel_t *ch); +void Chan_buildTreeList(channel_t *ch, struct dlist *head); +void Chan_freeTreeList(struct dlist *head); #endif