about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorTeetime <anton.tsoulos@yahoo.de>2011-10-14 00:16:18 +0200
committerTeetime <anton.tsoulos@yahoo.de>2011-10-14 00:16:18 +0200
commit74a5a7021597c4f752830171271aea36cb1ebcd7 (patch)
tree91fa65773da57ceb2b1c9f8aa7cdb5a30b54cd48 /src/game/server
parent274bf013ee6f320e3ce1066a07f3558e1ba6d0dd (diff)
downloadzcatch-74a5a7021597c4f752830171271aea36cb1ebcd7.tar.gz
zcatch-74a5a7021597c4f752830171271aea36cb1ebcd7.zip
removed sv_allow_join = 0
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp14
-rw-r--r--src/game/server/gamecontext.h1
-rw-r--r--src/game/server/gamemodes/zcatch.cpp29
-rw-r--r--src/game/server/gamemodes/zcatch.hpp1
4 files changed, 11 insertions, 34 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 0865cf08..85b352cd 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -529,13 +529,7 @@ void CGameContext::OnClientEnter(int ClientID)
 		if(num < 3)
 			m_pController->EndRound();
 		
-		if(g_Config.m_SvAllowJoin == 0)
-		{
-			m_apPlayers[ClientID]->m_CatchedBy = ZCATCH_JOINED_NEW;
-			m_apPlayers[ClientID]->m_SpecExplicit = 0;
-			StartTeam = (num < 3) ? m_pController->ClampTeam(1) : TEAM_SPECTATORS;
-		}
-		else if(g_Config.m_SvAllowJoin == 1)
+		if(g_Config.m_SvAllowJoin == 1)
 		{
 			m_apPlayers[ClientID]->m_CatchedBy = ZCATCH_NOT_CATCHED;
 			m_apPlayers[ClientID]->m_SpecExplicit = (num < 3) ? 0 : 1;
@@ -724,8 +718,6 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 		else if(!str_comp("/follow 1", pMsg->m_pMessage))
 		{
 			pPlayer->m_PlayerWantToFollowCatcher = 1;
-			if(pPlayer->m_CatchedBy != ZCATCH_JOINED_NEW)	// prevent freezing of client on the latest pos when sv_allow_join == 0
-				pPlayer->m_SpectatorID = pPlayer->m_CatchedBy;
 			SendChatTarget(ClientID, "Follow of catcher enabled.");
 		}	
 		else if(!str_comp_num("/", pMsg->m_pMessage, 1))
@@ -943,10 +935,6 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 					pPlayer->m_LastSetTeam = Server()->Tick();
 					pPlayer->SetTeam(pMsg->m_Team);
 				}
-				else if(pPlayer->m_CatchedBy == ZCATCH_JOINED_NEW)
-				{
-					SendChatTarget(ClientID, "You will join automatically when the next round starts.");
-				}
 			}
             /* end zCatch*/
 			else
diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h
index 2e36bbc7..f53c3e5a 100644
--- a/src/game/server/gamecontext.h
+++ b/src/game/server/gamecontext.h
@@ -131,7 +131,6 @@ public:
 	
 	enum
 	{
-		ZCATCH_JOINED_NEW = -2,
 		ZCATCH_NOT_CATCHED = -1,
 	}; 
 
diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp
index 4adae44c..f9477bdc 100644
--- a/src/game/server/gamemodes/zcatch.cpp
+++ b/src/game/server/gamemodes/zcatch.cpp
@@ -82,10 +82,7 @@ void CGameController_zCatch::StartRound()
 	for(int i=0; i<MAX_CLIENTS; i++)
 	{
 		if(GameServer()->m_apPlayers[i])
-		{
-			if(GameServer()->m_apPlayers[i]->m_SpecExplicit == 0 || GameServer()->m_apPlayers[i]->m_CatchedBy == ZCATCH_JOINED_NEW)
-				GameServer()->m_apPlayers[i]->SetTeamDirect(GameServer()->m_pController->ClampTeam(1));
-				
+		{		
 			GameServer()->m_apPlayers[i]->m_CatchedBy = ZCATCH_NOT_CATCHED;
 			GameServer()->m_apPlayers[i]->m_Kills = 0;
 			GameServer()->m_apPlayers[i]->m_Deaths = 0;
@@ -133,27 +130,21 @@ void CGameController_zCatch::EndRound()
 	{
 		if(GameServer()->m_apPlayers[i])
 		{
-		
-			if(GameServer()->m_apPlayers[i]->m_CatchedBy == ZCATCH_JOINED_NEW) //Neue Spieler joinen lassen
-				GameServer()->m_apPlayers[i]->m_SpecExplicit = 0;
-			
+				
 			if(GameServer()->m_apPlayers[i]->m_SpecExplicit == 0)
 			{
 				GameServer()->m_apPlayers[i]->SetTeamDirect(GameServer()->m_pController->ClampTeam(1));
 				GameServer()->m_pController->OnPlayerInfoChange(GameServer()->m_apPlayers[i]);
 				
-				if(GameServer()->m_apPlayers[i]->m_CatchedBy != ZCATCH_JOINED_NEW)
+				char abuf[128];
+				str_format(abuf, sizeof(abuf), "Kills: %d | Deaths: %d", GameServer()->m_apPlayers[i]->m_Kills, GameServer()->m_apPlayers[i]->m_Deaths);				
+				GameServer()->SendChatTarget(i, abuf);
+				
+				if(GameServer()->m_apPlayers[i]->m_TicksSpec != 0 || GameServer()->m_apPlayers[i]->m_TicksIngame != 0)
 				{
-					char abuf[128];
-					str_format(abuf, sizeof(abuf), "Kills: %d | Deaths: %d", GameServer()->m_apPlayers[i]->m_Kills, GameServer()->m_apPlayers[i]->m_Deaths);				
-					GameServer()->SendChatTarget(i, abuf);
-					
-					if(GameServer()->m_apPlayers[i]->m_TicksSpec != 0 || GameServer()->m_apPlayers[i]->m_TicksIngame != 0)
-					{
-						double TimeInSpec = (GameServer()->m_apPlayers[i]->m_TicksSpec*100.0) / (GameServer()->m_apPlayers[i]->m_TicksIngame + GameServer()->m_apPlayers[i]->m_TicksSpec);
-						str_format(abuf, sizeof(abuf), "Spec: %.2f%% | Ingame: %.2f%%", (double)TimeInSpec, (double)(100.0 - TimeInSpec));
-						GameServer()->SendChatTarget(i, abuf);	
-					}
+					double TimeInSpec = (GameServer()->m_apPlayers[i]->m_TicksSpec*100.0) / (GameServer()->m_apPlayers[i]->m_TicksIngame + GameServer()->m_apPlayers[i]->m_TicksSpec);
+					str_format(abuf, sizeof(abuf), "Spec: %.2f%% | Ingame: %.2f%%", (double)TimeInSpec, (double)(100.0 - TimeInSpec));
+					GameServer()->SendChatTarget(i, abuf);	
 				}
 				GameServer()->m_apPlayers[i]->m_CatchedBy = ZCATCH_NOT_CATCHED; //Set all players in server as non-catched
 			}
diff --git a/src/game/server/gamemodes/zcatch.hpp b/src/game/server/gamemodes/zcatch.hpp
index 7615c523..bf8b026b 100644
--- a/src/game/server/gamemodes/zcatch.hpp
+++ b/src/game/server/gamemodes/zcatch.hpp
@@ -16,7 +16,6 @@ class CGameController_zCatch : public IGameController
 	
 	enum
 	{
-		ZCATCH_JOINED_NEW = -2,
 		ZCATCH_NOT_CATCHED = -1,
 	};