mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +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();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -293,6 +293,9 @@ public:
|
|||
TYPE_FAVORITE_COMMUNITY_4,
|
||||
TYPE_FAVORITE_COMMUNITY_5,
|
||||
NUM_TYPES,
|
||||
|
||||
LAN_PORT_BEGIN = 8303,
|
||||
LAN_PORT_END = 8310,
|
||||
};
|
||||
|
||||
class CServerEntry
|
||||
|
|
|
@ -216,7 +216,16 @@ void CMenus::RenderServerbrowserServerList(CUIRect View, bool &WasListboxItemAct
|
|||
}
|
||||
else if(!ServerBrowser()->NumServers())
|
||||
{
|
||||
Ui()->DoLabel(&View, Localize("No servers found"), 16.0f, TEXTALIGN_MC);
|
||||
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);
|
||||
}
|
||||
}
|
||||
else if(ServerBrowser()->NumServers() && !NumServers)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue