import "steammessages.proto";

enum TF_MatchmakingMode {
	TF_Matchmaking_INVALID = 0;
	TF_Matchmaking_QUICKPLAY = 1;
	TF_Matchmaking_TOBOR = 2;
}

enum TF_Matchmaking_WizardStep {
	TF_Matchmaking_WizardStep_INVALID = 0;
	TF_Matchmaking_WizardStep_TOBOR_PLAY_FOR_BRAGGING_RIGHTS = 1;
	TF_Matchmaking_WizardStep_TOBOR_TOUR_OF_DUTY = 2;
	TF_Matchmaking_WizardStep_TOBOR_CHALLENGE = 3;
	TF_Matchmaking_WizardStep_QUICKPLAY = 4;
	TF_Matchmaking_WizardStep_SEARCHING = 5;
}

enum TF_GC_GameState {
	TF_GC_GAMESTATE_STATE_INIT = 0;
	TF_GC_GAMESTATE_WAIT_FOR_PLAYERS_TO_LOAD = 1;
	TF_GC_GAMESTATE_STRATEGY_TIME = 3;
	TF_GC_GAMESTATE_GAME_IN_PROGRESS = 5;
	TF_GC_GAMESTATE_POST_GAME = 6;
	TF_GC_GAMESTATE_DISCONNECT = 7;
	TF_GC_GAMESTATE_LAST = 8;
}

enum TF_GC_TEAM {
	TF_GC_TEAM_DEFENDERS = 0;
	TF_GC_TEAM_BROADCASTER = 2;
	TF_GC_TEAM_SPECTATOR = 3;
	TF_GC_TEAM_PLAYER_POOL = 4;
	TF_GC_TEAM_NOTEAM = 5;
}

enum TFLobbyReadyState {
	TFLobbyReadyState_UNDECLARED = 0;
	TFLobbyReadyState_ACCEPTED = 1;
	TFLobbyReadyState_DECLINED = 2;
}

enum ChatChannelType_t {
	ChatChannelType_Regional = 0;
	ChatChannelType_Custom = 1;
	ChatChannelType_Party = 2;
	ChatChannelType_Lobby = 3;
}

enum ServerMatchmakingState {
	ServerMatchmakingState_INVALID = 0;
	ServerMatchmakingState_NOT_PARTICIPATING = 1;
	ServerMatchmakingState_EMPTY = 2;
	ServerMatchmakingState_ACTIVE_SLOTS_AVAILABLE = 3;
	ServerMatchmakingState_ACTIVE_FULL = 4;
}

message CMsgTFGoldenWrenchBroadcast {
	optional int32 wrench_number = 1;
	optional bool deleted = 2;
	optional string user_name = 3;
}

message CMsgTFSaxxyBroadcast {
	optional int32 category_number = 1;
	optional string user_name = 2;
}

message CSOTFDuelSummary {
	optional uint32 account_id = 1 [(key_field) = true];
	optional uint32 duel_wins = 2;
	optional uint32 duel_losses = 3;
	optional uint32 last_duel_account_id = 4;
	optional uint32 last_duel_timestamp = 5;
	optional uint32 last_duel_status = 6;
}

message CSOTFMapContribution {
	optional uint32 account_id = 1 [(key_field) = true];
	optional uint32 def_index = 2 [(key_field) = true];
	optional uint32 contribution_level = 3;
}

message CMsgTFVoteKickBanPlayer {
	optional uint32 account_id_subject = 1;
	optional uint32 kick_reason = 2;
}

message CMsgTFVoteKickBanPlayerResult {
	optional uint32 account_id_initiator = 1;
	optional uint32 account_id_subject = 2;
	optional uint32 kick_reason = 3;
	optional bool kick_successful = 4;
	optional uint32 num_yes_votes = 5;
	optional uint32 num_no_votes = 6;
	optional uint32 num_possible_votes = 7;
}

message CMsgTFKickPlayer {
	optional uint32 account_id_player = 1;
	optional uint32 kick_reason = 2;
}

message CMsgTFStartedTraining {
}

message CMsgTFFreeTrialChooseMostHelpfulFriend {
	optional uint32 account_id_friend = 1;
}

message CMsgTFRequestTF2Friends {
	repeated uint32 account_ids = 1;
}

