Fixed send size of player entity stats
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"Lua.workspace.userThirdParty": [
|
||||
"c:\\Users\\jangr\\AppData\\Roaming\\Code\\User\\workspaceStorage\\efbcb086d2b4a3aca622c4db8c3b2aec\\justarandomgeek.factoriomod-debug\\sumneko-3rd"
|
||||
"c:\\Users\\jangr\\AppData\\Roaming\\Code\\User\\workspaceStorage\\14f36f4acfd74cd0fa85ac34cb84b920\\justarandomgeek.factoriomod-debug\\sumneko-3rd"
|
||||
],
|
||||
"Lua.workspace.checkThirdParty": "ApplyInMemory",
|
||||
"factorio.versions": [
|
||||
|
||||
@@ -240,7 +240,6 @@ function SendGameStats()
|
||||
returnParts[#returnParts + 1] = GetPlayerDeaths()
|
||||
returnParts[#returnParts + 1] = GetPlayerDeathCauses()
|
||||
returnParts[#returnParts + 1] = GetPlayerKills()
|
||||
returnParts[#returnParts + 1] = GetPlayerEntityStats()
|
||||
helpers.send_udp(udpAddress, table.concat(returnParts, "\n"), serverIndex)
|
||||
end
|
||||
end
|
||||
@@ -280,7 +279,10 @@ function SendAll(event)
|
||||
sendIndex = (sendIndex % 10) + 1
|
||||
if sendIndex == 1 then SendProductionStats() end
|
||||
if sendIndex == 2 then SendPollutionStats() end
|
||||
if sendIndex == 3 then SendKillStats() end
|
||||
if sendIndex == 3 then
|
||||
SendKillStats()
|
||||
SendPlayerEntityStats()
|
||||
end
|
||||
if sendIndex == 4 then SendFluidProductionStats() end
|
||||
if sendIndex == 5 then SendBuildStats() end
|
||||
if sendIndex == 6 then
|
||||
|
||||
@@ -32,7 +32,7 @@ function GetPlayerKills()
|
||||
return table.concat(killParts, "\n")
|
||||
end
|
||||
|
||||
function GetPlayerEntityStats()
|
||||
function SendPlayerEntityStats()
|
||||
local entityParts = {}
|
||||
entityParts[#entityParts + 1] = "---player-build-stats---"
|
||||
for playerIndex, items in pairs(storage.constructedEntites) do
|
||||
@@ -41,13 +41,16 @@ function GetPlayerEntityStats()
|
||||
entityParts[#entityParts + 1] = ("%s:%s:constructed:%s:%s"):format(playerIndex, playerName, itemName, itemCount)
|
||||
end
|
||||
end
|
||||
helpers.send_udp(udpAddress,table.concat(entityParts,"\n",serverIndex))
|
||||
entityParts = {}
|
||||
entityParts[#entityParts + 1] = "---player-build-stats---"
|
||||
for playerIndex, items in pairs(storage.deconstructedEntities) do
|
||||
local playerName = game.players[playerIndex].name
|
||||
for itemName, itemCount in pairs(items) do
|
||||
entityParts[#entityParts + 1] = ("%s:%s:deconstructed:%s:%s"):format(playerIndex, playerName, itemName, itemCount)
|
||||
end
|
||||
end
|
||||
return table.concat(entityParts, "\n")
|
||||
helpers.send_udp(udpAddress,table.concat(entityParts,"\n",serverIndex))
|
||||
end
|
||||
|
||||
function GetMapSeed()
|
||||
|
||||
Reference in New Issue
Block a user