Skip to content

Commit

Permalink
Update AnomalyDetector.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
AqwamCreates authored Oct 14, 2023
1 parent 41fb6a1 commit 7fdde4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DistributedComputing/AnomalyDetector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ function AnomalyDetector:onPlayerAdded(Player: Player)

end

function AnomalyDetector:onPredictedValueReceived(WatchingPlayer: Player, watchedPlayerStringUserId: number, predictedValue: number)
function AnomalyDetector:onPredictedValueReceived(WatchingPlayer: Player, watchedPlayerStringUserId: number, predictedValue: number, fullDataVector)

local numberOfPlayersInServer = #Players:GetPlayers()

local watchingPlayerStringUserId = tostring(WatchingPlayer.UserId)

local WatchedPlayer = convertStringUserIdToPlayer(watchedPlayerStringUserId)

if self.PredictedValueReceivedFunction then self.PredictedValueReceivedFunction(WatchingPlayer, WatchedPlayer, predictedValue) end
if self.PredictedValueReceivedFunction then self.PredictedValueReceivedFunction(WatchingPlayer, WatchedPlayer, predictedValue, fullDataVector) end

if (watchingPlayerStringUserId == watchedPlayerStringUserId) and (numberOfPlayersInServer > 1) and self.OnClientAccessedFunction then self.OnClientAccessedFunction(WatchingPlayer, WatchedPlayer, predictedValue) return end

Expand Down Expand Up @@ -259,11 +259,11 @@ function AnomalyDetector:createConnectionsArray()

end)

local SendPredictedValueRemoteEventConnection = SendPredictedValueRemoteEvent.OnServerEvent:Connect(function(WatchingPlayer, watchedPlayerStringUserId, predictedValue)
local SendPredictedValueRemoteEventConnection = SendPredictedValueRemoteEvent.OnServerEvent:Connect(function(WatchingPlayer, watchedPlayerStringUserId, predictedValue, fullDataVector)

if not WatchingPlayer then return end

self:onPredictedValueReceived(WatchingPlayer, watchedPlayerStringUserId, predictedValue)
self:onPredictedValueReceived(WatchingPlayer, watchedPlayerStringUserId, predictedValue, fullDataVector)

end)

Expand Down

0 comments on commit 7fdde4d

Please sign in to comment.