import "steammessages.proto";
import "dota_shared_enums.proto";
import "dota_gcmessages_common.proto";
import "gcsdk_gcmessages.proto";
import "base_gcmessages.proto";
import "econ_gcmessages.proto";
import "valveextensions.proto";

enum CMsgBattleReport_HighlightType {
	k_eHighlightTypeInvalid = -1 [(schema_suppress_enumerator) = true];
	k_eGameWinrate = 0 [(schema_friendly_name) = "Game Winrate"];
	k_eLaneWinrate = 1 [(schema_friendly_name) = "Lane Winrate"];
	k_eMMRDelta = 2 [(schema_friendly_name) = "Ranked MMR Delta"];
	k_eNumHeroesPlayed = 3 [(schema_friendly_name) = "Number of Heroes Played"];
	k_eNumGamesPlayed = 4 [(schema_friendly_name) = "Number of Games Played"];
	k_eAveragePowerRunesTaken = 5 [(schema_friendly_name) = "Average Power Runes Taken"];
	k_eAverageBountyRunesTaken = 6 [(schema_friendly_name) = "Average Bounty Runes Taken"];
	k_eTotalKillEnemyT1First = 7 [(schema_friendly_name) = "Total Enemy T1 Destroyed First"];
	k_eTotalRoshanKills = 8 [(schema_friendly_name) = "Total Roshan Kills"];
	k_eTotalDewards = 9 [(schema_friendly_name) = "Total Dewards"];
	k_eTotalCampsStacked = 10 [(schema_friendly_name) = "Total Camps Stacked"];
	k_eMaxWinstreak = 11 [(schema_friendly_name) = "Max Win Streak"];
	k_eAverageDewards = 12 [(schema_friendly_name) = "Average Dewards"];
	k_eAverageKills = 13 [(schema_friendly_name) = "Average Kills"];
	k_eMaxKills = 14 [(schema_friendly_name) = "Max Kills"];
	k_eAverageAssists = 15 [(schema_friendly_name) = "Average Assists"];
	k_eMaxAssists = 16 [(schema_friendly_name) = "Max Assists"];
	k_eAverageDeaths = 17 [(schema_friendly_name) = "Average Deaths"];
	k_eMinDeaths = 18 [(schema_friendly_name) = "Min Deaths"];
	k_eAverageCampsStacked = 19 [(schema_friendly_name) = "Average Camps Stacked"];
	k_eTotalLastHits = 20 [(schema_friendly_name) = "Total Last Hits"];
	k_eAverageLastHits = 21 [(schema_friendly_name) = "Average Last Hits"];
	k_eTotalDenies = 22 [(schema_friendly_name) = "Total Denies"];
	k_eAverageDenies = 23 [(schema_friendly_name) = "Average Denies"];
	k_eTotalGamesWithRoshanAdvantage = 24 [(schema_friendly_name) = "Total Games With Roshan Advantage (Player team killed Roshan more times)"];
	k_ePercentGamesWithRoshanAdvantage = 25 [(schema_friendly_name) = "Pct Games With Roshan Advantage (Player team killed Roshan more times)"];
	k_eAverageStunDuration = 26 [(schema_friendly_name) = "Average Stun Duration"];
	k_eTotalStunDuration = 27 [(schema_friendly_name) = "Total Stun Duration"];
	k_eAverageTeleportsUsed = 28 [(schema_friendly_name) = "Average Teleports Used"];
	k_eTotalTeleportsUsed = 29 [(schema_friendly_name) = "Total Teleports Used"];
	k_eAverageHeroDamage = 30 [(schema_friendly_name) = "Average Hero Damage"];
	k_eTotalHeroDamage = 31 [(schema_friendly_name) = "Total Hero Damage"];
	k_eAverageHeroHealing = 32 [(schema_friendly_name) = "Average Hero Healing"];
	k_eTotalHeroHealing = 33 [(schema_friendly_name) = "Total Hero Healing"];
	k_eAverageTowerDamage = 34 [(schema_friendly_name) = "Average Tower Damage"];
	k_eTotalTowerDamage = 35 [(schema_friendly_name) = "Total Tower Damage"];
	k_eMaxLossStreak = 36 [(schema_friendly_name) = "Max Loss Streak"];
	k_eAverageGameDuration = 37 [(schema_friendly_name) = "Average Game Duration"];
	k_eMaxGameDuration = 38 [(schema_friendly_name) = "Max Game Duration"];
	k_eMinGameDuration = 39 [(schema_friendly_name) = "Min Game Duration"];
	k_eAverageWinDuration = 40 [(schema_friendly_name) = "Average Win Duration"];
	k_eMaxWinDuration = 41 [(schema_friendly_name) = "Max Win Duration"];
	k_eMinWinDuration = 42 [(schema_friendly_name) = "Min Win Duration"];
	k_eAverageLossDuration = 43 [(schema_friendly_name) = "Average Loss Duration"];
	k_eMaxLossDuration = 44 [(schema_friendly_name) = "Max Loss Duration"];
	k_eMinLossDuration = 45 [(schema_friendly_name) = "Min Loss Duration"];
	k_ePctGamesEnemyT1TakenFirst = 46 [(schema_friendly_name) = "Pct Games With Enemy Lane T1 Taken First"];
	k_eMaxCampsStacked = 47 [(schema_friendly_name) = "Max Camps Stacked"];
	k_eMaxDewards = 48 [(schema_friendly_name) = "Max Dewards"];
	k_eMaxRoshanKills = 49 [(schema_friendly_name) = "Max Roshan Kills"];
	k_eMaxBountyRunesTaken = 50 [(schema_friendly_name) = "Max Bounty Runes Taken"];
	k_eMaxPowerRunesTaken = 51 [(schema_friendly_name) = "Max Power Runes Taken"];
	k_eMaxDeaths = 52 [(schema_friendly_name) = "Max Deaths"];
	k_eMaxLastHits = 53 [(schema_friendly_name) = "Max Last Hits"];
	k_eMaxDenies = 54 [(schema_friendly_name) = "Max Denies"];
	k_eRadiantWinRate = 55 [(schema_friendly_name) = "Radiant Winrate"];
	k_eDireWinRate = 56 [(schema_friendly_name) = "Dire Winrate"];
	k_eRadiantGameCount = 57 [(schema_friendly_name) = "Radiant Game Count"];
	k_eDireGameCount = 58 [(schema_friendly_name) = "Dire Game Count"];
	k_eMaxDamage = 59 [(schema_friendly_name) = "Max Hero Damage"];
	k_eMaxHealing = 60 [(schema_friendly_name) = "Max Healing"];
	k_eMaxTowerDamage = 61 [(schema_friendly_name) = "Max Tower Damage"];
	k_eAverageGPM = 62 [(schema_friendly_name) = "Average GPM"];
	k_eMaxGPM = 63 [(schema_friendly_name) = "Max GPM"];
	k_eAverageXPM = 64 [(schema_friendly_name) = "Average XPM"];
	k_eMaxXPM = 65 [(schema_friendly_name) = "Max XPM"];
}

