about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-02-16 12:31:47 +0100
committeroy <Tom_Adams@web.de>2011-02-16 12:31:47 +0100
commitd939b841250180d89cd5843ff40e82d00b443c37 (patch)
treed48055f92ae7531f937769bbe63352f9db1d4052
parentb63dbfede548bb9eb0ad7a5b7a83a8a3fac1e1f1 (diff)
downloadzcatch-d939b841250180d89cd5843ff40e82d00b443c37.tar.gz
zcatch-d939b841250180d89cd5843ff40e82d00b443c37.zip
removed no longer needed progression browse info
-rw-r--r--src/engine/client/client.cpp1
-rw-r--r--src/engine/client/srvbrowse.cpp9
-rw-r--r--src/engine/server.h2
-rw-r--r--src/engine/server/server.cpp19
-rw-r--r--src/engine/server/server.h4
-rw-r--r--src/engine/serverbrowser.h3
-rw-r--r--src/game/server/gamecontext.cpp3
-rw-r--r--src/game/server/gamecontext.h1
-rw-r--r--src/game/server/gamecontroller.cpp27
9 files changed, 4 insertions, 65 deletions
diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp
index 13e59ac5..62585ef7 100644
--- a/src/engine/client/client.cpp
+++ b/src/engine/client/client.cpp
@@ -1077,7 +1077,6 @@ void CClient::ProcessPacket(CNetChunk *pPacket)
 				str_copy(Info.m_aMap, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aMap));
 				str_copy(Info.m_aGameType, Up.GetString(CUnpacker::SANITIZE_CC|CUnpacker::SKIP_START_WHITESPACES), sizeof(Info.m_aGameType));
 				Info.m_Flags = str_toint(Up.GetString());
-				Info.m_Progression = str_toint(Up.GetString());
 				Info.m_NumPlayers = str_toint(Up.GetString());
 				Info.m_MaxPlayers = str_toint(Up.GetString());
 
diff --git a/src/engine/client/srvbrowse.cpp b/src/engine/client/srvbrowse.cpp
index 7330850b..b9eeac11 100644
--- a/src/engine/client/srvbrowse.cpp
+++ b/src/engine/client/srvbrowse.cpp
@@ -109,13 +109,6 @@ bool CServerBrowser::SortCompareGametype(int Index1, int Index2) const
 	return str_comp(a->m_Info.m_aGameType, b->m_Info.m_aGameType) < 0;
 }
 
-bool CServerBrowser::SortCompareProgression(int Index1, int Index2) const
-{
-	CServerEntry *a = m_ppServerlist[Index1];
-	CServerEntry *b = m_ppServerlist[Index2];
-	return a->m_Info.m_Progression < b->m_Info.m_Progression;
-}
-
 bool CServerBrowser::SortCompareNumPlayers(int Index1, int Index2) const
 {
 	CServerEntry *a = m_ppServerlist[Index1];
@@ -257,8 +250,6 @@ void CServerBrowser::Sort()
 		std::sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowser::SortCompareNumPlayers));
 	else if(g_Config.m_BrSort == IServerBrowser::SORT_GAMETYPE)
 		std::sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowser::SortCompareGametype));
-	else if(g_Config.m_BrSort == IServerBrowser::SORT_PROGRESSION)
-		std::sort(m_pSortedServerlist, m_pSortedServerlist+m_NumSortedServers, SortWrap(this, &CServerBrowser::SortCompareProgression));
 
 	// invert the list if requested
 	if(g_Config.m_BrSortOrder)
diff --git a/src/engine/server.h b/src/engine/server.h
index eb980d17..18d92dfe 100644
--- a/src/engine/server.h
+++ b/src/engine/server.h
@@ -42,7 +42,6 @@ public:
 		return SendMsg(&Packer, Flags, ClientID);
 	}
 	
-	virtual void SetBrowseInfo(char const *pGameType, int Progression) = 0;
 	virtual void SetClientName(int ClientID, char const *pName) = 0;
 	virtual void SetClientScore(int ClientID, int Score) = 0;
 	
@@ -78,6 +77,7 @@ public:
 	virtual void OnClientDirectInput(int ClientID, void *pInput) = 0;
 	virtual void OnClientPredictedInput(int ClientID, void *pInput) = 0;
 	
+	virtual const char *GameType() = 0;
 	virtual const char *Version() = 0;
 	virtual const char *NetVersion() = 0;
 };
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp
index b6d465ac..5341a38c 100644
--- a/src/engine/server/server.cpp
+++ b/src/engine/server/server.cpp
@@ -178,9 +178,6 @@ CServer::CServer() : m_DemoRecorder(&m_SnapshotDelta)
 	m_CurrentGameTick = 0;
 	m_RunServer = 1;
 
-	mem_zero(m_aBrowseinfoGametype, sizeof(m_aBrowseinfoGametype));
-	m_BrowseinfoProgression = -1;
-
 	m_pCurrentMapData = 0;
 	m_CurrentMapSize = 0;
 	
@@ -253,16 +250,6 @@ void CServer::SetClientScore(int ClientID, int Score)
 	m_aClients[ClientID].m_Score = Score;
 }
 
-void CServer::SetBrowseInfo(const char *pGameType, int Progression)
-{
-	str_copy(m_aBrowseinfoGametype, pGameType, sizeof(m_aBrowseinfoGametype));
-	m_BrowseinfoProgression = Progression;
-	if(m_BrowseinfoProgression > 100)
-		m_BrowseinfoProgression = 100;
-	if(m_BrowseinfoProgression < -1)
-		m_BrowseinfoProgression = -1;
-}
-
 void CServer::Kick(int ClientID, const char *pReason)
 {
 	if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State == CClient::STATE_EMPTY)
