ddnet/src/engine/friends.h

43 lines
1 KiB
C
Raw Normal View History

2011-03-23 12:06:35 +00:00
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#ifndef ENGINE_FRIENDS_H
#define ENGINE_FRIENDS_H
#include <engine/shared/protocol.h>
#include "kernel.h"
struct CFriendInfo
{
char m_aName[MAX_NAME_LENGTH];
char m_aClan[MAX_CLAN_LENGTH];
2011-06-26 15:10:13 +00:00
unsigned m_NameHash;
unsigned m_ClanHash;
2011-03-23 12:06:35 +00:00
};
class IFriends : public IInterface
{
MACRO_INTERFACE("friends", 0)
public:
enum
{
2011-06-26 15:10:13 +00:00
FRIEND_NO=0,
FRIEND_CLAN,
FRIEND_PLAYER,
2013-10-07 01:54:08 +00:00
MAX_FRIENDS=1024,
2011-03-23 12:06:35 +00:00
};
2015-07-22 20:16:49 +00:00
virtual void Init(bool Foes = false) = 0;
2011-03-23 12:06:35 +00:00
virtual int NumFriends() const = 0;
virtual const CFriendInfo *GetFriend(int Index) const = 0;
2011-06-26 15:10:13 +00:00
virtual int GetFriendState(const char *pName, const char *pClan) const = 0;
virtual bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const = 0;
2011-03-23 12:06:35 +00:00
virtual void AddFriend(const char *pName, const char *pClan) = 0;
virtual void RemoveFriend(const char *pName, const char *pClan) = 0;
};
#endif