mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Fix server port in teehistorian
Official servers weren't affected because they didn't use the default of `sv_port 0`.
This commit is contained in:
parent
5f6df2b5a4
commit
31cfa9250d
|
@ -41,6 +41,7 @@ public:
|
|||
int Tick() const { return m_CurrentGameTick; }
|
||||
int TickSpeed() const { return m_TickSpeed; }
|
||||
|
||||
virtual int Port() const = 0;
|
||||
virtual int MaxClients() const = 0;
|
||||
virtual int ClientCount() = 0;
|
||||
virtual int DistinctClientCount() = 0;
|
||||
|
|
|
@ -618,6 +618,11 @@ bool CServer::ClientAuthed(int ClientID)
|
|||
return ClientID >= 0 && ClientID < MAX_CLIENTS && m_aClients[ClientID].m_Authed;
|
||||
}
|
||||
|
||||
int CServer::Port() const
|
||||
{
|
||||
return m_NetServer.Address().port;
|
||||
}
|
||||
|
||||
int CServer::MaxClients() const
|
||||
{
|
||||
return m_NetServer.MaxClients();
|
||||
|
|
|
@ -293,6 +293,7 @@ public:
|
|||
int ClientCountry(int ClientID);
|
||||
bool ClientIngame(int ClientID);
|
||||
bool ClientAuthed(int ClientID);
|
||||
int Port() const;
|
||||
int MaxClients() const;
|
||||
int ClientCount();
|
||||
int DistinctClientCount();
|
||||
|
|
|
@ -3096,7 +3096,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
|
|||
GameInfo.m_pPrngDescription = m_Prng.Description();
|
||||
|
||||
GameInfo.m_pServerName = g_Config.m_SvName;
|
||||
GameInfo.m_ServerPort = g_Config.m_SvPort;
|
||||
GameInfo.m_ServerPort = Server()->Port();
|
||||
GameInfo.m_pGameType = m_pController->m_pGameType;
|
||||
|
||||
GameInfo.m_pConfig = &g_Config;
|
||||
|
|
Loading…
Reference in a new issue