message CMsgTFRequestTF2FriendsResponse {
	repeated uint32 account_ids = 1;
}

message CSOTFPlayerInfo {
	optional uint32 num_new_users_helped = 1;
	optional bool trial_account = 2 [default = false];
}

message CMsgTFThankedBySomeone {
	optional uint64 thanker_steam_id = 1;
}

message CMsgTFThankedSomeone {
}

message CMsgTFFreeTrialConvertedToPremium {
}

message CMsgSaxxyAwarded {
	optional uint32 category = 1;
	repeated string winner_names = 2;
}

message CMsgReplaySubmitContestEntry {
	optional string youtube_url = 1;
	optional uint32 category = 2;
}

message CMsgReplaySubmitContestEntryResponse {
	optional bool success = 1;
}

message CReplayCachedContestData {
	optional fixed32 timestamp = 1;
	optional uint32 num_votes_last_day = 2;
	repeated uint32 video_entry_ids = 3;
	optional uint32 num_flags_last_day = 4;
}

message CMsgTFCoaching_AddToCoaches {
}

message CMsgTFCoaching_RemoveFromCoaches {
}

message CMsgTFCoaching_FindCoach {
	optional uint32 account_id_friend_as_coach = 1;
}

message CMsgTFCoaching_FindCoachResponse {
	optional bool found_coach = 1;
	optional uint32 num_likes = 2;
	optional string coach_name = 3;
}

message CMsgTFCoaching_AskCoach {
	optional uint32 account_id_student = 1;
	optional bool student_is_friend = 2;
}

message CMsgTFCoaching_AskCoachResponse {
	optional bool accept_coaching_assignment = 1;
}

message CMsgTFCoaching_CoachJoinGame {
	optional bool join_game = 1;
	optional uint32 server_address = 2;
	optional uint32 server_port = 3;
	optional uint32 account_id_student = 4;
}

message CMsgTFCoaching_CoachJoining {
	optional uint32 account_id_coach = 1;
	optional uint32 account_id_student = 2;
}

message CMsgTFCoaching_CoachJoined {
	optional uint32 account_id_coach = 1;
}

message CMsgTFCoaching_LikeCurrentCoach {
	optional bool like_coach = 1;
}

message CMsgTFCoaching_RemoveCurrentCoach {
	optional uint32 account_id_coach = 1;
}

message CMsgTFQuickplay_ScoreServers {
	message ServerInfo {
		optional uint32 server_address = 1;
		optional uint32 server_port = 2;
		optional uint32 num_users = 3;
		optional uint64 steam_id = 4;
		optional uint32 max_users = 5;
		optional float user_score = 6;
	}

	repeated .CMsgTFQuickplay_ScoreServers.ServerInfo servers = 1;
}

message CMsgTFQuickplay_ScoreServersResponse {
	message ServerInfo {
		optional uint32 server_address = 1;
		optional uint32 server_port = 2;
		optional float total_score = 3;
		optional uint64 steam_id = 4;
	}

	repeated .CMsgTFQuickplay_ScoreServersResponse.ServerInfo servers = 1;
}

message CMsgTFQuickplay_PlayerJoining {
	optional uint32 account_id = 1;
}

message CMsgGC_GameServer_LevelInfo {
	optional bool level_loaded = 1;
	optional string level_name = 2;
}

message CMsgGC_GameServer_AuthChallenge {
	optional string challenge_string = 1;
}

message CMsgGC_GameServer_AuthResult {
	optional bool authenticated = 1;
	optional int32 game_server_standing = 2;
	optional int32 game_server_standing_trend = 3;
	optional bool is_valve_server = 4;
	optional string message = 5;
}

message CMsgGC_GameServer_AuthChallengeResponse {
	optional uint32 game_server_account_id = 1;
	optional bytes hashed_challenge_string = 2;
}

message CMsgGC_GameServer_CreateIdentity {
	optional uint32 account_id = 1;
}

message CMsgGC_GameServer_CreateIdentityResponse {
	enum EStatus {
		kStatus_GenericFailure = 0;
		kStatus_TooMany = -1;
		kStatus_NoPrivs = -2;
		kStatus_Created = 1;
	}

	optional bool account_created = 1;
	optional uint32 game_server_account_id = 2;
	optional string game_server_identity_token = 3;
	optional .CMsgGC_GameServer_CreateIdentityResponse.EStatus status = 4 [default = kStatus_GenericFailure];
}

