import "steammessages_base.proto";
import "steammessages_unified_base.steamclient.proto";

option cc_generic_services = true;

enum EAppContentDetectionType {
	k_EAppContentDetectionType_None = 0;
	k_EAppContentDetectionType_AntiCheat = 1;
	k_EAppContentDetectionType_GameEngine = 2;
}

message CContentServerDirectory_ConnectedSteamPipeServerInfo {
	optional string type = 1;
	optional int32 source_id = 2;
	optional string hostname = 3;
}

message CContentServerDirectory_GetServersForSteamPipe_Request {
	optional uint32 cell_id = 1;
	optional uint32 max_servers = 2 [default = 20];
	optional string ip_override = 3;
	optional int32 launcher_type = 4 [default = 0];
	optional string ipv6_public = 5;
	repeated .CContentServerDirectory_ConnectedSteamPipeServerInfo current_connections = 6;
}

message CContentServerDirectory_ServerInfo {
	optional string type = 1;
	optional int32 source_id = 2;
	optional int32 cell_id = 3;
	optional int32 load = 4;
	optional float weighted_load = 5;
	optional int32 num_entries_in_client_list = 6;
	optional bool steam_china_only = 7;
	optional string host = 8;
	optional string vhost = 9;
	optional bool use_as_proxy = 10;
	optional string proxy_request_path_template = 11;
	optional string https_support = 12;
	repeated uint32 allowed_app_ids = 13;
	optional uint32 priority_class = 15;
	repeated string bypass_proxies_of_type = 16;
}

message CContentServerDirectory_GetServersForSteamPipe_Response {
	repeated .CContentServerDirectory_ServerInfo servers = 1;
	optional bool no_change = 2;
}

message CContentServerDirectory_GetDepotPatchInfo_Request {
	optional uint32 appid = 1;
	optional uint32 depotid = 2;
	optional uint64 source_manifestid = 3;
	optional uint64 target_manifestid = 4;
}

message CContentServerDirectory_GetDepotPatchInfo_Response {
	optional bool is_available = 1;
	optional uint64 patch_size = 2;
	optional uint64 patched_chunks_size = 3;
}

message CContentServerDirectory_GetClientUpdateHosts_Request {
	optional string cached_signature = 1;
}

message CContentServerDirectory_GetClientUpdateHosts_Response {
	optional string hosts_kv = 1;
	optional uint64 valid_until_time = 2;
	optional string ip_country = 3;
}

message CContentServerDirectory_GetManifestRequestCode_Request {
	optional uint32 app_id = 1;
	optional uint32 depot_id = 2;
	optional uint64 manifest_id = 3;
	optional string app_branch = 4;
	optional string branch_password_hash = 5;
}

message CContentServerDirectory_GetManifestRequestCode_Response {
	optional uint64 manifest_request_code = 1;
}

message CContentServerDirectory_GetCDNAuthToken_Request {
	optional uint32 depot_id = 1;
	optional string host_name = 2;
	optional uint32 app_id = 3;
}

message CContentServerDirectory_GetCDNAuthToken_Response {
	optional string token = 1;
	optional uint32 expiration_time = 2;
}

message CContentServerDirectory_RequestPeerContentServer_Request {
	optional uint64 remote_client_id = 1;
	optional uint64 steamid = 2;
	optional uint64 server_remote_client_id = 3;
	optional uint32 app_id = 4;
	optional uint32 current_build_id = 5;
}

message CContentServerDirectory_RequestPeerContentServer_Response {
	optional uint32 server_port = 1;
	repeated uint32 installed_depots = 2;
	optional uint64 access_token = 3;
}

message CContentServerDirectory_GetPeerContentInfo_Request {
	optional uint64 remote_client_id = 1;
	optional uint64 steamid = 2;
	optional uint64 server_remote_client_id = 3;
}

message CContentServerDirectory_GetPeerContentInfo_Response {
	repeated uint32 appids = 1;
	optional string ip_public = 2;
}

message CDepotContentDetection_GetAllDetectedAppContent_Request {
	optional .EAppContentDetectionType detection_type = 1 [default = k_EAppContentDetectionType_None];
}

message DetectedAppContent {
	optional uint32 app_id = 1;
	optional uint32 depot_id = 2;
	optional int32 detected_content = 3;
}

message CDepotContentDetection_GetAllDetectedAppContent_Response {
	repeated .DetectedAppContent detected_app_content = 1;
}

service ContentServerDirectory {
	rpc GetServersForSteamPipe (.CContentServerDirectory_GetServersForSteamPipe_Request) returns (.CContentServerDirectory_GetServersForSteamPipe_Response);
	rpc GetDepotPatchInfo (.CContentServerDirectory_GetDepotPatchInfo_Request) returns (.CContentServerDirectory_GetDepotPatchInfo_Response);
	rpc GetClientUpdateHosts (.CContentServerDirectory_GetClientUpdateHosts_Request) returns (.CContentServerDirectory_GetClientUpdateHosts_Response);
	rpc GetManifestRequestCode (.CContentServerDirectory_GetManifestRequestCode_Request) returns (.CContentServerDirectory_GetManifestRequestCode_Response);
	rpc GetCDNAuthToken (.CContentServerDirectory_GetCDNAuthToken_Request) returns (.CContentServerDirectory_GetCDNAuthToken_Response);
	rpc RequestPeerContentServer (.CContentServerDirectory_RequestPeerContentServer_Request) returns (.CContentServerDirectory_RequestPeerContentServer_Response);
	rpc GetPeerContentInfo (.CContentServerDirectory_GetPeerContentInfo_Request) returns (.CContentServerDirectory_GetPeerContentInfo_Response);
}

service DepotContentDetection {
	rpc GetAllDetectedAppContent (.CDepotContentDetection_GetAllDetectedAppContent_Request) returns (.CDepotContentDetection_GetAllDetectedAppContent_Response);
}
