import "google/protobuf/descriptor.proto";
import "steammessages_unified_base.steamclient.proto";

message CPlayer_GetGameBadgeLevels_Request {
	optional uint32 appid = 1;
}

message CPlayer_GetGameBadgeLevels_Response {
	message Badge {
		optional int32 level = 1;
		optional int32 series = 2;
		optional uint32 border_color = 3;
	}

	optional uint32 player_level = 1;
	repeated .CPlayer_GetGameBadgeLevels_Response.Badge badges = 2;
}

message CPlayer_GetLastPlayedTimes_Request {
	optional uint32 min_last_played = 1 [(description) = "The most recent last-played time the client already knows about"];
}

message CPlayer_GetLastPlayedTimes_Response {
	message Game {
		optional int32 appid = 1;
		optional uint32 last_playtime = 2;
		optional int32 playtime_2weeks = 3;
		optional int32 playtime_forever = 4;
	}

	repeated .CPlayer_GetLastPlayedTimes_Response.Game games = 1;
}

message CPlayer_AcceptSSA_Request {
}

message CPlayer_AcceptSSA_Response {
}

message CPlayer_LastPlayedTimes_Notification {
	repeated .CPlayer_GetLastPlayedTimes_Response.Game games = 1;
}

service Player {
	option (service_description) = "A service for accessing Steam player data";
	rpc GetGameBadgeLevels (.CPlayer_GetGameBadgeLevels_Request) returns (.CPlayer_GetGameBadgeLevels_Response) {
		option (method_description) = "Returns the Steam Level of a user, the Badge level for the game, and if it's foil";
	}
	rpc ClientGetLastPlayedTimes (.CPlayer_GetLastPlayedTimes_Request) returns (.CPlayer_GetLastPlayedTimes_Response) {
		option (method_description) = "Gets the last-played times for the account";
	}
	rpc AcceptSSA (.CPlayer_AcceptSSA_Request) returns (.CPlayer_AcceptSSA_Response) {
		option (method_description) = "User is accepting the SSA";
	}
}
service PlayerClient {
	option (service_description) = "Steam player data client notifications";
	option (service_execution_site) = k_EProtoExecutionSiteSteamClient;
	rpc NotifyLastPlayedTimes (.CPlayer_LastPlayedTimes_Notification) returns (.NoResponse) {
		option (method_description) = "Notification from server to client of more recent play time";
	}
}
