syntax = "proto2";
package pegasus.pegasusshared;

// Proto extractor compiled unit - https://github.com/HearthSim/proto-extractor

option java_package = "com.alterdekim";
option java_outer_classname = "PegasusShared";

// ref: PegasusShared.AssetType
enum AssetType {
	ASSET_TYPE_SCENARIO = 1;
	ASSET_TYPE_SUBSET_CARD = 2;
	ASSET_TYPE_DECK_RULESET = 3;
}

// ref: PegasusShared.BattlePayProvider
enum BattlePayProvider {
	BP_PROVIDER_BLIZZARD = 1;
	BP_PROVIDER_APPLE = 2;
	BP_PROVIDER_GOOGLE_PLAY = 3;
	BP_PROVIDER_AMAZON = 4;
}

// ref: PegasusShared.BnetGameType
enum BnetGameType {
	BGT_UNKNOWN = 0;
	BGT_FRIENDS = 1;
	BGT_RANKED_STANDARD = 2;
	BGT_ARENA = 3;
	BGT_VS_AI = 4;
	BGT_TUTORIAL = 5;
	BGT_ASYNC = 6;
	BGT_NEWBIE = 9;
	BGT_CASUAL_STANDARD = 10;
	BGT_TEST1 = 11;
	BGT_TEST2 = 12;
	BGT_TEST3 = 13;
	BGT_TAVERNBRAWL_PVP = 16;
	BGT_TAVERNBRAWL_1P_VERSUS_AI = 17;
	BGT_TAVERNBRAWL_2P_COOP = 18;
	BGT_RANKED_WILD = 30;
	BGT_CASUAL_WILD = 31;
	BGT_LAST = 32;
}

// ref: PegasusShared.DatabaseAction
enum DatabaseAction {
	DB_A_UNKNOWN = 0;
	DB_A_GET_DECK = 1;
	DB_A_CREATE_DECK = 2;
	DB_A_RENAME_DECK = 3;
	DB_A_DELETE_DECK = 4;
	DB_A_SET_DECK = 5;
	DB_A_OPEN_BOOSTER = 6;
	DB_A_GAMES_INFO = 7;
}

// ref: PegasusShared.DatabaseResult
enum DatabaseResult {
	DB_E_SQL_EX = -1;
	DB_E_UNKNOWN = 0;
	DB_E_SUCCESS = 1;
	DB_E_NOT_OWNED = 2;
	DB_E_CONSTRAINT = 3;
	DB_E_NOT_FOUND = 4;
	DB_E_EXCEPTION = 9;
	DB_E_BAD_PARAM = 11;
}

// ref: PegasusShared.DeckSourceType
enum DeckSourceType {
	DECK_SOURCE_TYPE_UNKNOWN = 0;
	DECK_SOURCE_TYPE_NORMAL = 1;
	DECK_SOURCE_TYPE_TEMPLATE = 2;
	DECK_SOURCE_TYPE_BASIC_DECK = 3;
}

// ref: PegasusShared.DeckType
enum DeckType {
	NORMAL_DECK = 1;
	AI_DECK = 2;
	DRAFT_DECK = 4;
	PRECON_DECK = 5;
	TAVERN_BRAWL_DECK = 6;
	HIDDEN_DECK = 1000;
}

// ref: PegasusShared.ErrorCode
enum ErrorCode {
	ERROR_OK = 0;
	ERROR_HEARTHSTONE_BEGIN = 1000000;
	ERROR_GLOBAL_INVALID_INPUT = 1000001;
	ERROR_GLOBAL_NO_DATA = 1000002;
	ERROR_GLOBAL_NOT_YET_IMPLEMENTED = 1000003;
	ERROR_GLOBAL_DATA_MODIFIED = 1000004;
	ERROR_SCENARIO_INCORRECT_NUM_PLAYERS = 1000500;
	ERROR_SCENARIO_NO_DECK_SPECIFIED = 1000501;
	ERROR_SCENARIO_MUST_BE_SERVER_ONLY = 1000502;
	ERROR_TAVERN_BRAWL_SEASON_INCREMENTED = 1001000;
	ERROR_TAVERN_BRAWL_NOT_ACTIVE = 1001001;
	ERROR_DECK_RULESET_RULE_UNKNOWN_TYPE = 1002000;
	ERROR_DECK_RULESET_RULE_DB_READ_ERROR = 1002001;
	ERROR_DECK_RULESET_RULE_VIOLATION = 1002002;
	ERROR_DECK_RULESET_DECK_CARD_ID_UNKNOWN = 1002003;
	ERROR_DECK_RULESET_HERO_CARD_GUID_UNKNOWN = 1002004;
	ERROR_DECK_RULESET_DECK_CARD_GUID_UNKNOWN = 1002005;
	ERROR_DECK_VALIDATION_DB_WRITE_ERROR = 1002006;
	ERROR_DECK_VALIDATION_WRONG_FORMAT = 1002007;
}

