import "google/protobuf/descriptor.proto";

extend .google.protobuf.FieldOptions {
	optional bool key_field = 50000 [default = false];
	optional bool hidden = 50001 [default = false];
}

message CMsgProtoBufHeader {
	optional fixed64 client_steam_id = 1;
	optional int32 client_session_id = 2;
	optional fixed64 job_id_source = 10 [default = 18446744073709551615];
	optional fixed64 job_id_target = 11 [default = 18446744073709551615];
	optional string target_job_name = 12;
}

message CMsgWebAPIKey {
	optional uint32 status = 1 [default = 255];
	optional uint32 account_id = 2 [default = 0];
	optional uint32 publisher_group_id = 3 [default = 0];
	optional uint32 key_id = 4;
	optional string domain = 5;
}

message CMsgHttpRequest {
	message RequestHeader {
		optional string name = 1;
		optional string value = 2;
	}

	message QueryParam {
		optional string name = 1;
		optional bytes value = 2;
	}

	optional uint32 request_method = 1;
	optional string hostname = 2;
	optional string url = 3;
	repeated .CMsgHttpRequest.RequestHeader headers = 4;
	repeated .CMsgHttpRequest.QueryParam get_params = 5;
	repeated .CMsgHttpRequest.QueryParam post_params = 6;
	optional bytes body = 7;
}

message CMsgWebAPIRequest {
	optional string UNUSED_job_name = 1;
	optional string interface_name = 2;
	optional string method_name = 3;
	optional uint32 version = 4;
	optional .CMsgWebAPIKey api_key = 5;
	optional .CMsgHttpRequest request = 6;
	optional uint32 routing_app_id = 7;
}

message CMsgHttpResponse {
	message ResponseHeader {
		optional string name = 1;
		optional string value = 2;
	}

	optional uint32 status_code = 1;
	repeated .CMsgHttpResponse.ResponseHeader headers = 2;
	optional bytes body = 3;
}

message CMsgAMFindAccounts {
	optional uint32 search_type = 1;
	optional string search_string = 2;
}

message CMsgAMFindAccountsResponse {
	repeated fixed64 steam_id = 1;
}

message CMsgNotifyWatchdog {
	optional uint32 source = 1;
	optional uint32 alert_type = 2;
	optional uint32 alert_destination = 3;
	optional bool critical = 4;
	optional uint32 time = 5;
	optional uint32 appid = 6;
	optional string text = 7;
}

message CMsgAMGetLicenses {
	optional fixed64 steamid = 1;
}

message CMsgPackageLicense {
	optional uint32 package_id = 1;
	optional uint32 time_created = 2;
}

message CMsgAMGetLicensesResponse {
	repeated .CMsgPackageLicense license = 1;
	optional uint32 result = 2;
}

message CMsgAMGetUserGameStats {
	optional fixed64 steam_id = 1;
	optional fixed64 game_id = 2;
	repeated uint32 stats = 3;
}

message CMsgAMGetUserGameStatsResponse {
	message Stats {
		optional uint32 stat_id = 1;
		optional uint32 stat_value = 2;
	}

	message Achievement_Blocks {
		optional uint32 achievement_id = 1;
		optional uint32 achievement_bit_id = 2;
		optional fixed32 unlock_time = 3;
	}

	optional fixed64 steam_id = 1;
	optional fixed64 game_id = 2;
	optional int32 eresult = 3 [default = 2];
	repeated .CMsgAMGetUserGameStatsResponse.Stats stats = 4;
	repeated .CMsgAMGetUserGameStatsResponse.Achievement_Blocks achievement_blocks = 5;
}

message CMsgGCGetCommandList {
	optional uint32 app_id = 1;
	optional string command_prefix = 2;
}

message CMsgGCGetCommandListResponse {
	repeated string command_name = 1;
}

message CGCMsgMemCachedGet {
	repeated string keys = 1;
}

message CGCMsgMemCachedGetResponse {
	message ValueTag {
		optional bool found = 1;
		optional bytes value = 2;
	}

	repeated .CGCMsgMemCachedGetResponse.ValueTag values = 1;
}

message CGCMsgMemCachedSet {
	message KeyPair {
		optional string name = 1;
		optional bytes value = 2;
	}

	repeated .CGCMsgMemCachedSet.KeyPair keys = 1;
}

message CGCMsgMemCachedDelete {
	repeated string keys = 1;
}

message CMsgAMAddFreeLicense {
	optional fixed64 steamid = 1;
	optional uint32 ip_public = 2;
	optional uint32 packageid = 3;
	optional string store_country_code = 4;
}

message CMsgAMAddFreeLicenseResponse {
	optional int32 eresult = 1 [default = 2];
	optional int32 purchase_result_detail = 2;
	optional fixed64 transid = 3;
}

