diff options
| author | Teetime <anton.tsoulos@yahoo.de> | 2011-10-14 00:16:18 +0200 |
|---|---|---|
| committer | Teetime <anton.tsoulos@yahoo.de> | 2011-10-14 00:16:18 +0200 |
| commit | 74a5a7021597c4f752830171271aea36cb1ebcd7 (patch) | |
| tree | 91fa65773da57ceb2b1c9f8aa7cdb5a30b54cd48 | |
| parent | 274bf013ee6f320e3ce1066a07f3558e1ba6d0dd (diff) | |
| download | zcatch-74a5a7021597c4f752830171271aea36cb1ebcd7.tar.gz zcatch-74a5a7021597c4f752830171271aea36cb1ebcd7.zip | |
removed sv_allow_join = 0
| -rw-r--r-- | src/game/server/gamecontext.cpp | 14 | ||||
| -rw-r--r-- | src/game/server/gamecontext.h | 1 | ||||
| -rw-r--r-- | src/game/server/gamemodes/zcatch.cpp | 29 | ||||
| -rw-r--r-- | src/game/server/gamemodes/zcatch.hpp | 1 | ||||
| -rw-r--r-- | src/game/variables.h | 4 |
5 files changed, 13 insertions, 36 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, }; diff --git a/src/game/variables.h b/src/game/variables.h index c913a46b..1791cb7e 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -92,8 +92,8 @@ MACRO_CONFIG_INT(DbgTuning, dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "") //zCatch: MACRO_CONFIG_INT(SvMode, sv_mode, 1, 0, 3, CFGFLAG_SERVER, "0 - Normal; 1 - Instagib; 2 - Rocket area; 3 - Hammerparty") -MACRO_CONFIG_INT(SvAllowJoin, sv_allow_join, 2, 0, 2, CFGFLAG_SERVER, "Allow new Players to join without waiting for the next round") -//0 - Wait for next round; 1 = Allowed to join; 2 = Will join when person with the most kills die +MACRO_CONFIG_INT(SvAllowJoin, sv_allow_join, 2, 1, 2, CFGFLAG_SERVER, "Allow new Players to join without waiting for the next round") +//1 = Allowed to join; 2 = Will join when person with the most kills die MACRO_CONFIG_INT(SvColorIndicator, sv_color_indicator, 1, 0, 1, CFGFLAG_SERVER, "Color tees apropriate to the number of currently catched players") MACRO_CONFIG_INT(SvBonus, sv_bonus, 0, 0, 10000, CFGFLAG_SERVER, "Give the last player extra points") MACRO_CONFIG_INT(SvFollowCatcher, sv_follow_catcher, 1, 0, 1, CFGFLAG_SERVER, "If a victim should follow his catcher") |