syntax = "proto2";
package pegasus.pegasusgame;

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

import "pegasus/pegasusshared/pegasusshared.proto";

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

// ref: PegasusGame.AllOptions
message AllOptions {
	// ref: PegasusGame.AllOptions/PacketID
	enum PacketID {
		ID = 14;
	}

	required int32 id = 1;
	repeated Option options = 2;
}

// ref: PegasusGame.ChooseEntities
message ChooseEntities {
	// ref: PegasusGame.ChooseEntities/PacketID
	enum PacketID {
		ID = 3;
	}

	required int32 id = 1;
	repeated int32 entities = 2 [packed=true];
}

// ref: PegasusGame.ChooseOption
message ChooseOption {
	// ref: PegasusGame.ChooseOption/PacketID
	enum PacketID {
		ID = 2;
	}

	required int32 id = 1;
	required int32 index = 2;
	required int32 target = 3;
	optional int32 sub_option = 4;
	optional int32 position = 5;
}

// ref: PegasusGame.ClientHistoryMeta
message ClientHistoryMeta {
	// ref: PegasusGame.ClientHistoryMeta/Type
	enum Type {
		INVALID = 0;
		SHOW_BIG_CARD = 1;
		EFFECT_TIMING_HINT = 2;
	}

}

// ref: PegasusGame.Concede
message Concede {
	// ref: PegasusGame.Concede/PacketID
	enum PacketID {
		ID = 11;
	}

}

// ref: PegasusGame.DebugMessage
message DebugMessage {
	// ref: PegasusGame.DebugMessage/PacketID
	enum PacketID {
		ID = 5;
	}

	required string message = 1;
}

// ref: PegasusGame.EntitiesChosen
message EntitiesChosen {
	// ref: PegasusGame.EntitiesChosen/PacketID
	enum PacketID {
		ID = 13;
	}

	required ChooseEntities choose_entities = 3;
	required int32 player_id = 4;
}

// ref: PegasusGame.Entity
message Entity {
	required int32 id = 1;
	repeated Tag tags = 2;
}

// ref: PegasusGame.EntityChoices
message EntityChoices {
	// ref: PegasusGame.EntityChoices/PacketID
	enum PacketID {
		ID = 17;
	}

	required int32 id = 1;
	required int32 choice_type = 2;
	required int32 count_min = 4;
	required int32 count_max = 5;
	repeated int32 entities = 6 [packed=true];
	optional int32 source = 7;
	required int32 player_id = 8;
}

// ref: PegasusGame.GameCanceled
message GameCanceled {
	// ref: PegasusGame.GameCanceled/PacketID
	enum PacketID {
		ID = 12;
	}

	// ref: PegasusGame.GameCanceled/Reason
	enum Reason {
		OPPONENT_TIMEOUT = 1;
	}

	required Reason reason = 1;
}

// ref: PegasusGame.GameSetup
message GameSetup {
	// ref: PegasusGame.GameSetup/PacketID
	enum PacketID {
		ID = 16;
	}

	required int32 board = 1;
	required int32 max_secrets_per_player = 2;
	required int32 max_friendly_minions_per_player = 3;
	optional int32 keep_alive_frequency_seconds = 4;
	optional int32 disconnect_when_stuck_seconds = 5;
}

// ref: PegasusGame.GetGameState
message GetGameState {
	// ref: PegasusGame.GetGameState/PacketID
	enum PacketID {
		ID = 1;
	}

}

// ref: PegasusGame.Handshake
message Handshake {
	// ref: PegasusGame.Handshake/PacketID
	enum PacketID {
		ID = 168;
	}

	required int32 game_handle = 1;
	required string password = 2;
	required int64 client_handle = 3;
	optional int32 mission = 4;
	required string version = 5;
	required pegasus.pegasusshared.Platform platform = 7;
}

// ref: PegasusGame.HistoryBlock
message HistoryBlock {
	// ref: PegasusGame.HistoryBlock/Type
	enum Type {
		INVALID = 0;
		ATTACK = 1;
		JOUST = 2;
		POWER = 3;
		TRIGGER = 5;
		DEATHS = 6;
		PLAY = 7;
		FATIGUE = 8;
		RITUAL = 9;
	}

}

// ref: PegasusGame.HistoryMeta
message HistoryMeta {
	// ref: PegasusGame.HistoryMeta/Type
	enum Type {
		TARGET = 0;
		DAMAGE = 1;
		HEALING = 2;
		JOUST = 3;
		CLIENT_HISTORY = 4;
	}

}

// ref: PegasusGame.InviteToSpectate
message InviteToSpectate {
	// ref: PegasusGame.InviteToSpectate/PacketID
	enum PacketID {
		ID = 25;
	}

	optional pegasus.pegasusshared.BnetId target_bnet_account_id = 1;
	required pegasus.pegasusshared.BnetId target_game_account_id = 2;
}

// ref: PegasusGame.MouseInfo
message MouseInfo {
	required int32 arrow_origin = 1;
	required int32 held_card = 2;
	required int32 over_card = 3;
	required int32 x = 4;
	required int32 y = 5;
}

// ref: PegasusGame.NAckOption
message NAckOption {
	// ref: PegasusGame.NAckOption/PacketID
	enum PacketID {
		ID = 10;
	}

	required int32 id = 1;
}

// ref: PegasusGame.Option
message Option {
	// ref: PegasusGame.Option/Type
	enum Type {
		PASS = 1;
		END_TURN = 2;
		POWER = 3;
	}

	required Type type = 1;
	optional SubOption main_option = 2;
	repeated SubOption sub_options = 3;
}

// ref: PegasusGame.Ping
message Ping {
	// ref: PegasusGame.Ping/PacketID
	enum PacketID {
		ID = 115;
	}

}

