syntax = "proto2";

option go_package = "./demo";
option cc_generic_services = false;

enum EDemoCommands {
	DEM_Error = -1;
	DEM_Stop = 0;
	DEM_FileHeader = 1;
	DEM_FileInfo = 2;
	DEM_SyncTick = 3;
	DEM_SendTables = 4;
	DEM_ClassInfo = 5;
	DEM_StringTables = 6;
	DEM_Packet = 7;
	DEM_SignonPacket = 8;
	DEM_ConsoleCmd = 9;
	DEM_CustomData = 10;
	DEM_CustomDataCallbacks = 11;
	DEM_UserCmd = 12;
	DEM_FullPacket = 13;
	DEM_SaveGame = 14;
	DEM_SpawnGroups = 15;
	DEM_Max = 16;
	DEM_IsCompressed = 64;
}

message CDemoFileHeader {
	required string demo_file_stamp = 1;
	optional int32 network_protocol = 2;
	optional string server_name = 3;
	optional string client_name = 4;
	optional string map_name = 5;
	optional string game_directory = 6;
	optional int32 fullpackets_version = 7;
	optional bool allow_clientside_entities = 8;
	optional bool allow_clientside_particles = 9;
	optional string addons = 10;
	optional string demo_version_name = 11;
	optional string demo_version_guid = 12;
	optional int32 build_num = 13;
}

message CGameInfo {
	message CDotaGameInfo {
		message CPlayerInfo {
			optional string hero_name = 1;
			optional string player_name = 2;
			optional bool is_fake_client = 3;
			optional uint64 steamid = 4;
			optional int32 game_team = 5;
		}

		message CHeroSelectEvent {
			optional bool is_pick = 1;
			optional uint32 team = 2;
			optional uint32 hero_id = 3;
		}

		optional uint64 match_id = 1;
		optional int32 game_mode = 2;
		optional int32 game_winner = 3;
		repeated .CGameInfo.CDotaGameInfo.CPlayerInfo player_info = 4;
		optional uint32 leagueid = 5;
		repeated .CGameInfo.CDotaGameInfo.CHeroSelectEvent picks_bans = 6;
		optional uint32 radiant_team_id = 7;
		optional uint32 dire_team_id = 8;
		optional string radiant_team_tag = 9;
		optional string dire_team_tag = 10;
		optional uint32 end_time = 11;
	}

	optional .CGameInfo.CDotaGameInfo dota = 4;
}

message CDemoFileInfo {
	optional float playback_time = 1;
	optional int32 playback_ticks = 2;
	optional int32 playback_frames = 3;
	optional .CGameInfo game_info = 4;
}

message CDemoPacket {
	optional bytes data = 3;
}

message CDemoFullPacket {
	optional .CDemoStringTables string_table = 1;
	optional .CDemoPacket packet = 2;
}

message CDemoSaveGame {
	optional bytes data = 1;
	optional fixed64 steam_id = 2;
	optional fixed64 signature = 3;
	optional int32 version = 4;
}

message CDemoSyncTick {
}

message CDemoConsoleCmd {
	optional string cmdstring = 1;
}

message CDemoSendTables {
	optional bytes data = 1;
}

message CDemoClassInfo {
	message class_t {
		optional int32 class_id = 1;
		optional string network_name = 2;
		optional string table_name = 3;
	}

	repeated .CDemoClassInfo.class_t classes = 1;
}

message CDemoCustomData {
	optional int32 callback_index = 1;
	optional bytes data = 2;
}

message CDemoCustomDataCallbacks {
	repeated string save_id = 1;
}

message CDemoStringTables {
	message items_t {
		optional string str = 1;
		optional bytes data = 2;
	}

	message table_t {
		optional string table_name = 1;
		repeated .CDemoStringTables.items_t items = 2;
		repeated .CDemoStringTables.items_t items_clientside = 3;
		optional int32 table_flags = 4;
	}

	repeated .CDemoStringTables.table_t tables = 1;
}

message CDemoStop {
}

message CDemoUserCmd {
	optional int32 cmd_number = 1;
	optional bytes data = 2;
}

message CDemoSpawnGroups {
	repeated bytes msgs = 3;
}
