This commit is contained in:
GreYFoXGTi 2010-12-17 01:20:41 +02:00
commit 0bbdabae97
5 changed files with 17 additions and 6 deletions

View file

@ -111,6 +111,7 @@ MACRO_CONFIG_INT(SvHideScore, sv_hide_score, 0, 0, 1, CFGFLAG_SERVER, "Whether p
MACRO_CONFIG_INT(SvTimer, sv_timer, 0, 0, 1, CFGFLAG_SERVER, "Whether timer commands are allowed or not", 3)
MACRO_CONFIG_INT(SvPauseable, sv_pauseable, 1, 0, 1, CFGFLAG_SERVER, "Whether players can pause their char or not", 3)
MACRO_CONFIG_INT(SvPauseTime, sv_pause_time, 0, 0, 1, CFGFLAG_SERVER, "Whether '/pause' and 'sv_max_dc_restore' pauses the time of player or not", 3)
MACRO_CONFIG_INT(SvPauseFrequency, sv_pause_frequency, 5, 0, 9999, CFGFLAG_SERVER, "The minimum allowed delay between pauses", 3)
MACRO_CONFIG_INT(SvEmotionalTees, sv_emotional_tees, 1, 0, 1, CFGFLAG_SERVER, "Whether eye change of tees is enabled or not", 3)
MACRO_CONFIG_INT(SvEmoticonDelay, sv_emoticon_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between over-head emoticons", 3)
@ -120,7 +121,8 @@ MACRO_CONFIG_INT(SvTeamChangeDelay, sv_team_change_delay, 3, 0, 9999, CFGFLAG_SE
MACRO_CONFIG_INT(SvInfoChangeDelay, sv_info_change_delay, 5, 0, 9999, CFGFLAG_SERVER, "The time in seconds between info changes (name/skin/color), to avoid ranbow mod set this to a very high time", 3)
MACRO_CONFIG_INT(SvVoteMapTimeDelay, sv_vote_map_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between map votes", 3)
MACRO_CONFIG_INT(SvVoteDelay, sv_vote_delay, 3, 0, 9999, CFGFLAG_SERVER, "The time in seconds between any vote", 3)
MACRO_CONFIG_INT(SvVoteKickTimeDelay, sv_vote_kick_delay,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kick votes", 3)
MACRO_CONFIG_INT(SvVoteKickTimeDelay, sv_vote_kick_delay, 0, 0, 9999, CFGFLAG_SERVER, "The minimum time in seconds between kick votes", 3)
MACRO_CONFIG_INT(SvSpectatorVotes, sv_spectator_votes, 1, 0, 1, CFGFLAG_SERVER, "Choose if spectators are allowed to start votes", 3)
MACRO_CONFIG_INT(SvKillDelay, sv_kill_delay,3,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kills", 3)
MACRO_CONFIG_INT(SvSuicidePenalty, sv_suicide_penalty,0,0,9999,CFGFLAG_SERVER, "The minimum time in seconds between kill or /kills and respawn", 3)

View file

@ -718,9 +718,14 @@ void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData, i
CCharacter* chr = pPlayer->GetCharacter();
if(!pPlayer->GetTeam() && chr && (!chr->m_aWeapons[WEAPON_NINJA].m_Got || chr->m_FreezeTime) && chr->IsGrounded() && chr->m_Pos==chr->m_PrevPos && !pPlayer->m_InfoSaved)
{
pPlayer->SaveCharacter();
pPlayer->SetTeam(-1);
pPlayer->m_InfoSaved = true;
if(pPlayer->m_Last_Pause + pSelf->Server()->TickSpeed() * g_Config.m_SvPauseFrequency <= pSelf->Server()->Tick()) {
pPlayer->SaveCharacter();
pPlayer->SetTeam(-1);
pPlayer->m_InfoSaved = true;
pPlayer->m_Last_Pause = pSelf->Server()->Tick();
}
else
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "You can\'t pause that often.");
}
else if(pPlayer->GetTeam()==-1 && pPlayer->m_InfoSaved)
{

View file

@ -508,7 +508,7 @@ void CGameContext::OnTick()
bool aVoteChecked[MAX_CLIENTS] = {0};
for(int i = 0; i < MAX_CLIENTS; i++)
{
if(!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == -1 || aVoteChecked[i]) // don't count in votes by spectators
if(!m_apPlayers[i] || (g_Config.m_SvSpectatorVotes == 0 && m_apPlayers[i]->GetTeam() == -1) || aVoteChecked[i]) // don't count in votes by spectators
continue;
if(m_VoteKick &&
GetPlayerChar(m_VoteCreator) && GetPlayerChar(i) &&
@ -797,7 +797,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
int64 Now = Server()->Tick();
p->m_Last_VoteTry = Now;
if(p->GetTeam() == -1)
if(g_Config.m_SvSpectatorVotes == 0 && p->GetTeam() == -1)
{
SendChatTarget(ClientId, "Spectators aren't allowed to start a vote.");
return;

View file

@ -33,6 +33,9 @@ CPlayer::CPlayer(CGameContext *pGameServer, int CID, int Team)
m_Invisible = false;
m_IsUsingDDRaceClient = false;
// Variable initialized:
m_Last_Pause = 0;
}
CPlayer::~CPlayer()

View file

@ -81,6 +81,7 @@ public:
int64 m_Last_ChangeInfo;
int64 m_Last_Emote;
int64 m_Last_Kill;
int64 m_Last_Pause;
bool m_Invisible;