1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef ENGINE_FRIENDS_H
4#define ENGINE_FRIENDS_H
5
6#include <engine/shared/protocol.h>
7
8#include "kernel.h"
9
10struct CFriendInfo
11{
12 char m_aName[MAX_NAME_LENGTH];
13 char m_aClan[MAX_CLAN_LENGTH];
14 unsigned m_NameHash;
15 unsigned m_ClanHash;
16};
17
18class IFriends : public IInterface
19{
20 MACRO_INTERFACE("friends")
21public:
22 enum
23 {
24 FRIEND_NO = 0,
25 FRIEND_CLAN,
26 FRIEND_PLAYER,
27
28 MAX_FRIENDS = 4096,
29 };
30
31 virtual void Init(bool Foes = false) = 0;
32
33 virtual int NumFriends() const = 0;
34 virtual const CFriendInfo *GetFriend(int Index) const = 0;
35 virtual int GetFriendState(const char *pName, const char *pClan) const = 0;
36 virtual bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const = 0;
37
38 virtual void AddFriend(const char *pName, const char *pClan) = 0;
39 virtual void RemoveFriend(const char *pName, const char *pClan) = 0;
40};
41
42#endif
43