// ref: PegasusShared.GameType
enum GameType {
	GT_UNKNOWN = 0;
	GT_VS_AI = 1;
	GT_VS_FRIEND = 2;
	GT_TUTORIAL = 4;
	GT_ARENA = 5;
	GT_TEST = 6;
	GT_RANKED = 7;
	GT_CASUAL = 8;
	GT_TAVERNBRAWL = 16;
	GT_TB_1P_VS_AI = 17;
	GT_TB_2P_COOP = 18;
	GT_LAST = 19;
}

// ref: PegasusShared.RewardTrigger
enum RewardTrigger {
	REWARD_TRIGGER_UNKNOWN = 0;
	REWARD_TRIGGER_NONE = 1;
	REWARD_TRIGGER_WIN_GAME = 2;
	REWARD_TRIGGER_FINISH_GAME = 3;
}

// ref: PegasusShared.RewardType
enum RewardType {
	REWARD_UNKNOWN = 0;
	REWARD_NONE = 1;
	REWARD_ADVENTURE_PROGRESS = 2;
	REWARD_ARCANE_DUST = 3;
	REWARD_BASIC_CARD = 4;
	REWARD_BOOSTER_PACKS = 5;
	REWARD_CARD_BACK = 6;
	REWARD_CARD_ID = 7;
	REWARD_CARD_ID_2X = 8;
	REWARD_CARD_SET = 9;
	DEPRECATED_REWARD_CRAFTABLE_GOLDEN = 10;
	REWARD_GOLD = 11;
	REWARD_GOLD_HERO = 12;
	REWARD_FORGE_TICKETS = 13;
	REWARD_HERO = 14;
	REWARD_EXTERNAL_GAME_MOUNT = 15;
}

// ref: PegasusShared.RuleType
enum RuleType {
	RULE_NONE = 0;
	RULE_CHOOSE_HERO = 1;
	RULE_CHOOSE_DECK = 2;
}

// ref: PegasusShared.AccountLicenseInfo
message AccountLicenseInfo {
	// ref: PegasusShared.AccountLicenseInfo/Flags
	enum Flags {
		OWNED = 1;
	}

	required int64 license = 1;
	required uint64 flags = 2;
	required int64 cas_id = 3;
}

// ref: PegasusShared.AdventureProgress
message AdventureProgress {
	// ref: PegasusShared.AdventureProgress/Flags
	enum Flags {
		OWNED = 1;
		DEFEAT_HEROIC_MISSION_1 = 2;
		DEFEAT_HEROIC_MISSION_2 = 4;
		DEFEAT_HEROIC_MISSION_3 = 8;
		DEFEAT_HEROIC_MISSION_4 = 16;
		DEFEAT_CLASS_CHALLENGE_MISSION_1 = 256;
		DEFEAT_CLASS_CHALLENGE_MISSION_2 = 512;
	}

	required int32 wing_id = 1;
	required int32 progress = 2;
	optional int32 ack = 3 [default = 0];
	required uint64 flags = 4;
}

// ref: PegasusShared.AssetKey
message AssetKey {
	required AssetType type = 1;
	optional int32 asset_id = 2;
}

// ref: PegasusShared.AssetRecordInfo
message AssetRecordInfo {
	required AssetKey asset = 1;
	required uint32 record_byte_size = 2;
	required bytes record_hash = 3;
}

// ref: PegasusShared.BnetId
message BnetId {
	required uint64 hi = 1;
	required uint64 lo = 2;
}

// ref: PegasusShared.BoosterInfo
message BoosterInfo {
	required int32 type = 2;
	required int32 count = 3;
}

// ref: PegasusShared.CachedCard
message CachedCard {
	required int64 card_id = 1;
	required int32 asset_card_id = 2;
	required Date insert_date = 3;
	required bool is_seen = 4;
	required int32 premium = 5;
}

// ref: PegasusShared.CachedCollection
message CachedCollection {
	repeated CachedCard card_collection = 1;
}

