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_CLIENT_FRIENDS_H
|
|
|
|
#define ENGINE_CLIENT_FRIENDS_H
|
|
|
|
|
Make sure headers compile standalone
Not planning to do this automatically, but at least cleaning it up once
provides some benefit. Every header should include what it uses.
$ for i in src/**/*.h; do j=${i#"src/"}; echo $j; echo "#include <$j>\nint main() { return 0; }" | /usr/bin/c++ -DCONF_OPENSSL -DCONF_SQL -DCONF_VIDEORECORDER -DCONF_WAVPACK_CLOSE_FILE -DCONF_WAVPACK_OPEN_FILE_INPUT_EX -DGAME_RELEASE_VERSION=\"15.0.5\" -DGLEW_STATIC -D_FORTIFY_SOURCE=2 -I/usr/include/freetype2 -I/usr/include/opus -I/usr/include/SDL2 -I/usr/include/wavpack -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -Isrc -I/usr/include/mysql -I/home/deen/sys/include/ -O2 -g -DNDEBUG -fdiagnostics-color=always -fstack-protector-all -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wno-nullability-completeness -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wrestrict -std=gnu++11 -o /dev/null -x c++ -; done
Ignored: tuning.h, variables.h, config_common.h, mapitems_ex_types.h, mapbugs_list.h, protocol7.h, teehistorian_ex_chunks.h, protocol_ex_msgs.h, config.h, config_variables.h, external, keynames.h
2020-09-26 08:23:33 +00:00
|
|
|
#include <engine/config.h>
|
|
|
|
#include <engine/console.h>
|
2011-03-23 12:06:35 +00:00
|
|
|
#include <engine/friends.h>
|
|
|
|
|
|
|
|
class CFriends : public IFriends
|
|
|
|
{
|
|
|
|
CFriendInfo m_aFriends[MAX_FRIENDS];
|
2015-07-22 20:16:49 +00:00
|
|
|
int m_Foes;
|
2011-03-23 12:06:35 +00:00
|
|
|
int m_NumFriends;
|
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConAddFriend(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConRemoveFriend(IConsole::IResult *pResult, void *pUserData);
|
2015-07-28 14:13:29 +00:00
|
|
|
static void ConFriends(IConsole::IResult *pResult, void *pUserData);
|
2011-03-23 12:06:35 +00:00
|
|
|
|
2021-01-10 12:47:07 +00:00
|
|
|
static void ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-23 12:06:35 +00:00
|
|
|
public:
|
|
|
|
CFriends();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2015-07-22 20:16:49 +00:00
|
|
|
void Init(bool Foes = false);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-23 12:06:35 +00:00
|
|
|
int NumFriends() const { return m_NumFriends; }
|
2011-04-13 18:37:12 +00:00
|
|
|
const CFriendInfo *GetFriend(int Index) const;
|
2011-06-26 15:10:13 +00:00
|
|
|
int GetFriendState(const char *pName, const char *pClan) const;
|
2011-04-02 17:51:05 +00:00
|
|
|
bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const;
|
2011-03-23 12:06:35 +00:00
|
|
|
|
|
|
|
void AddFriend(const char *pName, const char *pClan);
|
|
|
|
void RemoveFriend(const char *pName, const char *pClan);
|
|
|
|
void RemoveFriend(int Index);
|
2015-07-28 14:13:29 +00:00
|
|
|
void Friends();
|
2011-03-23 12:06:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|