@@ -910,7 +897,7 @@ void CServer::SendServerInfo(NETADDR *pAddr, int Token)
 	p.AddString(GetMapName(), 32);
 
 	// gametype
-	p.AddString(m_aBrowseinfoGametype, 16);
+	p.AddString(GameServer()->GameType(), 16);
 
 	// flags
 	int i = 0;
@@ -919,10 +906,6 @@ void CServer::SendServerInfo(NETADDR *pAddr, int Token)
 	str_format(aBuf, sizeof(aBuf), "%d", i);
 	p.AddString(aBuf, 2);
 
-	// progression
-	str_format(aBuf, sizeof(aBuf), "%d", m_BrowseinfoProgression);
-	p.AddString(aBuf, 4);
-	
 	str_format(aBuf, sizeof(aBuf), "%d", PlayerCount); p.AddString(aBuf, 3);  // num players
 	str_format(aBuf, sizeof(aBuf), "%d", m_NetServer.MaxClients()); p.AddString(aBuf, 3); // max players
 
diff --git a/src/engine/server/server.h b/src/engine/server/server.h
index f3726eba..6bee026e 100644
--- a/src/engine/server/server.h
+++ b/src/engine/server/server.h
@@ -111,9 +111,6 @@ public:
 	int m_MapReload;
 	int m_RconClientID;
 
-	char m_aBrowseinfoGametype[16];
-	int m_BrowseinfoProgression;
-
 	int64 m_Lastheartbeat;
 	//static NETADDR4 master_server;
 
@@ -132,7 +129,6 @@ public:
 
 	virtual void SetClientName(int ClientID, const char *pName);
 	virtual void SetClientScore(int ClientID, int Score);
-	virtual void SetBrowseInfo(const char *pGameType, int Progression);
 
 	void Kick(int ClientID, const char *pReason);
 
diff --git a/src/engine/serverbrowser.h b/src/engine/serverbrowser.h
index 98a24f7a..07f544e8 100644
--- a/src/engine/serverbrowser.h
+++ b/src/engine/serverbrowser.h
@@ -28,7 +28,6 @@ public:
 	
 	int m_QuickSearchHit;
 	
-	int m_Progression;
 	int m_MaxPlayers;
 	int m_NumPlayers;
 	int m_Flags;
@@ -52,7 +51,6 @@ public:
 		SORT_PING - Sort by ping.
 		SORT_MAP - Sort by map
 		SORT_GAMETYPE - Sort by game type. DM, TDM etc.
-		SORT_PROGRESSION - Sort by progression.
 		SORT_NUMPLAYERS - Sort after how many players there are on the server.
 	*/
 	enum{
@@ -60,7 +58,6 @@ public:
 		SORT_PING,
 		SORT_MAP,
 		SORT_GAMETYPE,
-		SORT_PROGRESSION,
 		SORT_NUMPLAYERS,
 		
 		QUICK_SERVERNAME=1,
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 885f6eb3..8ef7de88 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -1059,8 +1059,6 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
 	else
 		m_pController = new CGameControllerDM(this);
 
-	Server()->SetBrowseInfo(m_pController->m_pGameType, -1);
-
 	// setup core world
 	//for(int i = 0; i < MAX_CLIENTS; i++)
 	//	game.players[i].core.world = &game.world.core;
@@ -1130,6 +1128,7 @@ void CGameContext::OnPostSnap()
 	m_Events.Clear();
 }
 
+const char *CGameContext::GameType() { return m_pController && m_pController->m_pGameType ? m_pController->m_pGameType : ""; }
 const char *CGameContext::Version() { return GAME_VERSION; }
 const char *CGameContext::NetVersion() { return GAME_NETVERSION; }
 
diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h
index 6ad7204d..7ca38973 100644
--- a/src/game/server/gamecontext.h
+++ b/src/game/server/gamecontext.h
@@ -161,6 +161,7 @@ public:
 	virtual void OnClientDirectInput(int ClientID, void *pInput);
 	virtual void OnClientPredictedInput(int ClientID, void *pInput);
 
+	virtual const char *GameType();
 	virtual const char *Version();
 	virtual const char *NetVersion();
 };
diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp
index 9cabf0cb..7dcd869a 100644
--- a/src/game/server/gamecontroller.cpp
+++ b/src/game/server/gamecontroller.cpp
@@ -498,33 +498,6 @@ void IGameController::Tick()
 			}
 		}
 	}
-	
-	// update browse info
-	int Prog = -1;
-	if(g_Config.m_SvTimelimit > 0)
-		Prog = max(Prog, (Server()->Tick()-m_RoundStartTick) * 100 / (g_Config.m_SvTimelimit*Server()->TickSpeed()*60));
-
-	if(g_Config.m_SvScorelimit)
-	{
-		if(IsTeamplay())
-		{
-			Prog = max(Prog, (m_aTeamscore[TEAM_RED]*100)/g_Config.m_SvScorelimit);
-			Prog = max(Prog, (m_aTeamscore[TEAM_BLUE]*100)/g_Config.m_SvScorelimit);
-		}
-		else
-		{
-			for(int i = 0; i < MAX_CLIENTS; i++)
-			{
-				if(GameServer()->m_apPlayers[i])
-					Prog = max(Prog, (GameServer()->m_apPlayers[i]->m_Score*100)/g_Config.m_SvScorelimit);
-			}
-		}
-	}
-
-	if(m_Warmup)
-		Prog = -1;
-		
-	Server()->SetBrowseInfo(m_pGameType, Prog);
 }