mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
5c280a3c9d
I talked to coffee (creator of both mods) and he said it is okay to use zoom on the mods, also: eye emotes work there so the eye wheel is also supported. I have updated both mods to ddnet master so they have all the new stuff
83 lines
1.9 KiB
C++
83 lines
1.9 KiB
C++
#include <engine/serverbrowser.h>
|
|
#include <base/system.h>
|
|
|
|
// gametypes
|
|
|
|
bool IsVanilla(const CServerInfo *pInfo)
|
|
{
|
|
return !str_comp(pInfo->m_aGameType, "DM")
|
|
|| !str_comp(pInfo->m_aGameType, "TDM")
|
|
|| !str_comp(pInfo->m_aGameType, "CTF");
|
|
}
|
|
|
|
bool IsCatch(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "catch");
|
|
}
|
|
|
|
bool IsInsta(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "idm")
|
|
|| str_find_nocase(pInfo->m_aGameType, "itdm")
|
|
|| str_find_nocase(pInfo->m_aGameType, "ictf");
|
|
}
|
|
|
|
bool IsFNG(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "fng");
|
|
}
|
|
|
|
bool IsRace(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "race")
|
|
|| IsFastCap(pInfo)
|
|
|| IsDDRace(pInfo);
|
|
}
|
|
|
|
bool IsFastCap(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "fastcap");
|
|
}
|
|
|
|
bool IsDDRace(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "ddrace")
|
|
|| str_find_nocase(pInfo->m_aGameType, "mkrace")
|
|
|| IsDDNet(pInfo);
|
|
}
|
|
|
|
bool IsBlockInfectionZ(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "blockZ")
|
|
|| str_find_nocase(pInfo->m_aGameType, "infectionZ");
|
|
}
|
|
|
|
bool IsBlockWorlds(const CServerInfo *pInfo)
|
|
{
|
|
return (str_comp_nocase_num(pInfo->m_aGameType, "bw ", 4) == 0)
|
|
|| (str_comp_nocase(pInfo->m_aGameType, "bw") == 0);
|
|
}
|
|
|
|
bool IsDDNet(const CServerInfo *pInfo)
|
|
{
|
|
return str_find_nocase(pInfo->m_aGameType, "ddracenet")
|
|
|| str_find_nocase(pInfo->m_aGameType, "ddnet")
|
|
|| IsBlockInfectionZ(pInfo);
|
|
}
|
|
|
|
// other
|
|
|
|
bool Is64Player(const CServerInfo *pInfo)
|
|
{
|
|
return str_find(pInfo->m_aGameType, "64")
|
|
|| str_find(pInfo->m_aName, "64")
|
|
|| IsDDNet(pInfo)
|
|
|| IsBlockInfectionZ(pInfo)
|
|
|| IsBlockWorlds(pInfo);
|
|
}
|
|
|
|
bool IsPlus(const CServerInfo *pInfo)
|
|
{
|
|
return str_find(pInfo->m_aGameType, "+");
|
|
}
|