message CMsgGC_GameServer_List {
	optional uint32 account_id = 1;
}

message CMsgGC_GameServer_ListResponse {
	message GameServerIdentity {
		optional uint32 game_server_account_id = 1;
		optional string game_server_identity_token = 2;
		optional int32 game_server_standing = 3;
		optional int32 game_server_standing_trend = 4;
	}

	repeated .CMsgGC_GameServer_ListResponse.GameServerIdentity owned_game_servers = 1;
}

message CMsgGC_GameServer_ResetIdentity {
	optional uint32 game_server_account_id = 1;
}

message CMsgGC_GameServer_ResetIdentityResponse {
	optional bool game_server_identity_token_reset = 1;
	optional uint32 game_server_account_id = 2;
	optional string game_server_identity_token = 3;
}

message CMsgGC_Halloween_ReservedItem {
	repeated float x = 1;
	repeated float y = 2;
	repeated float z = 3;
	optional uint32 spawn_meta_info = 7;
}

message CMsgGC_Halloween_GrantItem {
	optional uint32 recipient_account_id = 1;
	optional uint32 level_id = 2;
	optional bool flagged = 3;
}

message CMsgGC_Halloween_GrantItemResponse {
	optional uint32 recipient_account_id = 1;
}

message CMsgGC_Halloween_ItemClaimed {
}

message CMsgGC_PickupItemEligibility_Query {
	optional uint32 account_id = 1;
	optional uint32 seconds_ago = 2;
}

message CMsgGC_PickupItemEligibility_QueryResponse {
	optional uint32 account_id = 1;
	optional bool was_eligible = 2;
	optional uint32 level_id = 3;
}

message CSOTFPartyMember {
	optional bool owns_ticket = 2;
	optional uint32 completed_missions = 3;
	optional uint32 badge_level = 4;
	optional bool squad_surplus = 5;
	optional bool is_banned = 8 [default = false];
}

message CMsgMatchSearchCriteria {
	optional .TF_MatchmakingMode matchmaking_mode = 7 [default = TF_Matchmaking_INVALID];
	optional bool late_join_ok = 5;
	optional string mvm_mannup_tour = 10;
	repeated string mvm_missions = 9;
	optional bool play_for_bragging_rights = 6;
	optional uint32 quickplay_game_type = 8;
}

message CMsgCreateOrUpdateParty {
	optional .CMsgMatchSearchCriteria search_criteria = 1;
	optional fixed64 steam_lobby_id = 3;
	optional bool squad_surplus = 4;
	optional .TF_Matchmaking_WizardStep wizard_step = 5 [default = TF_Matchmaking_WizardStep_INVALID];
	optional uint32 client_version = 6 [default = 1225];
}

message CMsgCreateOrUpdatePartyReply {
	optional uint32 result = 1;
	optional string message = 2;
	optional .TF_Matchmaking_WizardStep wizard_step = 3 [default = TF_Matchmaking_WizardStep_INVALID];
}

message CSOTFParty {
	enum State {
		UI = 0;
		FINDING_MATCH = 1;
		IN_MATCH = 2;
		AWAITING_RESERVATION_CONFIRMATION = 3;
	}

	optional uint64 party_id = 1 [(key_field) = true];
	optional fixed64 leader_id = 2;
	repeated fixed64 member_ids = 3;
	repeated .CSOTFPartyMember members = 13;
	repeated fixed64 pending_invites = 5;
	optional .CSOTFParty.State state = 6 [default = UI];
	optional .TF_Matchmaking_WizardStep wizard_step = 29 [default = TF_Matchmaking_WizardStep_INVALID];
	optional uint32 started_matchmaking_time = 7;
	repeated uint32 searching_players_by_group = 10;
	optional fixed64 steam_lobby_id = 27;
	optional .TF_MatchmakingMode matchmaking_mode = 30 [default = TF_Matchmaking_INVALID];
	optional bool search_late_join_ok = 23;
	optional string search_mvm_mannup_tour = 32;
	repeated string search_mvm_missions = 31;
	optional bool search_play_for_bragging_rights = 26;
	optional uint32 search_quickplay_game_type = 28;
	optional uint32 prevent_match_until_date = 18;
	optional uint32 prevent_match_account_id = 19;
}