// ref: PegasusShared.CardDef
message CardDef {
	required int32 asset = 1;
	optional int32 premium = 2;
}

// ref: PegasusShared.CardStack
message CardStack {
	required CardDef card_def = 1;
	required Date latest_insert_date = 2;
	required int32 count = 3;
	required int32 num_seen = 4;
}

// ref: PegasusShared.DatabaseDeckCard
message DatabaseDeckCard {
	required int32 asset_card_id = 1;
	required int32 premium = 2;
	required int32 quantity = 3;
}

// ref: PegasusShared.DatabaseDeckContent
message DatabaseDeckContent {
	repeated DatabaseDeckCard deck_cards = 1;
}

// ref: PegasusShared.Date
message Date {
	required int32 year = 1;
	required int32 month = 2;
	required int32 day = 3;
	required int32 hours = 4;
	required int32 min = 5;
	required int32 sec = 6;
}

// ref: PegasusShared.DeckCardData
message DeckCardData {
	required CardDef def = 1;
	required int32 handle = 2 [default = 0];
	optional int32 qty = 3;
	required int32 prev = 5 [default = 0];
}

// ref: PegasusShared.DeckInfo
message DeckInfo {
	// ref: PegasusShared.DeckInfo/ValidityFlags
	enum ValidityFlags {
		UNLOCKED_HERO_CLASS = 1;
		OWNS_CARDS = 2;
		HAS_30_CARDS = 4;
		OBEYS_MAXES = 8;
		CLASS_MATCHES = 16;
		OWNS_CARD_BACK = 32;
		OWNS_HERO = 64;
		TAGGED_STANDARD = 128;
		NEEDS_VALIDATION = 256;
		NEEDS_NAME = 512;
	}

	required int64 id = 1;
	required string name = 2;
	required int32 card_back = 3;
	required int32 hero = 4;
	required DeckType deck_type = 5;
	required uint64 validity = 6;
	required int32 hero_premium = 7;
	required bool card_back_override = 8;
	required bool hero_override = 9;
	optional int64 last_modified = 10;
	optional int32 season_id = 11;
	optional int64 sort_order = 12;
	optional int64 create_date = 13;
	optional DeckSourceType source_type = 14 [default = DECK_SOURCE_TYPE_UNKNOWN];
}

// ref: PegasusShared.DeckRulesetDbRecord
message DeckRulesetDbRecord {
	required int32 id = 1;
	repeated DeckRulesetRuleDbRecord rules = 2;
}

// ref: PegasusShared.DeckRulesetRuleDbRecord
message DeckRulesetRuleDbRecord {
	required int32 id = 1;
	required int32 deck_ruleset_id = 2;
	optional int32 applies_to_subset_id = 3;
	optional bool applies_to_is_not = 4;
	required string rule_type = 5;
	required bool rule_is_not = 6;
	optional int32 min_value = 7;
	optional int32 max_value = 8;
	optional int32 tag = 9;
	optional int32 tag_min_value = 10;
	optional int32 tag_max_value = 11;
	optional string string_value = 12;
	repeated int32 target_subset_ids = 13;
	repeated LocalizedString strings = 100;
}

// ref: PegasusShared.DeckRulesetValidationResults
message DeckRulesetValidationResults {
	required int32 deck_ruleset_id = 1 [default = 0];
	optional ErrorCode error_code = 2 [default = ERROR_OK];
	repeated DeckRulesetViolation violations = 3;
}

// ref: PegasusShared.DeckRulesetViolation
message DeckRulesetViolation {
	optional CardDef card = 1;
	optional int32 count = 2;
	required int32 deck_rule_id = 100;
	optional string deck_rule_desc = 101;
}

// ref: PegasusShared.FavoriteHero
message FavoriteHero {
	required int32 class_id = 1;
	required CardDef hero = 2;
}

// ref: PegasusShared.GameSetupRule
message GameSetupRule {
	required int32 id = 1;
	required RuleType rule_type = 2;
	required int64 data1 = 3;
	required int64 data2 = 4;
	required int64 data3 = 5;
}

// ref: PegasusShared.LocalizedString
message LocalizedString {
	required string key = 1;
	optional string deprecated_value = 2;
	optional int32 deprecated_locale = 3;
	repeated LocalizedStringValue values = 4;
}

// ref: PegasusShared.LocalizedStringValue
message LocalizedStringValue {
	required int32 locale = 1;
	required string value = 2;
}

// ref: PegasusShared.Platform
message Platform {
	required int32 os = 1;
	required int32 screen = 2;
	required string name = 3;
	optional int32 store = 4;
}