enum CMsgBattleReport_HighlightCategory {
	k_eHighlightGeneral = 0 [(schema_friendly_name) = "General"];
	k_eHighlightHero = 1 [(schema_friendly_name) = "Hero"];
	k_eHighlightRole = 2 [(schema_friendly_name) = "Role"];
}

enum CMsgBattleReport_Role {
	k_eUnknownRole = -1 [(schema_suppress_enumerator) = true];
	k_eSafelane = 0 [(schema_friendly_name) = "Safe Lane"];
	k_eMidlane = 1 [(schema_friendly_name) = "Mid Lane"];
	k_eOfflane = 2 [(schema_friendly_name) = "Off Lane"];
	k_eSupport = 3 [(schema_friendly_name) = "Support"];
	k_eHardSupport = 4 [(schema_friendly_name) = "Hard Support"];
}

enum CMsgBattleReport_CompareContext {
	k_eCompareContextInvalid = -1 [(schema_suppress_enumerator) = true];
	k_eAbsoluteValue = 0 [(schema_friendly_name) = "Overall Value"];
	k_ePlayersOfSimilarRank = 1 [(schema_friendly_name) = "Vs Rank Population"];
	k_eAllPlayers = 2 [(schema_friendly_name) = "Vs All Players"];
	k_ePlayersPersonalHistory = 3 [(schema_friendly_name) = "Vs Personal History"];
}

