X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient.h;h=a7d43f0bbb42d108de343ad1d9535aebc572f7e1;hb=893f97a3eab1da17bfa9f00edb081e4fba32548b;hp=b6528ebff8289708eb99e66b361a8c2dba279539;hpb=ac258369305673f3d17322b845ad58f2b9f64100;p=umurmur.git diff --git a/src/client.h b/src/client.h index b6528eb..a7d43f0 100644 --- a/src/client.h +++ b/src/client.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2009, Martin Johansson - Copyright (C) 2005-2009, Thorvald Natvig +/* Copyright (C) 2009-2010, Martin Johansson + Copyright (C) 2005-2010, Thorvald Natvig All rights reserved. @@ -48,9 +48,10 @@ #include "timer.h" #include "pds.h" -#define BUFSIZE 2048 +#define BUFSIZE 8192 #define UDP_BUFSIZE 512 #define INACTICITY_TIMEOUT 15 /* Seconds */ +#define MAX_CODECS 10 #define IS_AUTH(_a_) ((_a_)->authenticated) @@ -68,19 +69,27 @@ typedef struct { uint32_t rxcount, msgsize, drainleft, txcount, txsize; int sessionId; uint64_t key; - char playerName[MAX_TEXT]; - int playerId; + char *username; bool_t authenticated, deaf, mute; + char *os, *release; + uint32_t version; + int codec_count; + struct dlist codecs; int availableBandwidth; etimer_t lastActivity; struct dlist node; struct dlist txMsgQueue; int txQueueCount; - /* Channel */ - void *channel; /*Ugly... */ + void *channel; /* Ugly... */ + char *context; struct dlist chan_node; + struct dlist voicetargets; } client_t; +typedef struct { + int codec, count; + struct dlist node; +} codec_t; void Client_init(); int Client_getfds(struct pollfd *pollfds); @@ -96,5 +105,9 @@ int Client_send_message_except(client_t *client, message_t *msg); int Client_read_udp(void); void Client_disconnect_all(); int Client_voiceMsg(client_t *client, uint8_t *data, int len); +void recheckCodecVersions(); +void Client_codec_add(client_t *client, int codec); +void Client_codec_free(client_t *client); +codec_t *Client_codec_iterate(client_t *client, codec_t **codec_itr); #endif