// ref: PegasusShared.PlayQueueInfo
message PlayQueueInfo {
	required BnetGameType game_type = 1;
}

// ref: PegasusShared.ProfileNoticeAccountLicense
message ProfileNoticeAccountLicense {
	// ref: PegasusShared.ProfileNoticeAccountLicense/NoticeID
	enum NoticeID {
		ID = 16;
	}

	required int64 license = 1;
	required int64 cas_id = 2;
}

// ref: PegasusShared.ProfileNoticeAdventureProgress
message ProfileNoticeAdventureProgress {
	// ref: PegasusShared.ProfileNoticeAdventureProgress/NoticeID
	enum NoticeID {
		ID = 14;
	}

	required int32 wing_id = 1;
}

// ref: PegasusShared.ProfileNoticeBonusStars
message ProfileNoticeBonusStars {
	// ref: PegasusShared.ProfileNoticeBonusStars/NoticeID
	enum NoticeID {
		ID = 12;
	}

	required int32 star_level = 1;
	required int32 stars = 2;
}

// ref: PegasusShared.ProfileNoticeCardBack
message ProfileNoticeCardBack {
	// ref: PegasusShared.ProfileNoticeCardBack/NoticeID
	enum NoticeID {
		ID = 11;
	}

	required int32 card_back = 1;
}

// ref: PegasusShared.ProfileNoticeDisconnectedGameResult
message ProfileNoticeDisconnectedGameResult {
	// ref: PegasusShared.ProfileNoticeDisconnectedGameResult/GameResult
	enum GameResult {
		GR_UNKNOWN = 0;
		GR_PLAYING = 1;
		GR_WINNER = 2;
		GR_TIE = 3;
	}

	// ref: PegasusShared.ProfileNoticeDisconnectedGameResult/NoticeID
	enum NoticeID {
		ID = 4;
	}

	// ref: PegasusShared.ProfileNoticeDisconnectedGameResult/PlayerResult
	enum PlayerResult {
		PR_UNKNOWN = 0;
		PR_WON = 1;
		PR_LOST = 2;
		PR_DISCONNECTED = 3;
		PR_QUIT = 4;
	}

	optional GameType game_type = 8 [default = GT_UNKNOWN];
	optional int32 mission_id = 9;
	optional GameResult game_result = 10 [default = GR_UNKNOWN];
	optional PlayerResult your_result = 11 [default = PR_UNKNOWN];
	optional PlayerResult opponent_result = 12 [default = PR_UNKNOWN];
}

// ref: PegasusShared.ProfileNoticeLevelUp
message ProfileNoticeLevelUp {
	// ref: PegasusShared.ProfileNoticeLevelUp/NoticeID
	enum NoticeID {
		ID = 15;
	}

	required int32 hero_class = 1;
	required int32 new_level = 2;
}

// ref: PegasusShared.ProfileNoticeMedal
message ProfileNoticeMedal {
	// ref: PegasusShared.ProfileNoticeMedal/MedalType
	enum MedalType {
		UNKNOWN_MEDAL = 0;
		STANDARD_MEDAL = 1;
		WILD_MEDAL = 2;
	}

	// ref: PegasusShared.ProfileNoticeMedal/NoticeID
	enum NoticeID {
		ID = 1;
	}

	required int32 star_level = 1;
	optional int32 legend_rank = 2;
	optional int32 best_star_level = 3;
	optional RewardChest chest = 4;
	optional MedalType medal_type = 5 [default = UNKNOWN_MEDAL];
}

// ref: PegasusShared.ProfileNoticePreconDeck
message ProfileNoticePreconDeck {
	// ref: PegasusShared.ProfileNoticePreconDeck/NoticeID
	enum NoticeID {
		ID = 5;
	}

	required int64 deck = 1;
	required int32 hero = 2;
}

// ref: PegasusShared.ProfileNoticePurchase
message ProfileNoticePurchase {
	// ref: PegasusShared.ProfileNoticePurchase/NoticeID
	enum NoticeID {
		ID = 10;
	}

	required string product_id = 1;
	optional int64 data = 2;
	optional int32 currency = 3;
}

// ref: PegasusShared.ProfileNoticeRewardBooster
message ProfileNoticeRewardBooster {
	// ref: PegasusShared.ProfileNoticeRewardBooster/NoticeID
	enum NoticeID {
		ID = 2;
	}

	required int32 booster_type = 1;
	required int32 booster_count = 2;
}