enum CMsgBattleReport_HighlightTier {
	k_eHighlightTierLow = -1 [(schema_friendly_name) = "Tier Low"];
	k_eHighlightTierNone = 0 [(schema_suppress_enumerator) = true];
	k_eHighlightTier1 = 1 [(schema_friendly_name) = "Tier 1"];
	k_eHighlightTier2 = 2 [(schema_friendly_name) = "Tier 2"];
	k_eHighlightTier3 = 3 [(schema_friendly_name) = "Tier 3"];
	k_eHighlightTierCustom = 4 [(schema_friendly_name) = "Custom"];
}

enum CMsgBattleReport_HighlightRarity {
	k_eHighlightCommon = 0 [(schema_friendly_name) = "Common"];
	k_eHighlightUncommon = 1 [(schema_friendly_name) = "Uncommon"];
	k_eHighlightRare = 2 [(schema_friendly_name) = "Rare"];
}

enum CMsgBattleReport_EOutcome {
	k_eWin = 0;
	k_eLoss = 1;
}

enum CMsgBattleReport_ELaneOutcome {
	k_eUnknownLaneOutcome = -1;
	k_eWonLane = 0;
	k_eLostLane = 1;
	k_eEvenLane = 2;
}

message CMsgClientToGCGetBattleReport {
	optional uint32 account_id = 1;
	optional uint32 timestamp = 2;
	optional uint32 duration = 3;
}

message CMsgBattleReport_Game {
	optional int32 hero_id = 1;
	optional uint32 kills = 2;
	optional uint32 deaths = 3;
	optional uint32 assists = 4;
	optional int32 rank_change = 5;
	optional uint32 last_hits = 6;
	optional uint32 denies = 21;
	optional uint32 gpm = 7;
	optional uint32 xpm = 8;
	optional .CMsgBattleReport_Role role = 9 [default = k_eUnknownRole];
	optional .CMsgBattleReport_EOutcome outcome = 10 [default = k_eWin];
	optional .CMsgBattleReport_ELaneOutcome lane_outcome = 11 [default = k_eUnknownLaneOutcome];
	optional bool ranked = 12;
	optional uint64 match_id = 13;
	optional uint32 lane_selection_flags = 14;
	optional uint32 predicted_position = 15;
	optional uint32 seconds_dead = 16;
	optional uint32 winning_team = 17;
	optional uint32 player_slot = 28;
	optional bool party_game = 19;
	optional uint32 start_time = 20;
	optional uint32 bounty_runes = 22;
	optional uint32 water_runes = 23;
	optional uint32 power_runes = 24;
	optional uint32 time_enemy_t1_tower_destroyed = 25;
	optional uint32 time_friendly_t1_tower_destroyed = 26;
	optional uint32 enemy_roshan_kills = 27;
	optional uint32 teleports_used = 29;
	optional uint32 dewards = 30;
	optional uint32 camps_stacked = 31;
	optional uint32 support_gold = 32;
	optional uint32 hero_damage = 33;
	optional uint32 hero_healing = 34;
	optional uint32 tower_damage = 35;
	optional uint32 successful_smokes = 36;
	optional uint32 stun_duration = 37;
	optional uint32 duration = 38;
	optional uint32 friendly_roshan_kills = 39;
	optional int32 previous_rank = 40;
	optional uint32 game_mode = 41;
	optional uint32 lobby_type = 42;
	optional float time_purchased_shard = 43;
	optional float time_purchased_scepter = 44;
	optional int32 item0 = 45 [default = -1];
	optional int32 item1 = 46 [default = -1];
	optional int32 item2 = 47 [default = -1];
	optional int32 item3 = 48 [default = -1];
	optional int32 item4 = 49 [default = -1];
	optional int32 item5 = 50 [default = -1];
	optional uint32 selected_facet = 51;
}

