Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/engine/shared/config_variables_bestclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MACRO_CONFIG_COL(BcNameplateGradientColor4, bc_nameplate_gradient_color4, 0xFFFF
MACRO_CONFIG_INT(BcNameplateGradientSkin, bc_nameplate_gradient_skin, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply gradient colors to player skin body and feet")
MACRO_CONFIG_INT(BcNameplateGradientEverything, bc_nameplate_gradient_everything, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Apply gradient to all rendered text")
MACRO_CONFIG_INT(BcNameplateGradientAnimateSpeed, bc_nameplate_gradient_animate_speed, 35, 1, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Speed of the animated gradient sweep, in percent")
MACRO_CONFIG_INT(BcShowPointsInTab, bc_show_points_in_tab, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show player points in the scoreboard on DDNet and EGO servers")
MACRO_CONFIG_INT(BcShowPointsInTab, bc_show_points_in_tab, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show player points in the scoreboard on DDNet, EGO and Legit Network servers")
MACRO_CONFIG_INT(BcShowhudDummyCoordIndicator, bc_showhud_dummy_coord_indicator, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show player-below indicator when aligned above another player")
MACRO_CONFIG_INT(BcShowCorrectCheckpoint, bc_show_correct_checkpoint, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show current tele checkpoint in movement information")

Expand Down
24 changes: 22 additions & 2 deletions src/game/client/components/bestclient/show_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bool ParsePoints(CShowPoints::EProvider Provider, const json_value *pRoot, int *
if(!IsJsonObject(pRoot) || !pPoints)
return false;

if(Provider == CShowPoints::EProvider::Ego)
if(Provider == CShowPoints::EProvider::Ego || Provider == CShowPoints::EProvider::Legit)
{
const json_value *pPointsVal = json_object_get(pRoot, "points");
if(pPointsVal == &json_value_none)
Expand Down Expand Up @@ -69,7 +69,11 @@ bool CShowPoints::Enabled() const

int CShowPoints::ProviderIndex(EProvider Provider)
{
return Provider == EProvider::Ego ? 1 : 0;
if(Provider == EProvider::Ego)
return 1;
if(Provider == EProvider::Legit)
return 2;
return 0;
}

const char *CShowPoints::CurrentCommunityId() const
Expand Down Expand Up @@ -127,6 +131,11 @@ CShowPoints::EProvider CShowPoints::CurrentProvider() const
return EProvider::Ego;
}

if(str_find_nocase(ServerInfo.m_aName, "Legit Network"))
{
return EProvider::Legit;
}

return EProvider::None;
}

Expand Down Expand Up @@ -255,6 +264,17 @@ void CShowPoints::StartRequest(const std::string &Name, EProvider Provider)
EscapeUrl(aEscapedLower, sizeof(aEscapedLower), aLower);
str_format(aUrl, sizeof(aUrl), "https://eternal-gores.com/profile/%s.json", aEscapedLower);
}
else if(Provider == EProvider::Legit)
{
CServerInfo ServerInfo;
mem_zero(&ServerInfo, sizeof(ServerInfo));
Client()->GetServerInfo(&ServerInfo);
const bool IsDDraceMode = str_find_nocase(ServerInfo.m_aGameType, "DDraceNetwork") != nullptr;

char aEscaped[256];
EscapeUrl(aEscaped, sizeof(aEscaped), Name.c_str());
str_format(aUrl, sizeof(aUrl), "https://legit.tw/api_points.php?name=%s&mode=%s", aEscaped, IsDDraceMode ? "ddrace" : "gores");
}
else
{
char aEscaped[256];
Expand Down
3 changes: 2 additions & 1 deletion src/game/client/components/bestclient/show_points.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CShowPoints : public CComponent
None = 0,
Ddnet,
Ego,
Legit,
};

int Sizeof() const override { return sizeof(*this); }
Expand All @@ -38,7 +39,7 @@ class CShowPoints : public CComponent
private:
enum
{
PROVIDER_COUNT = 2, // Ddnet, Ego
PROVIDER_COUNT = 3, // Ddnet, Ego, Legit
MAX_CONCURRENT = 3,
MAX_QUEUE = 64,
SUCCESS_TTL_MS = 10 * 60 * 1000,
Expand Down
Loading