mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
make swap messages more personal
This commit is contained in:
parent
0ea811f70e
commit
808526bdd8
|
@ -40,7 +40,7 @@ public:
|
|||
virtual void TickDefered();
|
||||
virtual void TickPaused();
|
||||
virtual void Snap(int SnappingClient);
|
||||
virtual void SwapClients(int Client1, int Client2) override;
|
||||
virtual void SwapClients(int Client1, int Client2);
|
||||
|
||||
bool CanSnapCharacter(int SnappingClient);
|
||||
|
||||
|
|
|
@ -816,19 +816,24 @@ void CGameTeams::RequestTeamSwap(CPlayer *pPlayer, CPlayer *pTargetPlayer, int T
|
|||
if(pPlayer->m_SwapTargetsClientID == pTargetPlayer->GetCID())
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
"%s has already requested to swap with %s.",
|
||||
Server()->ClientName(pPlayer->GetCID()), Server()->ClientName(pTargetPlayer->GetCID()));
|
||||
"You have already requested to swap with %s.", Server()->ClientName(pTargetPlayer->GetCID()));
|
||||
|
||||
GameServer()->SendChatTeam(Team, aBuf);
|
||||
GameServer()->SendChatTarget(pPlayer->GetCID(), aBuf);
|
||||
return;
|
||||
}
|
||||
|
||||
//Message for the the team
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
"%s has requested to swap with %s. Please wait %d seconds then type /swap %s.",
|
||||
Server()->ClientName(pPlayer->GetCID()), Server()->ClientName(pTargetPlayer->GetCID()), g_Config.m_SvSaveSwapGamesDelay, Server()->ClientName(pPlayer->GetCID()));
|
||||
|
||||
"%s has requested to swap with %s.",
|
||||
Server()->ClientName(pPlayer->GetCID()), Server()->ClientName(pTargetPlayer->GetCID()));
|
||||
GameServer()->SendChatTeam(Team, aBuf);
|
||||
|
||||
// Message to the target swap player
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
"To complete the swap process please wait %d seconds and then type /swap %s.",
|
||||
g_Config.m_SvSaveSwapGamesDelay, Server()->ClientName(pPlayer->GetCID()));
|
||||
GameServer()->SendChatTarget(pTargetPlayer->GetCID(), aBuf);
|
||||
|
||||
pPlayer->m_SwapTargetsClientID = pTargetPlayer->GetCID();
|
||||
m_LastSwap[Team] = Server()->Tick();
|
||||
}
|
||||
|
@ -847,7 +852,7 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
|
|||
"You have to wait %d seconds until you can swap.",
|
||||
g_Config.m_SvSaveSwapGamesDelay - Since);
|
||||
|
||||
GameServer()->SendChatTeam(Team, aBuf);
|
||||
GameServer()->SendChatTarget(pPlayer->GetCID(), aBuf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -867,12 +872,11 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
|
|||
"Your swap request timed out %d seconds ago. Use /swap again to re-initiate it.",
|
||||
Since - g_Config.m_SvSwapTimeout);
|
||||
|
||||
GameServer()->SendChatTeam(Team, aBuf);
|
||||
GameServer()->SendChatTarget(pPlayer->GetCID(), aBuf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CSaveTee PrimarySavedTee;
|
||||
PrimarySavedTee.Save(pPlayer->GetCharacter());
|
||||
|
||||
|
|
Loading…
Reference in a new issue