message CMsgBattleReport_GameList {
	repeated .CMsgBattleReport_Game games = 1;
}

message CMsgBattleReport {
	message HighlightGeneral {
		optional int32 win_loss_window = 1;
		optional float win_percent = 2;
		optional int32 mmr_delta = 3;
		optional float highlight_score = 4;
	}

	message Highlight {
		required uint32 highlight_id = 1;
		required .CMsgBattleReport_HighlightCategory category = 2 [default = k_eHighlightGeneral];
		optional .CMsgBattleReport_HighlightTier tier = 3 [default = k_eHighlightTierLow];
		optional .CMsgBattleReport_HighlightRarity rarity = 4 [default = k_eHighlightCommon];
		optional float score = 5;
		optional float confidence = 6;
		optional int32 hero_id = 7;
		optional .CMsgBattleReport_Role role = 8 [default = k_eUnknownRole];
		optional float comparison_delta_value = 9;
		optional .CMsgBattleReport_CompareContext context = 10 [default = k_eCompareContextInvalid];
	}

	repeated .CMsgBattleReport_Game games = 1;
	optional .CMsgBattleReportHighlights highlights = 3;
}

message CMsgBattleReportInfo {
	optional uint32 timestamp = 1;
	optional uint32 duration = 2;
	optional bool acknowledged = 3;
	optional int32 featured_hero_id = 4;
	optional uint32 featured_position = 5;
	optional uint32 games_played = 6;
	repeated uint32 medal_counts = 7;
}

message CMsgBattleReportInfoList {
	repeated .CMsgBattleReportInfo battle_report_info = 1;
}

message CMsgBattleReportHighlights {
	repeated .CMsgBattleReport.Highlight highlights = 1;
}

message CMsgBattleReportAggregateStats {
	message CMsgBattleReportStat {
		optional float mean = 1;
		optional float stdev = 2;
	}

	message CMsgBattleReportAggregate {
		optional int32 hero_id = 1;
		optional uint32 predicted_position = 2;
		optional uint32 game_count = 3;
		optional uint32 win_count = 4;
		optional uint32 lane_win_count = 5;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat kills = 6;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat deaths = 7;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat assists = 8;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat rank_change = 9;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat last_hits = 10;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat denies = 11;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat gpm = 12;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat xpm = 13;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat seconds_dead = 14;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat bounty_runes = 15;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat water_runes = 16;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat power_runes = 17;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat time_enemy_t1_tower_destroyed = 18;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat time_friendly_t1_tower_destroyed = 19;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat enemy_roshan_kills = 20;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat teleports_used = 21;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat dewards = 22;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat camps_stacked = 23;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat support_gold = 24;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat hero_damage = 25;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat hero_healing = 26;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat tower_damage = 27;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat successful_smokes = 28;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat stun_duration = 29;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat duration = 30;
		optional .CMsgBattleReportAggregateStats.CMsgBattleReportStat friendly_roshan_kills = 31;
	}

	repeated .CMsgBattleReportAggregateStats.CMsgBattleReportAggregate result = 1;
}

message CMsgBattleReportAggregatedGeneralStats {
}