// ref: PegasusShared.ProfileNoticeRewardCard
message ProfileNoticeRewardCard {
	// ref: PegasusShared.ProfileNoticeRewardCard/NoticeID
	enum NoticeID {
		ID = 3;
	}

	required CardDef card = 1;
	optional int32 quantity = 2;
}

// ref: PegasusShared.ProfileNoticeRewardCard2x
message ProfileNoticeRewardCard2x {
	// ref: PegasusShared.ProfileNoticeRewardCard2x/NoticeID
	enum NoticeID {
		ID = 13;
	}

}

// ref: PegasusShared.ProfileNoticeRewardDust
message ProfileNoticeRewardDust {
	// ref: PegasusShared.ProfileNoticeRewardDust/NoticeID
	enum NoticeID {
		ID = 6;
	}

	required int32 amount = 1;
}

// ref: PegasusShared.ProfileNoticeRewardForge
message ProfileNoticeRewardForge {
	// ref: PegasusShared.ProfileNoticeRewardForge/NoticeID
	enum NoticeID {
		ID = 8;
	}

	required int32 quantity = 1;
}

// ref: PegasusShared.ProfileNoticeRewardGold
message ProfileNoticeRewardGold {
	// ref: PegasusShared.ProfileNoticeRewardGold/NoticeID
	enum NoticeID {
		ID = 9;
	}

	required int32 amount = 1;
}

// ref: PegasusShared.ProfileNoticeRewardMount
message ProfileNoticeRewardMount {
	// ref: PegasusShared.ProfileNoticeRewardMount/NoticeID
	enum NoticeID {
		ID = 7;
	}

	required int32 mount_id = 1;
}

// ref: PegasusShared.RewardBag
message RewardBag {
	optional ProfileNoticeRewardBooster reward_booster = 1;
	optional ProfileNoticeRewardCard reward_card = 2;
	optional ProfileNoticeRewardDust reward_dust = 3;
	optional ProfileNoticeRewardGold reward_gold = 4;
	optional ProfileNoticeCardBack reward_card_back = 5;
}

// ref: PegasusShared.RewardChest
message RewardChest {
	optional RewardBag bag1 = 1;
	optional RewardBag bag2 = 2;
	optional RewardBag bag3 = 3;
	optional RewardBag bag4 = 4;
	optional RewardBag bag5 = 5;
}

// ref: PegasusShared.ScenarioDbRecord
message ScenarioDbRecord {
	required int32 id = 1;
	optional string note_desc = 2;
	required int32 num_players = 3;
	required int64 player1_hero_card_id = 4;
	required int64 player2_hero_card_id = 5;
	required bool is_expert = 6;
	required int32 adventure_id = 7;
	optional int32 adventure_mode_id = 8;
	required int32 wing_id = 9;
	required int32 sort_order = 10;
	optional int64 client_player2_hero_card_id = 11;
	optional string tavern_brawl_texture = 12;
	optional string tavern_brawl_texture_phone = 13;
	optional Vector2 tavern_brawl_texture_phone_offset = 14;
	optional bool is_coop = 15;
	optional int32 deck_ruleset_id = 16;
	repeated LocalizedString strings = 100;
	repeated GameSetupRule rules = 101;
}

// ref: PegasusShared.SubsetCardListDbRecord
message SubsetCardListDbRecord {
	required int32 subset_id = 1;
	repeated int32 card_ids = 2;
}

// ref: PegasusShared.TavernBrawlPlayerRecord
message TavernBrawlPlayerRecord {
	required int32 reward_progress = 1;
	optional int32 games_played = 2;
	required int32 games_won = 3;
	optional int32 win_streak = 4;
}

// ref: PegasusShared.TavernBrawlSpec
message TavernBrawlSpec {
	optional uint64 end_seconds_from_now = 1;
	required int32 scenario_id = 2;
	required uint32 scenario_record_byte_size = 3;
	required bytes scenario_record_hash = 4;
	required RewardType reward_type = 5;
	required int64 reward_data1 = 6;
	required int64 reward_data2 = 7;
	optional RewardTrigger reward_trigger = 8 [default = REWARD_TRIGGER_UNKNOWN];
	required int32 season_id = 11;
	repeated AssetRecordInfo additional_assets = 100;
	required TavernBrawlPlayerRecord my_record = 105;
}

// ref: PegasusShared.Vector2
message Vector2 {
	required float x = 1 [default = 0];
	required float y = 2 [default = 0];
}

