Limit the avatar requests by the server - clients may only upload one avatar within a certain time. This is checked by IP address, so two players within the same NAT system might have to wait for a few seconds.

This commit is contained in:
lotodore
2008-02-24 12:56:39 +00:00
parent 75ef6616e8
commit 7283431c8c
8 changed files with 117 additions and 18 deletions
+7
View File
@@ -88,6 +88,8 @@ typedef unsigned char u_char;
#define SOCKET_IPPROTO_SCTP 0
#endif
#define MAX_ADDR_STRING_LEN 256
// All char *s are assumed to be UTF-8.
/**
@@ -96,6 +98,11 @@ typedef unsigned char u_char;
*/
bool socket_string_to_addr(const char *str, int addrFamily, struct sockaddr *addr, int addrLen);
/**
* Convert a numeric address to an address string.
*/
bool socket_addr_to_string(struct sockaddr *addr, int addrLen, int addrFamily, char *str, int strLen);
/**
* Resolve a name to a numeric address.
* str is assumed to be UTF-8 encoded.