Skip to content

Commit

Permalink
Merge pull request #749 from FIr3baL/FB_Reject_Invalid_USERBATTLESTAT…
Browse files Browse the repository at this point in the history
…US_2

Reject invalid sent USERBATTLESTATUS
  • Loading branch information
FIr3baL authored Aug 7, 2024
2 parents a8d8185 + b8937e4 commit a86e884
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/liblobby/lobby/interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,12 @@ function Interface:_OnClientBattleStatus(userName, battleStatus, teamColor)
local status = self:ParseBattleStatus(battleStatus)
status.teamColor = ParseTeamColor(teamColor)

local userInfo = self.users[userName]
if userInfo and (not userInfo.battleID or userInfo.battleID ~= self:GetMyBattleID()) then
Spring.Log(LOG_SECTION, LOG.WARNING, "Can't update user's battle status, user is not in our battle: ", userName)
return
end

self:_OnUpdateUserBattleStatus(userName, status)
if userName == self.myUserName then
self:_EnsureMyTeamNumberIsUnique()
Expand Down

0 comments on commit a86e884

Please sign in to comment.