mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Uninvite kicked/spectated players from team (fixed #1464)
This commit is contained in:
parent
65ce202697
commit
afa1e8adc5
|
@ -39,6 +39,7 @@ CONSOLE_COMMAND("force_unpause", "v[id]", CFGFLAG_SERVER, ConForcePause, this, "
|
|||
|
||||
CONSOLE_COMMAND("list", "?s[filter]", CFGFLAG_CHAT, ConList, this, "List connected players with optional case-insensitive substring matching filter")
|
||||
CONSOLE_COMMAND("set_team_ddr", "v[id] ?i[team]", CFGFLAG_SERVER, ConSetDDRTeam, this, "Set ddrace team of a player")
|
||||
CONSOLE_COMMAND("uninvite", "v[id] ?i[team]", CFGFLAG_SERVER, ConUninvite, this, "Uninvite player from team")
|
||||
|
||||
CONSOLE_COMMAND("vote_mute", "v[id] i[seconds]", CFGFLAG_SERVER, ConVoteMute, this, "Remove v's right to vote for i seconds")
|
||||
CONSOLE_COMMAND("mute", "", CFGFLAG_SERVER, ConMute, this, "")
|
||||
|
|
|
@ -587,7 +587,15 @@ void CGameContext::ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData)
|
|||
if(pController->m_Teams.m_Core.Team(Target) && pController->m_Teams.GetDDRaceState(pSelf->m_apPlayers[Target]) == DDRACE_STARTED)
|
||||
pSelf->m_apPlayers[Target]->KillCharacter(WEAPON_SELF);
|
||||
|
||||
pController->m_Teams.SetForceCharacterTeam(pResult->GetVictim(), Team);
|
||||
pController->m_Teams.SetForceCharacterTeam(Target, Team);
|
||||
}
|
||||
|
||||
void CGameContext::ConUninvite(IConsole::IResult *pResult, void *pUserData)
|
||||
{
|
||||
CGameContext *pSelf = (CGameContext *)pUserData;
|
||||
CGameControllerDDRace *pController = (CGameControllerDDRace *)pSelf->m_pController;
|
||||
|
||||
pController->m_Teams.SetClientInvited(pResult->GetInteger(1), pResult->GetVictim(), false);
|
||||
}
|
||||
|
||||
void CGameContext::ConFreezeHammer(IConsole::IResult *pResult, void *pUserData)
|
||||
|
|
|
@ -1594,21 +1594,25 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
}
|
||||
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s' (%s)", Server()->ClientName(ClientID), Server()->ClientName(KickID), aReason);
|
||||
str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickID));
|
||||
if(!GetDDRaceTeam(ClientID))
|
||||
{
|
||||
if (!g_Config.m_SvVoteKickBantime)
|
||||
{
|
||||
str_format(aCmd, sizeof(aCmd), "kick %d Kicked by vote", KickID);
|
||||
str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickID));
|
||||
}
|
||||
else
|
||||
{
|
||||
char aAddrStr[NETADDR_MAXSTRSIZE] = {0};
|
||||
Server()->GetClientAddr(KickID, aAddrStr, sizeof(aAddrStr));
|
||||
str_format(aCmd, sizeof(aCmd), "ban %s %d Banned by vote", aAddrStr, g_Config.m_SvVoteKickBantime);
|
||||
str_format(aDesc, sizeof(aDesc), "Ban '%s'", Server()->ClientName(KickID));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aCmd, sizeof(aCmd), "set_team_ddr %d 0", KickID);
|
||||
str_format(aCmd, sizeof(aCmd), "uninvite %d %d; set_team_ddr %d 0", KickID, GetDDRaceTeam(KickID), KickID);
|
||||
str_format(aDesc, sizeof(aDesc), "Move '%s' to team 0", Server()->ClientName(KickID));
|
||||
}
|
||||
m_apPlayers[ClientID]->m_Last_KickVote = time_get();
|
||||
m_VoteKick = true;
|
||||
|
@ -1650,13 +1654,13 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
{
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to pause '%s' for %d seconds (%s)", Server()->ClientName(ClientID), Server()->ClientName(SpectateID), g_Config.m_SvVotePauseTime, aReason);
|
||||
str_format(aDesc, sizeof(aDesc), "Pause '%s' (%ds)", Server()->ClientName(SpectateID), g_Config.m_SvVotePauseTime);
|
||||
str_format(aCmd, sizeof(aCmd), "force_pause %d %d", SpectateID, g_Config.m_SvVotePauseTime);
|
||||
str_format(aCmd, sizeof(aCmd), "uninvite %d %d; force_pause %d %d", SpectateID, GetDDRaceTeam(SpectateID), SpectateID, g_Config.m_SvVotePauseTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to move '%s' to spectators (%s)", Server()->ClientName(ClientID), Server()->ClientName(SpectateID), aReason);
|
||||
str_format(aDesc, sizeof(aDesc), "move '%s' to spectators", Server()->ClientName(SpectateID));
|
||||
str_format(aCmd, sizeof(aCmd), "set_team %d -1 %d", SpectateID, g_Config.m_SvVoteSpectateRejoindelay);
|
||||
str_format(aDesc, sizeof(aDesc), "Move '%s' to spectators", Server()->ClientName(SpectateID));
|
||||
str_format(aCmd, sizeof(aCmd), "uninvite %d %d; set_team %d -1 %d", SpectateID, GetDDRaceTeam(SpectateID), SpectateID, g_Config.m_SvVoteSpectateRejoindelay);
|
||||
}
|
||||
m_VoteKick = false;
|
||||
m_VoteSpec = true;
|
||||
|
|
|
@ -362,6 +362,7 @@ private:
|
|||
|
||||
static void ConList(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConSetDDRTeam(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConUninvite(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConFreezeHammer(IConsole::IResult *pResult, void *pUserData);
|
||||
static void ConUnFreezeHammer(IConsole::IResult *pResult, void *pUserData);
|
||||
|
||||
|
|
Loading…
Reference in a new issue