// ref: PegasusGame.Player
message Player {
	required int32 id = 1;
	required pegasus.pegasusshared.BnetId game_account_id = 2;
	required int32 card_back = 3;
	required Entity entity = 4;
}

// ref: PegasusGame.Pong
message Pong {
	// ref: PegasusGame.Pong/PacketID
	enum PacketID {
		ID = 116;
	}

}

// ref: PegasusGame.PowerHistory
message PowerHistory {
	// ref: PegasusGame.PowerHistory/PacketID
	enum PacketID {
		ID = 19;
	}

	repeated PowerHistoryData list = 1;
}

// ref: PegasusGame.PowerHistoryCreateGame
message PowerHistoryCreateGame {
	required Entity game_entity = 1;
	repeated Player players = 2;
}

// ref: PegasusGame.PowerHistoryData
message PowerHistoryData {
	optional PowerHistoryEntity full_entity = 1;
	optional PowerHistoryEntity show_entity = 2;
	optional PowerHistoryHide hide_entity = 3;
	optional PowerHistoryTagChange tag_change = 4;
	optional PowerHistoryCreateGame create_game = 5;
	optional PowerHistoryStart power_start = 6;
	optional PowerHistoryEnd power_end = 7;
	optional PowerHistoryMetaData meta_data = 8;
	optional PowerHistoryEntity change_entity = 9;
}

// ref: PegasusGame.PowerHistoryEnd
message PowerHistoryEnd {
}

// ref: PegasusGame.PowerHistoryEntity
message PowerHistoryEntity {
	required int32 entity = 1;
	required string name = 2;
	repeated Tag tags = 3;
}

// ref: PegasusGame.PowerHistoryHide
message PowerHistoryHide {
	required int32 entity = 1;
	required int32 zone = 2;
}

// ref: PegasusGame.PowerHistoryMetaData
message PowerHistoryMetaData {
	repeated int32 info = 2 [packed=true];
	optional HistoryMeta.Type type = 3 [default = TARGET];
	optional int32 data = 4;
}

// ref: PegasusGame.PowerHistoryStart
message PowerHistoryStart {
	required HistoryBlock.Type type = 1;
	required int32 index = 2;
	required int32 source = 3;
	required int32 target = 4;
	optional string effect_card_id = 5;
}

// ref: PegasusGame.PowerHistoryTagChange
message PowerHistoryTagChange {
	required int32 entity = 1;
	required int32 tag = 2;
	required int32 value = 3;
}

// ref: PegasusGame.RemoveSpectators
message RemoveSpectators {
	// ref: PegasusGame.RemoveSpectators/PacketID
	enum PacketID {
		ID = 26;
	}

	repeated pegasus.pegasusshared.BnetId target_gameaccount_ids = 1;
	optional bool kick_all_spectators = 2 [default = false];
	optional bool regenerate_spectator_password = 3 [default = false];
}

// ref: PegasusGame.ServerResult
message ServerResult {
	// ref: PegasusGame.ServerResult/Code
	enum Code {
		RESULT_OK = 0;
		RESULT_RETRY = 1;
		RESULT_NOT_EXISTS = 2;
	}

	// ref: PegasusGame.ServerResult/Constants
	enum Constants {
		DEFAULT_RETRY_SECONDS = 2;
	}

	// ref: PegasusGame.ServerResult/PacketID
	enum PacketID {
		ID = 23;
	}

	required int32 result_code = 1;
	optional float retry_delay_seconds = 2;
}

// ref: PegasusGame.SpectatorChange
message SpectatorChange {
	required pegasus.pegasusshared.BnetId game_account_id = 1;
	required bool is_removed = 2;
}

// ref: PegasusGame.SpectatorHandshake
message SpectatorHandshake {
	// ref: PegasusGame.SpectatorHandshake/PacketID
	enum PacketID {
		ID = 22;
	}

	required int32 game_handle = 1;
	required string password = 2;
	required string version = 3;
	required pegasus.pegasusshared.Platform platform = 4;
	required pegasus.pegasusshared.BnetId game_account_id = 5;
}

// ref: PegasusGame.SpectatorNotify
message SpectatorNotify {
	// ref: PegasusGame.SpectatorNotify/PacketID
	enum PacketID {
		ID = 24;
	}

	required int32 player_id = 1;
	optional ChooseOption choose_option = 2;
	repeated SpectatorChange spectator_change = 4;
	optional string spectator_password_update = 5;
	optional SpectatorRemoved spectator_removed = 6;
}

// ref: PegasusGame.SpectatorRemoved
message SpectatorRemoved {
	// ref: PegasusGame.SpectatorRemoved/SpectatorRemovedReason
	enum SpectatorRemovedReason {
		SPECTATOR_REMOVED_REASON_KICKED = 0;
		SPECTATOR_REMOVED_REASON_GAMEOVER = 1;
	}

	required int32 reason_code = 1;
	optional pegasus.pegasusshared.BnetId removed_by = 2;
}

// ref: PegasusGame.SubOption
message SubOption {
	required int32 id = 1;
	repeated int32 targets = 3 [packed=true];
}

// ref: PegasusGame.Tag
message Tag {
	required int32 name = 1;
	required int32 value = 2;
}

// ref: PegasusGame.TurnTimer
message TurnTimer {
	// ref: PegasusGame.TurnTimer/PacketID
	enum PacketID {
		ID = 9;
	}

	required int32 seconds = 1;
	required int32 turn = 2;
	required bool show = 3;
}

// ref: PegasusGame.UserUI
message UserUI {
	// ref: PegasusGame.UserUI/PacketID
	enum PacketID {
		ID = 15;
	}

	optional MouseInfo mouse_info = 1;
	optional int32 emote = 2;
	optional int32 player_id = 3;
}

