Skip to content

Commit

Permalink
Introduce basic anti-spam protection from taunts (#6099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed Apr 20, 2024
1 parent 23f00a0 commit 7f8b327
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 44 deletions.
51 changes: 25 additions & 26 deletions changelog/3809.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
# Game Version 3808

## Bug Fixes
Fixes various reported issues.

<!-- Remove header when empty -->
With gratitude to all those who took the time to report issues,

## Balance
Jip

<!-- Remove header when empty -->
## Balance changes

## Features
- (#6099) Decrease rate of fire of the Cybran TML

- (#6079) Make various structures easier to place to help with base building.
- All Tech 3 Power Generators, Tech 3 Mass Fabricators, Tech 3 Artilleries, Shield Structures, Land Factories and Air Factories:
- MaxGroundVariation: 1.0 --> 1.1
- All Game Enders except for the Scathis:
- MaxGroundVariation: 1.0 --> 1.2
It can now fire a tactical missile every 3 seconds instead of every 1.5 seconds. Other factions can fire a tactical missile every 6 seconds.

## Graphics
## Bug fixes

<!-- Remove header when empty -->
- (#6099) Fix a bug where the lobby would reject players with a nickname of just 2 characters

## AI
- (7905d0) Fix a bug where the UEF ACU would get confused and steer away from targets right outside the attack radius of the primary weapon

<!-- Remove header when empty -->
## Other changes

## Other Changes
- (#6099) Add basic anti-spam protection against taunts

<!-- Remove header when empty -->
- (#6079) Make various structures easier to place to help with base building.
- All Tech 3 Power Generators, Tech 3 Mass Fabricators, Tech 3 Artilleries, Shield Structures, Land Factories and Air Factories:
- MaxGroundVariation: 1.0 --> 1.1
- All Game Enders except for the Scathis:
- MaxGroundVariation: 1.0 --> 1.2

## Contributors

With thanks to the following people who contributed through coding:

<!-- Remove when empty -->

With thanks to the following people who contributed through binary patches:

<!-- Remove when empty -->

With thanks to the following individuals who contributed through model, texture, and effect changes:

<!-- Remove when empty -->
- Jip
- Basilisk3

And, last but certainly not least - with thanks to those that took part in constructive discussions:

<!-- Remove when empty -->
- Sheikah
- Brutus5000
- Sladow
- Farms
- Tatsu
- Melanol
- relentless
118 changes: 118 additions & 0 deletions changelog/3810.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Game Version 3809

## Bug Fixes

<!-- Remove header when empty -->

## Balance

- (#6060) Make shields absorb ACU explosions.

Both mobile and static shields absorb full damage from ACU explosions. For example, this prevents ACU explosions from killing all engineers inside shielded bases/firebases or killing all units in mobile-shielded T2 armies.
The structure part of static shields still takes reduced structure damage from ACU explosions.

- (#6073, #6094) Allow Mongoose to fire from transports.

- (#5901) Increase UEF T3 MAA's DPS and damage, and swap its speed with Aeon's T3 MAA.

- Cougar: DPS: 176 -> 206, Damage per volley: 1200 -> 1400, Speed: 3.3 -> 3.5
- Redeemer: Speed: 3.5 -> 3.3

This brings its DPS closer in line with other factions, lets it 3 shot strategic bombers instead of 4 shot, and lets it better escort Titans/Parashields.
Redeemer's extra speed wasn't very necessary for its role within Aeon, so it was chosen to be swapped with.

- (#5874) Fine tune the balance of the Tech 2 Navy stage.
- Uashavoh: T2 Destroyer (XSS0201):
- AntiTorpedo RateOfFire: 0.26 --> 0.3
- Salem Class: T2 Destroyer (URS0201):
- BackUpDistance: 5 --> 10
- Cooper: T2 Torpedo Boat (XES0102):
- Health: 1750 --> 2000

- (#5895) After receiving several buffs, the Seraphim Tech 3 Submarine Hunter has become too oppressive, especially in larger formations. These changes aim to bring it back in line, while keeping its identity.
- Yathsou: T3 Submarine Hunter (XSS0304):
- Damage: 290 --> 380
- RateOfFire: 0.25 --> 0.22
- MuzzleSalvoDelay: 0.7 --> 1
- MuzzleSalvoSize: 5 --> 4
- DPS: 363 --> 338
- Torpedo Defense RateOfFire (x2): 0.15 --> 0.1

- (#6043) The `BuildRate` and `BuildTime` stats of all Radars and Sonars are updated to be more streamlined. The build time of Tech 2 Sonars is corrected to ensure it is not longer than that of Tech 3 Sonars. Tech 3 Sonars get their very low build time increased, to compensate for their Tech 2 counterparts being much quicker to build and providing more build power.
- Tech 1 Radars
- BuildRate: 14.08 --> 13
- Tech 2 Radars
- BuildRate: 21.46 --> 20
- BuildTime: 845 --> 780
- Tech 3 Radars
- BuildTime: 2575 --> 2400
- Tech 1 Sonars
- BuildRate: 14.08 --> 13
- BuildTime: 127.5 --> 125
- BuildCostEnergy: 1275 --> 1250
- Tech 2 Sonars
- BuildRate: 15 --> 20
- BuildTime: 1680 --> 780
- BuildTime: 2120 --> 1040 (Seraphim)
- Tech 3 Sonars
- BuildTime: 750 --> 1200
- BuildTime: 900 --> 1400 (Cybran)

- (#6082) The `BuildRate` and `BuildTime` stats of several Shield Generators are updated to be more streamlined. The Seraphim Tech 2 Shield Generator gains build power, as it previously had a very low amount. The Aeon Tech 2 Shield Generator loses its build power, as it cannot be upgraded.
- Tech 2 Shield Generators
- BuildRate: 13.66 --> 0 (Aeon)
- BuildRate: 12.98 --> 20 (Seraphim)
- BuildRate: 19.95 --> 20 (UEF)
- Tech 3 Shield Generators
- BuildTime: 5841 --> 5800 (Seraphim)
- BuildTime: 4988 --> 5000 (UEF)

## Features

- (#6079) Make various structures easier to place to help with base building.
- All Tech 3 Power Generators, Tech 3 Mass Fabricators, Tech 3 Artilleries, Shield Structures, Land Factories and Air Factories:
- MaxGroundVariation: 1.0 --> 1.1
- All Game Enders except for the Scathis:
- MaxGroundVariation: 1.0 --> 1.2

## Graphics

<!-- Remove header when empty -->

## AI

- (#6046) Fix issue with T2 static artillery not receiving any surface threat during blueprint pass over.

## Other Changes

- (#5668, #6066) Rework Seraphim weapon modules

- (#6067) Fix a performance issue related to AIs and their transport logic

- (#6041, #6055) Clean up the blueprint-files of various structures.

- (#6042) Improve annotations for `OnMotionHorzEventChange` and `OnMotionVertEventChange`

- (#6086) Ensure that the Cooper's hitbox aligns with its model

## Contributors

With thanks to the following people who contributed through coding:

- Relent0r
- Basilisk3
- Rowey
- Jip
- lLl1l1

With thanks to the following people who contributed through binary patches:

<!-- Remove when empty -->

With thanks to the following individuals who contributed through model, texture, and effect changes:

<!-- Remove when empty -->

And, last but certainly not least - with thanks to those that took part in constructive discussions:

<!-- Remove when empty -->
39 changes: 32 additions & 7 deletions lua/ui/game/taunt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,44 @@ local taunts = {
-- {text = '<LOC MP_Taunt_0033>', bank = '', cue = ''},
}

---@type table<string, number>
local lastTauntTimestamp = { }

local prevHandle

---@param sender string # player name
---@param msg { Taunt: boolean; data: string }
local function RecieveTaunt(sender, msg)
if Prefs.GetOption('mp_taunt_head_enabled') == 'true' then
local taunt = taunts[msg.data]
if taunt then
StopSound(prevHandle)
prevHandle = PlayVoice(Sound({Cue = taunt.cue, Bank = taunt.bank}))
import("/lua/ui/game/chat.lua").ReceiveChat(sender, {Chat = true, text = LOC(taunt.text), to = "all"})
end

-- check if we accept taunts
if Prefs.GetOption('mp_taunt_head_enabled') != 'true' then
return
end

-- check if the taunt exists
local taunt = taunts[msg.data]
if not taunt then
return
end

-- at this point we do show the message
import("/lua/ui/game/chat.lua").ReceiveChat(sender, {Chat = true, text = LOC(taunt.text), to = "all"})

-- check if we also play a sound
local systemTimeSeconds = GetSystemTimeSeconds()
if lastTauntTimestamp[sender] and (systemTimeSeconds - lastTauntTimestamp[sender] < 10) then
return
end

lastTauntTimestamp[sender] = systemTimeSeconds

-- make sure to remove any taunts that are playing right now
StopSound(prevHandle)
prevHandle = PlayVoice(Sound({Cue = taunt.cue, Bank = taunt.bank}))
end

---@param sender string # player name
---@param msg { Taunt: boolean; data: string, aisender: string }
function RecieveAITaunt(sender, msg)
if Prefs.GetOption('mp_taunt_head_enabled') == 'true' then
local taunt = taunts[msg.data]
Expand Down
2 changes: 1 addition & 1 deletion lua/ui/lobby/changelogData.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---@type number
last_version = 3808
last_version = 3809

---@type PatchNotes[]
gamePatches = {
Expand Down
2 changes: 1 addition & 1 deletion lua/ui/lobby/lobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5241,7 +5241,7 @@ local MessageHandlers = {
end

local charactersInPlayerName = string.len(data.PlayerOptions.PlayerName)
if charactersInPlayerName < 3 or charactersInPlayerName > 32 then
if charactersInPlayerName < 2 or charactersInPlayerName > 32 then
return false
end

Expand Down
6 changes: 3 additions & 3 deletions lua/version.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

local Version = "3808"
---@alias PATCH "3808"
---@alias VERSION "1.5.3808"
local Version = "3809"
---@alias PATCH "3809"
---@alias VERSION "1.5.3809"
---@return PATCH
function GetVersion()
LOG('Supreme Commander: Forged Alliance version ' .. Version)
Expand Down
34 changes: 29 additions & 5 deletions mod_info.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
-- Forged Alliance Forever mod_info.lua file
--
-- Documentation for the extended FAF mod_info.lua format can be found here:
-- https://github.com/FAForever/fa/wiki/mod_info.lua-documentation
--******************************************************************************************************
--** Copyright (c) 2024 FAForever
--**
--** Permission is hereby granted, free of charge, to any person obtaining a copy
--** of this software and associated documentation files (the "Software"), to deal
--** in the Software without restriction, including without limitation the rights
--** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
--** copies of the Software, and to permit persons to whom the Software is
--** furnished to do so, subject to the following conditions:
--**
--** The above copyright notice and this permission notice shall be included in all
--** copies or substantial portions of the Software.
--**
--** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
--** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
--** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
--** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
--** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
--** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
--** SOFTWARE.
--******************************************************************************************************

-- You can learn more about how the server parses this type of file here:
-- - https://github.com/FAForever/faf-java-commons/blob/develop/faf-commons-data%2Fsrc%2Fmain%2Fjava%2Fcom%2Ffaforever%2Fcommons%2Fmod%2FModReader.java
--
-- You can learn more about how the game parses this type of file here:
-- - https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/MODS.LUA

name = "Forged Alliance Forever"
version = 3808
version = 3809 -- needs to be an integer as it is parsed as a short (16 bit integer)
_faf_modname='faf'
copyright = "Forged Alliance Forever Community"
description = "Forged Alliance Forever extends Forged Alliance, bringing new patches, game modes, units, ladder, and much more!"
Expand Down
2 changes: 1 addition & 1 deletion units/URB2108/URB2108_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ UnitBlueprint{
RackFireTogether = false,
RackRecoilDistance = 0,
RackReloadTimeout = 10,
RackSalvoChargeTime = 1.5,
RackSalvoChargeTime = 3.0,
RackSalvoReloadTime = 3.5,
RackSalvoSize = 1,
RackSlavedToTurret = false,
Expand Down

0 comments on commit 7f8b327

Please sign in to comment.