message CSOTFPartyInvite {
	message PartyMember {
		optional string name = 1;
		optional fixed64 steam_id = 2;
		optional uint32 avatar = 3;
	}

	optional uint64 group_id = 1 [(key_field) = true];
	optional fixed64 sender_id = 2;
	optional string sender_name = 3;
	repeated .CSOTFPartyInvite.PartyMember members = 4;
}

message CTFLobbyMember {
	enum ConnectState {
		INVALID = 0;
		RESERVATION_PENDING = 1;
		RESERVED = 2;
		CONNECTED = 3;
		DISCONNECTED = 5;
	}

	optional fixed64 id = 1 [(key_field) = true];
	optional .TF_GC_TEAM team = 3 [default = TF_GC_TEAM_DEFENDERS];
	optional .CTFLobbyMember.ConnectState connect_state = 13 [default = INVALID];
	optional string name = 6;
	optional float latitude = 8;
	optional float longitude = 9;
	optional .TFLobbyReadyState ready_state = 11 [default = TFLobbyReadyState_UNDECLARED];
	optional uint64 party_id = 12;
	optional bool squad_surplus = 14;
	optional uint32 badge_level = 15;
	optional uint32 abandon_time = 16 [default = 0];
	optional uint32 last_connect_time = 17;
	optional bool quitting_results_in_penalty = 18;
}

message CLobbyPendingPlayerReport {
	optional uint32 account_id = 1;
	optional fixed32 date = 2;
}

message CMsgGameMatchSignOut {
}

message CSOTFLobby {
	enum State {
		SERVERSETUP = 1;
		RUN = 2;
		POSTGAME = 3;
		NOTREADY = 5;
		SERVERASSIGN = 6;
	}

	enum LobbyType {
		INVALID = -1;
		MATCH = 0;
		PRACTICE = 1;
		TOURNAMENT = 2;
		TUTORIAL = 3;
	}

	optional uint64 lobby_id = 1 [(key_field) = true];
	repeated .CTFLobbyMember members = 2;
	repeated .CTFLobbyMember left_members = 7;
	optional fixed64 leader_id = 11;
	optional fixed64 server_id = 6 [default = 0];
	repeated fixed64 pending_invites = 10;
	optional .CSOTFLobby.State state = 4 [default = SERVERSETUP];
	optional string connect = 5;
	optional .CSOTFLobby.LobbyType lobby_type = 12 [default = INVALID];
	optional bool allow_cheats = 13;
	optional string game_name = 16;
	optional uint32 server_region = 21 [default = 0];
	optional .TF_GC_GameState game_state = 22 [default = TF_GC_GAMESTATE_STATE_INIT];
	optional uint32 num_spectators = 23;
	optional uint32 matchgroup = 25;
	optional float readyup_remaining_time = 26;
	optional bool leaver_detected = 27;
	optional bool allow_spectating = 31 [default = true];
	optional fixed64 load_game_lobby_id = 33;
	optional uint32 load_game_save_number = 34;
	optional string mannup_tour_name = 42;
	optional string map_name = 38;
	optional string mission_name = 39;
	optional uint32 match_group = 41;
	optional uint32 match_id = 30;
	optional fixed32 replay_salt = 35;
}

message CMsgExitMatchmaking {
}

message CMsgAcceptInvite {
	optional uint64 party_id = 1;
	optional fixed64 steamid_lobby = 2;
	optional uint32 client_version = 3 [default = 1225];
}

message CMsgAcceptInviteResponse {
	optional int32 result_code = 1;
}

message CMsgReadyUp {
	optional .TFLobbyReadyState state = 1 [default = TFLobbyReadyState_UNDECLARED];
}

message CMsgMatchmakingSearchCountRequest {
}

message CMsgMatchmakingSearchCountResponse {
	repeated uint32 searching_players_by_group = 1;
}

message CMsgKickedFromMatchmakingQueue {
}

message CMsgTFPlayerFailedToConnect {
	repeated fixed64 failed_loaders = 1;
}

