revert to send server messages for now

This commit is contained in:
c0d3d3v 2022-06-29 14:46:23 +02:00
parent 1743b7ce67
commit 435b7ab489
No known key found for this signature in database
GPG key ID: 068AF680530DFF31
2 changed files with 43 additions and 119 deletions

View file

@ -1450,10 +1450,7 @@ void CCharacter::HandleTiles(int Index)
// hit others
if(((m_TileIndex == TILE_HIT_DISABLE) || (m_TileFIndex == TILE_HIT_DISABLE)) && m_Hit != (DISABLE_HIT_GRENADE | DISABLE_HIT_HAMMER | DISABLE_HIT_LASER | DISABLE_HIT_SHOTGUN))
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hit others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hit others");
m_Hit = DISABLE_HIT_GRENADE | DISABLE_HIT_HAMMER | DISABLE_HIT_LASER | DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true;
m_Core.m_NoGrenadeHit = true;
@ -1464,10 +1461,7 @@ void CCharacter::HandleTiles(int Index)
}
else if(((m_TileIndex == TILE_HIT_ENABLE) || (m_TileFIndex == TILE_HIT_ENABLE)) && m_Hit != HIT_ALL)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hit others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hit others");
m_Hit = HIT_ALL;
m_Core.m_NoShotgunHit = false;
m_Core.m_NoGrenadeHit = false;
@ -1480,20 +1474,14 @@ void CCharacter::HandleTiles(int Index)
// collide with others
if(((m_TileIndex == TILE_NPC_DISABLE) || (m_TileFIndex == TILE_NPC_DISABLE)) && !m_Core.m_NoCollision)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't collide with others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't collide with others");
m_Core.m_NoCollision = true;
m_NeededFaketuning |= FAKETUNE_NOCOLL;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(((m_TileIndex == TILE_NPC_ENABLE) || (m_TileFIndex == TILE_NPC_ENABLE)) && m_Core.m_NoCollision)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can collide with others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can collide with others");
m_Core.m_NoCollision = false;
m_NeededFaketuning &= ~FAKETUNE_NOCOLL;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
@ -1502,20 +1490,14 @@ void CCharacter::HandleTiles(int Index)
// hook others
if(((m_TileIndex == TILE_NPH_DISABLE) || (m_TileFIndex == TILE_NPH_DISABLE)) && !m_Core.m_NoHookHit)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hook others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hook others");
m_Core.m_NoHookHit = true;
m_NeededFaketuning |= FAKETUNE_NOHOOK;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(((m_TileIndex == TILE_NPH_ENABLE) || (m_TileFIndex == TILE_NPH_ENABLE)) && m_Core.m_NoHookHit)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hook others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hook others");
m_Core.m_NoHookHit = false;
m_NeededFaketuning &= ~FAKETUNE_NOHOOK;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
@ -1524,10 +1506,7 @@ void CCharacter::HandleTiles(int Index)
// unlimited air jumps
if(((m_TileIndex == TILE_UNLIMITED_JUMPS_ENABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_ENABLE)) && !m_SuperJump)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You have unlimited air jumps");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You have unlimited air jumps");
m_SuperJump = true;
m_Core.m_EndlessJump = true;
if(m_Core.m_Jumps == 0)
@ -1538,10 +1517,7 @@ void CCharacter::HandleTiles(int Index)
}
else if(((m_TileIndex == TILE_UNLIMITED_JUMPS_DISABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_DISABLE)) && m_SuperJump)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You don't have unlimited air jumps");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You don't have unlimited air jumps");
m_SuperJump = false;
m_Core.m_EndlessJump = false;
if(m_Core.m_Jumps == 0)
@ -1565,19 +1541,13 @@ void CCharacter::HandleTiles(int Index)
// jetpack gun
if(((m_TileIndex == TILE_JETPACK_ENABLE) || (m_TileFIndex == TILE_JETPACK_ENABLE)) && !m_Jetpack)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You have a jetpack gun");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You have a jetpack gun");
m_Jetpack = true;
m_Core.m_Jetpack = true;
}
else if(((m_TileIndex == TILE_JETPACK_DISABLE) || (m_TileFIndex == TILE_JETPACK_DISABLE)) && m_Jetpack)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You lost your jetpack gun");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You lost your jetpack gun");
m_Jetpack = false;
m_Core.m_Jetpack = false;
}
@ -1598,52 +1568,40 @@ void CCharacter::HandleTiles(int Index)
if(((m_TileIndex == TILE_TELE_GUN_ENABLE) || (m_TileFIndex == TILE_TELE_GUN_ENABLE)) && !m_Core.m_HasTelegunGun)
{
m_Core.m_HasTelegunGun = true;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun enabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun enabled");
}
else if(((m_TileIndex == TILE_TELE_GUN_DISABLE) || (m_TileFIndex == TILE_TELE_GUN_DISABLE)) && m_Core.m_HasTelegunGun)
{
m_Core.m_HasTelegunGun = false;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun disabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun disabled");
}
if(((m_TileIndex == TILE_TELE_GRENADE_ENABLE) || (m_TileFIndex == TILE_TELE_GRENADE_ENABLE)) && !m_Core.m_HasTelegunGrenade)
{
m_Core.m_HasTelegunGrenade = true;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade enabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade enabled");
}
else if(((m_TileIndex == TILE_TELE_GRENADE_DISABLE) || (m_TileFIndex == TILE_TELE_GRENADE_DISABLE)) && m_Core.m_HasTelegunGrenade)
{
m_Core.m_HasTelegunGrenade = false;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade disabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade disabled");
}
if(((m_TileIndex == TILE_TELE_LASER_ENABLE) || (m_TileFIndex == TILE_TELE_LASER_ENABLE)) && !m_Core.m_HasTelegunLaser)
{
m_Core.m_HasTelegunLaser = true;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser enabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser enabled");
}
else if(((m_TileIndex == TILE_TELE_LASER_DISABLE) || (m_TileFIndex == TILE_TELE_LASER_DISABLE)) && m_Core.m_HasTelegunLaser)
{
m_Core.m_HasTelegunLaser = false;
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser disabled");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser disabled");
}
// stopper
@ -1718,10 +1676,7 @@ void CCharacter::HandleTiles(int Index)
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hammer hit others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hammer hit others");
m_Hit &= ~DISABLE_HIT_HAMMER;
m_NeededFaketuning &= ~FAKETUNE_NOHAMMER;
m_Core.m_NoHammerHit = false;
@ -1729,10 +1684,7 @@ void CCharacter::HandleTiles(int Index)
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hammer hit others");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hammer hit others");
m_Hit |= DISABLE_HIT_HAMMER;
m_NeededFaketuning |= FAKETUNE_NOHAMMER;
m_Core.m_NoHammerHit = true;
@ -1740,55 +1692,37 @@ void CCharacter::HandleTiles(int Index)
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_SHOTGUN && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with shotgun");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with shotgun");
m_Hit &= ~DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = false;
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_SHOTGUN) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with shotgun");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with shotgun");
m_Hit |= DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true;
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_GRENADE && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with grenade");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with grenade");
m_Hit &= ~DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = false;
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_GRENADE) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with grenade");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with grenade");
m_Hit |= DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = true;
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with laser");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can shoot others with laser");
m_Hit &= ~DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = false;
}
else if(Collision()->GetSwitchType(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with laser");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't shoot others with laser");
m_Hit |= DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = true;
}
@ -1802,17 +1736,15 @@ void CCharacter::HandleTiles(int Index)
if(NewJumps != m_Core.m_Jumps)
{
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
char aBuf[256];
if(NewJumps == -1)
str_format(aBuf, sizeof(aBuf), "You only have your ground jump now");
else if(NewJumps == 1)
str_format(aBuf, sizeof(aBuf), "You can jump %d time", NewJumps);
else
str_format(aBuf, sizeof(aBuf), "You can jump %d times", NewJumps);
GameServer()->SendChatTarget(GetPlayer()->GetCID(), aBuf);
}
char aBuf[256];
if(NewJumps == -1)
str_format(aBuf, sizeof(aBuf), "You only have your ground jump now");
else if(NewJumps == 1)
str_format(aBuf, sizeof(aBuf), "You can jump %d time", NewJumps);
else
str_format(aBuf, sizeof(aBuf), "You can jump %d times", NewJumps);
GameServer()->SendChatTarget(GetPlayer()->GetCID(), aBuf);
if(NewJumps == 0 && !m_SuperJump)
{
m_NeededFaketuning |= FAKETUNE_NOJUMP;
@ -2289,10 +2221,8 @@ void CCharacter::SetEndlessHook(bool Enable)
{
return;
}
if(GameServer()->GetClientVersion(GetPlayer()->GetCID()) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), Enable ? "Endless hook has been activated" : "Endless hook has been deactivated");
}
GameServer()->SendChatTarget(GetPlayer()->GetCID(), Enable ? "Endless hook has been activated" : "Endless hook has been deactivated");
m_EndlessHook = Enable;
m_Core.m_EndlessHook = Enable;
}

View file

@ -106,18 +106,12 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
// solo part
if(((m_TileIndex == TILE_SOLO_ENABLE) || (m_TileFIndex == TILE_SOLO_ENABLE)) && !m_Teams.m_Core.GetSolo(ClientID))
{
if(GameServer()->GetClientVersion(ClientID) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(ClientID, "You are now in a solo part");
}
GameServer()->SendChatTarget(ClientID, "You are now in a solo part");
pChr->SetSolo(true);
}
else if(((m_TileIndex == TILE_SOLO_DISABLE) || (m_TileFIndex == TILE_SOLO_DISABLE)) && m_Teams.m_Core.GetSolo(ClientID))
{
if(GameServer()->GetClientVersion(ClientID) < VERSION_DDNET_NEW_HUD)
{
GameServer()->SendChatTarget(ClientID, "You are now out of the solo part");
}
GameServer()->SendChatTarget(ClientID, "You are now out of the solo part");
pChr->SetSolo(false);
}
}