mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Merge pull request #8989 from dobrykafe/pr-lan-page-message
Change LAN tab 'No servers found' message to include port range
This commit is contained in:
commit
16adc7d645
|
@ -985,9 +985,9 @@ void CServerBrowser::Refresh(int Type, bool Force)
|
||||||
|
|
||||||
m_BroadcastTime = time_get();
|
m_BroadcastTime = time_get();
|
||||||
|
|
||||||
for(int i = 8303; i <= 8310; i++)
|
for(int Port = LAN_PORT_BEGIN; Port <= LAN_PORT_END; Port++)
|
||||||
{
|
{
|
||||||
Packet.m_Address.port = i;
|
Packet.m_Address.port = Port;
|
||||||
m_pNetClient->Send(&Packet);
|
m_pNetClient->Send(&Packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,6 +293,9 @@ public:
|
||||||
TYPE_FAVORITE_COMMUNITY_4,
|
TYPE_FAVORITE_COMMUNITY_4,
|
||||||
TYPE_FAVORITE_COMMUNITY_5,
|
TYPE_FAVORITE_COMMUNITY_5,
|
||||||
NUM_TYPES,
|
NUM_TYPES,
|
||||||
|
|
||||||
|
LAN_PORT_BEGIN = 8303,
|
||||||
|
LAN_PORT_END = 8310,
|
||||||
};
|
};
|
||||||
|
|
||||||
class CServerEntry
|
class CServerEntry
|
||||||
|
|
|
@ -215,9 +215,18 @@ void CMenus::RenderServerbrowserServerList(CUIRect View, bool &WasListboxItemAct
|
||||||
Ui()->DoLabel(&View, Localize("Getting server list from master server"), 16.0f, TEXTALIGN_MC);
|
Ui()->DoLabel(&View, Localize("Getting server list from master server"), 16.0f, TEXTALIGN_MC);
|
||||||
}
|
}
|
||||||
else if(!ServerBrowser()->NumServers())
|
else if(!ServerBrowser()->NumServers())
|
||||||
|
{
|
||||||
|
if(ServerBrowser()->GetCurrentType() == IServerBrowser::TYPE_LAN)
|
||||||
|
{
|
||||||
|
char aBuf[128];
|
||||||
|
str_format(aBuf, sizeof(aBuf), Localize("No local servers found (ports %d-%d)"), IServerBrowser::LAN_PORT_BEGIN, IServerBrowser::LAN_PORT_END);
|
||||||
|
Ui()->DoLabel(&View, aBuf, 16.0f, TEXTALIGN_MC);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Ui()->DoLabel(&View, Localize("No servers found"), 16.0f, TEXTALIGN_MC);
|
Ui()->DoLabel(&View, Localize("No servers found"), 16.0f, TEXTALIGN_MC);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(ServerBrowser()->NumServers() && !NumServers)
|
else if(ServerBrowser()->NumServers() && !NumServers)
|
||||||
{
|
{
|
||||||
CUIRect Label, ResetButton;
|
CUIRect Label, ResetButton;
|
||||||
|
|
Loading…
Reference in a new issue