message CMsgTFJoinChatChannel {
	optional string persona_name = 1;
	optional string channel_name = 2;
	optional string password = 3;
	optional .ChatChannelType_t channel_type = 4 [default = ChatChannelType_Regional];
}

message CMsgTFLeaveChatChannel {
	optional string channel_name = 1;
}

message CMsgTFJoinChatChannelResponse {
	message ChatMember {
		optional fixed64 steam_id = 1;
		optional string persona_name = 2;
	}

	optional uint32 response = 1;
	optional string channel_name = 2;
	optional fixed64 channel_id = 3;
	optional uint32 max_members = 4;
	repeated .CMsgTFJoinChatChannelResponse.ChatMember members = 5;
}

message CMsgTFOtherJoinedChatChannel {
	optional fixed64 channel_id = 1;
	optional string persona_name = 2;
	optional fixed64 steam_id = 3;
}

message CMsgTFOtherLeftChatChannel {
	optional fixed64 channel_id = 1;
	optional fixed64 steam_id = 2;
}

message CMsgTFRequestDefaultChatChannel {
}

message CMsgTFRequestDefaultChatChannelResponse {
	optional string channel_name = 1;
	optional fixed64 channel_id = 2;
}

message CMsgTFRequestChatChannelList {
}

message CMsgTFRequestChatChannelListResponse {
	message ChatChannel {
		optional string channel_name = 1;
		optional uint32 num_members = 2;
		optional .ChatChannelType_t channel_type = 3 [default = ChatChannelType_Regional];
	}

	repeated .CMsgTFRequestChatChannelListResponse.ChatChannel channels = 1;
}

message CMsgGameServerMatchmakingStatus {
	message Player {
		optional fixed64 steam_id = 1;
		optional .CMsgGameServerMatchmakingStatus.PlayerConnectState connect_state = 2 [default = INVALID];
	}

	enum PlayerConnectState {
		INVALID = 0;
		CONNECTED = 1;
		RESERVED = 2;
	}

	enum Event {
		None = 0;
		MvMVictory = 1;
		MvMDefeat = 2;
		AcknowledgePlayers = 3;
	}

	optional uint32 server_version = 16 [default = 1225];
	optional .ServerMatchmakingState matchmaking_state = 1 [default = ServerMatchmakingState_INVALID];
	optional .TF_MatchmakingMode matchmaking_mode = 2 [default = TF_Matchmaking_INVALID];
	optional string map = 3;
	optional string tags = 4;
	optional uint32 bot_count = 5;
	optional uint32 num_spectators = 6;
	optional uint32 max_players = 7;
	optional uint32 slots_free = 8;
	optional uint32 server_region = 9;
	optional float server_loadavg = 10;
	optional bool server_trusted = 11;
	optional bool server_dedicated = 12;
	optional uint32 strict = 17;
	repeated .CMsgGameServerMatchmakingStatus.Player players = 13;
	optional .TF_GC_GameState game_state = 14 [default = TF_GC_GAMESTATE_STATE_INIT];
	optional .CMsgGameServerMatchmakingStatus.Event event = 15 [default = None];
	optional uint32 mvm_wave = 18;
	optional uint32 mvm_credits_acquired = 19;
	optional uint32 mvm_credits_dropped = 20;
}

message CMsgMatchmakingProgress {
	optional uint32 avg_wait_time_new = 4;
	optional uint32 avg_wait_time_join_late = 5;
	optional uint32 your_wait_time = 6;
	optional uint32 matching_worldwide_searching_players = 8;
	optional uint32 matching_near_you_searching_players = 9;
	optional uint32 total_worldwide_searching_players = 13;
	optional uint32 total_near_you_searching_players = 14;
	optional uint32 matching_worldwide_active_players = 15;
	optional uint32 matching_near_you_active_players = 16;
	optional uint32 total_worldwide_active_players = 17;
	optional uint32 total_near_you_active_players = 18;
	optional uint32 matching_worldwide_empty_gameservers = 19;
	optional uint32 matching_near_you_empty_gameservers = 20;
	optional uint32 total_worldwide_empty_gameservers = 21;
	optional uint32 total_near_you_empty_gameservers = 22;
	optional uint32 urgency_pct = 1;
}

