diff --git a/src/constants/stats.ts b/src/constants/stats.ts index 4eb4bf868..5eac2aa19 100644 --- a/src/constants/stats.ts +++ b/src/constants/stats.ts @@ -22,6 +22,7 @@ export enum RoomStatsKeys { MinHaulerCost = 'mhc', EnergyOutputTransactionCosts = 'eotc', EnergyTerminalSentDomestic = 'etsd', + EnergyTerminalReceivedDomestic = 'etrd', EnergyTerminalSentOther = 'etso', CpuUsed = 'cpu', @@ -61,6 +62,7 @@ export const averageStatNames: Set<keyof CommuneStats | keyof RoomStats> = new S RoomStatsKeys.RemoteEnergyOutputBuild, RoomStatsKeys.EnergyOutputTransactionCosts, RoomStatsKeys.EnergyTerminalSentDomestic, + RoomStatsKeys.EnergyTerminalReceivedDomestic, RoomStatsKeys.EnergyTerminalSentOther, RoomStatsKeys.CpuUsed, ]) diff --git a/src/international/stats.ts b/src/international/stats.ts index 84fc4f454..857587c58 100644 --- a/src/international/stats.ts +++ b/src/international/stats.ts @@ -43,6 +43,7 @@ export class StatsManager { [RoomStatsKeys.MinHaulerCost]: 0, [RoomStatsKeys.EnergyOutputTransactionCosts]: 0, [RoomStatsKeys.EnergyTerminalSentDomestic]: 0, + [RoomStatsKeys.EnergyTerminalReceivedDomestic]: 0, [RoomStatsKeys.EnergyTerminalSentOther]: 0, [RoomStatsKeys.CpuUsed]: 0, }) diff --git a/src/international/transactions.ts b/src/international/transactions.ts index 01dfc22b9..982529a75 100644 --- a/src/international/transactions.ts +++ b/src/international/transactions.ts @@ -90,6 +90,11 @@ export class TransactionsManager { RoomStatsKeys.EnergyTerminalSentDomestic, transaction.amount, ) + StatsManager.updateCommuneStat( + transaction.to, + RoomStatsKeys.EnergyTerminalReceivedDomestic, + transaction.amount, + ) } // Not a domestic trade else { diff --git a/src/types/stats.ts b/src/types/stats.ts index 1214bde04..1a617dfc1 100644 --- a/src/types/stats.ts +++ b/src/types/stats.ts @@ -29,6 +29,7 @@ export interface CommuneStats extends RoomStats { [RoomStatsKeys.MinHaulerCost]: number [RoomStatsKeys.EnergyOutputTransactionCosts]: number [RoomStatsKeys.EnergyTerminalSentDomestic]: number + [RoomStatsKeys.EnergyTerminalReceivedDomestic]: number [RoomStatsKeys.EnergyTerminalSentOther]: number [RoomStatsKeys.BatteriesStoredTimes10]: number [RoomStatsKeys.CpuUsed]: number