message CMsgClientToGCGetBattleReportResponse {
	enum EResponse {
		k_eInternalError = 0;
		k_eSuccess = 1;
		k_eTooBusy = 2;
		k_eDisabled = 3;
		k_ePermissionDenied = 4;
		k_eNotSubscribedToDotaPlus = 5;
		k_eInvalidParameters = 6;
		k_eUnableToGetPlusSubInfo = 7;
		k_eUnableToLoadBattleReport = 8;
		k_eUnableToSaveBattleReport = 9;
		k_eUnableToGetAggregates = 10;
		k_eNotEnoughGamesPlayed = 11;
	}

	optional .CMsgBattleReport report = 1;
	optional .CMsgClientToGCGetBattleReportResponse.EResponse response = 2 [default = k_eInternalError];
	optional .CMsgBattleReportAggregateStats aggregate_stats = 3;
	optional .CMsgBattleReportInfo info = 4;
}

message CMsgClientToGCGetBattleReportAggregateStats {
	message CMsgBattleReportAggregateKey {
		optional int32 hero_id = 1;
		optional uint32 predicted_position = 2;
	}

	repeated .CMsgClientToGCGetBattleReportAggregateStats.CMsgBattleReportAggregateKey aggregate_keys = 1;
	optional uint32 timestamp = 2;
	optional uint32 duration = 3;
	optional uint32 rank = 4;
}

message CMsgClientToGCGetBattleReportAggregateStatsResponse {
	enum EResponse {
		k_eInternalError = 0;
		k_eSuccess = 1;
		k_eTooBusy = 2;
		k_eDisabled = 3;
		k_ePermissionDenied = 4;
		k_eInvalidParams = 5;
		k_eNotSubscribedToDotaPlus = 6;
	}

	optional .CMsgBattleReportAggregateStats aggregate_stats = 1;
	optional .CMsgClientToGCGetBattleReportAggregateStatsResponse.EResponse response = 2 [default = k_eInternalError];
}

message CMsgClientToGCGetBattleReportInfo {
	optional uint32 account_id = 1;
}

message CMsgClientToGCGetBattleReportInfoResponse {
	enum EResponse {
		k_eInternalError = 0;
		k_eSuccess = 1;
		k_eTooBusy = 2;
		k_eDisabled = 3;
		k_ePermissionDenied = 4;
		k_eNotSubscribedToDotaPlus = 5;
	}

	optional .CMsgBattleReportInfoList battle_report_info_list = 1;
	optional .CMsgClientToGCGetBattleReportInfoResponse.EResponse response = 2 [default = k_eInternalError];
}

message CMsgClientToGCAcknowledgeBattleReport {
	optional uint32 account_id = 1;
	optional uint32 timestamp = 2;
	optional uint32 duration = 3;
}

message CMsgClientToGCAcknowledgeBattleReportResponse {
	enum EResponse {
		k_eInternalError = 0;
		k_eSuccess = 1;
		k_eTooBusy = 2;
		k_eDisabled = 3;
		k_eTimeout = 4;
		k_ePermissionDenied = 5;
		k_eUnableToLoadBattleReport = 6;
		k_eAlreadyAcknowledged = 7;
		k_eUnknownReport = 8;
		k_eNotSubscribedToDotaPlus = 9;
		k_eNotEnoughGamesPlayed = 10;
	}

	optional .CMsgClientToGCAcknowledgeBattleReportResponse.EResponse response = 1 [default = k_eInternalError];
	optional uint32 shards_awarded = 2;
}

message CMsgClientToGCGetBattleReportMatchHistory {
	optional uint32 account_id = 1;
	optional uint32 timestamp = 2;
	optional uint32 duration = 3;
}

message CMsgClientToGCGetBattleReportMatchHistoryResponse {
	enum EResponse {
		k_eInternalError = 0;
		k_eSuccess = 1;
		k_eTooBusy = 2;
		k_eDisabled = 3;
		k_eTimeout = 4;
		k_ePermissionDenied = 5;
		k_eNotSubscribedToDotaPlus = 6;
	}

	optional .CMsgClientToGCGetBattleReportMatchHistoryResponse.EResponse response = 1 [default = k_eInternalError];
	optional .CMsgBattleReport_GameList games = 2;
}
