X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fclient.h;h=d70fcf05886ae85d1933e6335fa649970cbbaf2a;hb=cac4b71f9ea600608b421127df1f80407182e405;hp=fbb8deb9ac2ba9b63fec0d45dede7f3b96740c35;hpb=ebdd6565cbbd2db46833530112c15be0e22afc29;p=umurmur.git diff --git a/src/client.h b/src/client.h index fbb8deb..d70fcf0 100644 --- a/src/client.h +++ b/src/client.h @@ -1,5 +1,5 @@ -/* Copyright (C) 2009-2011, Martin Johansson - Copyright (C) 2005-2011, Thorvald Natvig +/* Copyright (C) 2009-2013, Martin Johansson + Copyright (C) 2005-2013, Thorvald Natvig All rights reserved. @@ -31,6 +31,7 @@ #ifndef CLIENT_H_45786678 #define CLIENT_H_45786678 +#include #include #include /* close() */ #include @@ -50,8 +51,10 @@ #define BUFSIZE 8192 #define UDP_BUFSIZE 512 -#define INACTICITY_TIMEOUT 15 /* Seconds */ +#define INACTIVITY_TIMEOUT 15 /* Seconds */ #define MAX_CODECS 10 +#define MAX_TOKENSIZE 64 +#define MAX_TOKENS 32 #define IS_AUTH(_a_) ((_a_)->authenticated) @@ -70,7 +73,7 @@ typedef struct { int sessionId; uint64_t key; char *username; - bool_t bUDP, authenticated, deaf, mute, recording; + bool_t bUDP, authenticated, deaf, mute, self_deaf, self_mute, recording, bOpus; char *os, *release, *os_version; uint32_t version; int codec_count; @@ -84,6 +87,11 @@ typedef struct { char *context; struct dlist chan_node; struct dlist voicetargets; + struct dlist tokens; + int tokencount; + uint8_t hash[20]; + bool_t isAdmin; + bool_t isSuppressed; float UDPPingAvg, UDPPingVar, TCPPingAvg, TCPPingVar; uint32_t UDPPackets, TCPPackets; } client_t; @@ -93,6 +101,11 @@ typedef struct { struct dlist node; } codec_t; +typedef struct { + char *token; + struct dlist node; +} token_t; + void Client_init(); int Client_getfds(struct pollfd *pollfds); void Client_janitor(); @@ -109,9 +122,10 @@ 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 recheckCodecVersions(client_t *connectingClient); 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); +void Client_textmessage(client_t *client, char *text); #endif