better lan page no servers found message

This commit is contained in:
dobrykafe 2024-09-18 21:41:54 +02:00
parent 217103a0ee
commit 9b1a6ac26b
3 changed files with 15 additions and 3 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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)
{