message CMsgMvMVictoryInfo {
	message Item {
		optional .CMsgMvMVictoryInfo.GrantReason grant_reason = 1 [default = INVALID];
		optional bytes item_data = 2;
		optional fixed64 squad_surplus_claimer_steam_id = 3;
	}

	message Player {
		optional fixed64 steam_id = 1;
		optional bool badge_granted = 3;
		optional bool badge_progress_updated = 4;
		optional bool badge_leveled = 5;
		optional uint32 badge_level = 6;
		optional uint32 badge_progress_bits = 7;
		repeated .CMsgMvMVictoryInfo.Item items = 8;
		optional bool voucher_missing = 9;
	}

	enum GrantReason {
		INVALID = 0;
		BADGE_LEVELED = 1;
		SQUAD_SURPLUS = 2;
		MANN_UP = 3;
	}

	repeated .CMsgMvMVictoryInfo.Player players = 1;
	optional string tour_name = 2;
	optional string mission_name = 3;
}

message CGCMsgTFHelloResponse {
	optional uint32 version_check = 1;
	repeated uint64 version_checksum = 2;
}

message CGCMsgTFSync {
	optional bytes version_checksum = 1;
	optional uint32 version_check = 2;
}

message CMsgMvMVictory {
	message Player {
		optional fixed64 steam_id = 1;
		optional bool squad_surplus = 2;
	}

	optional uint32 legacy_mission_index = 1;
	optional string tour_name_mannup = 5;
	optional string mission_name = 6;
	repeated .CMsgMvMVictory.Player players = 2;
	optional uint64 lobby_id = 3;
	optional fixed32 event_time = 4;
}

message CMsgMvMMannUpVictoryReply {
	optional uint32 result = 1;
}

message CMsgGameServerKickingLobby {
	repeated fixed64 connected_players = 1;
}

message CMsgLeaveGameAndPrepareToJoinParty {
	optional fixed64 party_id = 1;
}

message CMsgRemovePlayerFromLobby {
	enum RemoveReason {
		VOTE_KICK = 0;
		IDLE_KICK = 1;
		ADMIN_KICK = 2;
	}

	optional fixed64 steam_id = 1;
	optional .CMsgRemovePlayerFromLobby.RemoveReason remove_reason = 2 [default = VOTE_KICK];
}

message CMsgSetLobbySafeToLeave {
	optional fixed64 lobby_id = 1;
}

message CMsgHalloween_ServerBossEvent {
	optional uint32 event_counter = 1;
	optional uint32 timestamp = 2;
	optional uint32 boss_type = 3;
	optional uint32 boss_level = 4;
	optional uint32 event_type = 5;
	optional uint32 players_involved = 6;
	optional float elapsed_time = 7;
}

message CMsgHalloween_Merasmus2012 {
	optional uint32 event_counter = 1;
	optional fixed32 time_submitted = 2;
	optional bool is_valve_server = 3;
	optional uint32 boss_level = 4;
	optional uint32 spawned_health = 5;
	optional uint32 remaining_health = 6;
	optional uint32 life_time = 7;
	optional uint32 bomb_kills = 8;
	optional uint32 staff_kills = 9;
	optional uint32 pvp_kills = 10;
	optional uint32 prophunt_time1 = 11;
	optional uint32 prophunt_time2 = 12;
	optional uint32 dmg_scout = 13;
	optional uint32 dmg_sniper = 14;
	optional uint32 dmg_soldier = 15;
	optional uint32 dmg_demo = 16;
	optional uint32 dmg_medic = 17;
	optional uint32 dmg_heavy = 18;
	optional uint32 dmg_pyro = 19;
	optional uint32 dmg_spy = 20;
	optional uint32 dmg_engineer = 21;
	optional uint32 scout_count = 22;
	optional uint32 sniper_count = 23;
	optional uint32 solider_count = 24;
	optional uint32 demo_count = 25;
	optional uint32 medic_count = 26;
	optional uint32 heavy_count = 27;
	optional uint32 pyro_count = 28;
	optional uint32 spy_count = 29;
	optional uint32 engineer_count = 30;
}

message CMsgUpdateHalloweenMerasmusLootLevel {
	message Player {
		optional fixed64 steam_id = 1;
	}

	repeated .CMsgUpdateHalloweenMerasmusLootLevel.Player players = 1;
	optional uint32 merasmus_level = 2;
}

