import "steammessages_unified_base.steamworkssdk.proto";

option cc_generic_services = true;

enum ENotificationSetting {
	k_ENotificationSettingNotifyUseDefault = 0;
	k_ENotificationSettingAlways = 1;
	k_ENotificationSettingNever = 2;
}

message CPlayer_GetMutualFriendsForIncomingInvites_Request {
}

message CPlayer_IncomingInviteMutualFriendList {
	optional fixed64 steamid = 1;
	repeated uint32 mutual_friend_account_ids = 2;
}

message CPlayer_GetMutualFriendsForIncomingInvites_Response {
	repeated .CPlayer_IncomingInviteMutualFriendList incoming_invite_mutual_friends_lists = 1;
}

message CPlayer_GetFriendsGameplayInfo_Request {
	optional uint32 appid = 1;
}

message CPlayer_GetFriendsGameplayInfo_Response {
	message FriendsGameplayInfo {
		optional fixed64 steamid = 1;
		optional uint32 minutes_played = 2;
		optional uint32 minutes_played_forever = 3;
	}

	message OwnGameplayInfo {
		optional fixed64 steamid = 1;
		optional uint32 minutes_played = 2;
		optional uint32 minutes_played_forever = 3;
		optional bool in_wishlist = 4;
		optional bool owned = 5;
	}

	optional .CPlayer_GetFriendsGameplayInfo_Response.OwnGameplayInfo your_info = 1;
	repeated .CPlayer_GetFriendsGameplayInfo_Response.FriendsGameplayInfo in_game = 2;
	repeated .CPlayer_GetFriendsGameplayInfo_Response.FriendsGameplayInfo played_recently = 3;
	repeated .CPlayer_GetFriendsGameplayInfo_Response.FriendsGameplayInfo played_ever = 4;
	repeated .CPlayer_GetFriendsGameplayInfo_Response.FriendsGameplayInfo owns = 5;
	repeated .CPlayer_GetFriendsGameplayInfo_Response.FriendsGameplayInfo in_wishlist = 6;
}

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;
		optional uint32 first_playtime = 5;
	}

	repeated .CPlayer_GetLastPlayedTimes_Response.Game games = 1;
}

message CPlayer_AcceptSSA_Request {
}

message CPlayer_AcceptSSA_Response {
}

message CPlayer_GetNicknameList_Request {
}

message CPlayer_GetNicknameList_Response {
	message PlayerNickname {
		optional fixed32 accountid = 1;
		optional string nickname = 2;
	}

	repeated .CPlayer_GetNicknameList_Response.PlayerNickname nicknames = 1;
}

message CPlayer_GetPerFriendPreferences_Request {
}

message PerFriendPreferences {
	optional fixed32 accountid = 1;
	optional string nickname = 2;
	optional .ENotificationSetting notifications_showingame = 3 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting notifications_showonline = 4 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting notifications_showmessages = 5 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting sounds_showingame = 6 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting sounds_showonline = 7 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting sounds_showmessages = 8 [default = k_ENotificationSettingNotifyUseDefault];
	optional .ENotificationSetting notifications_sendmobile = 9 [default = k_ENotificationSettingNotifyUseDefault];
}

message CPlayer_GetPerFriendPreferences_Response {
	repeated .PerFriendPreferences preferences = 1;
}

message CPlayer_SetPerFriendPreferences_Request {
	optional .PerFriendPreferences preferences = 1;
}

message CPlayer_SetPerFriendPreferences_Response {
}

message CPlayer_AddFriend_Request {
	optional fixed64 steamid = 1 [(description) = "Steam ID of user to whom to send a friend invite."];
}

message CPlayer_AddFriend_Response {
	optional bool invite_sent = 1 [(description) = "True if the operation was successful, false otherwise."];
	optional uint32 friend_relationship = 2 [(description) = "the resulting relationship.  Depending on state, may move directly to friends rather than invite sent"];
}

message CPlayer_RemoveFriend_Request {
	optional fixed64 steamid = 1 [(description) = "Steam ID of friend to remove."];
}

message CPlayer_RemoveFriend_Response {
	optional uint32 friend_relationship = 1 [(description) = "the resulting relationship"];
}

message CPlayer_IgnoreFriend_Request {
	optional fixed64 steamid = 1;
	optional bool unignore = 2 [(description) = "If set, remove from ignore/block list instead of adding "];
}

message CPlayer_IgnoreFriend_Response {
	optional uint32 friend_relationship = 1 [(description) = "the resulting relationship"];
}

message CPlayer_GetCommunityPreferences_Request {
}

message CPlayer_CommunityPreferences {
	optional bool hide_adult_content_violence = 1 [default = true];
	optional bool hide_adult_content_sex = 2 [default = true];
	optional bool parenthesize_nicknames = 4 [default = false];
	optional uint32 timestamp_updated = 3;
}

message CPlayer_GetCommunityPreferences_Response {
	optional .CPlayer_CommunityPreferences preferences = 1;
}

message CPlayer_SetCommunityPreferences_Request {
	optional .CPlayer_CommunityPreferences preferences = 1;
}

message CPlayer_SetCommunityPreferences_Response {
}

message CPlayer_GetNewSteamAnnouncementState_Request {
	optional int32 language = 1;
}

message CPlayer_GetNewSteamAnnouncementState_Response {
	optional int32 state = 1;
	optional string announcement_headline = 2;
	optional string announcement_url = 3;
	optional uint32 time_posted = 4;
	optional uint64 announcement_gid = 5;
}

message CPlayer_UpdateSteamAnnouncementLastRead_Request {
	optional uint64 announcement_gid = 1;
	optional uint32 time_posted = 2;
}

message CPlayer_UpdateSteamAnnouncementLastRead_Response {
}

service Player {
	option (service_description) = "A service for accessing Steam player data";

	rpc GetMutualFriendsForIncomingInvites (.CPlayer_GetMutualFriendsForIncomingInvites_Request) returns (.CPlayer_GetMutualFriendsForIncomingInvites_Response) {
		option (method_description) = "Get me the mutual friends for each of my pending incoming invites (individuals and clans).";
	}

	rpc GetFriendsGameplayInfo (.CPlayer_GetFriendsGameplayInfo_Request) returns (.CPlayer_GetFriendsGameplayInfo_Response) {
		option (method_description) = "Get a list of friends who are playing, have played, own, or want a game";
	}

	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";
	}

	rpc GetNicknameList (.CPlayer_GetNicknameList_Request) returns (.CPlayer_GetNicknameList_Response) {
		option (method_description) = "Gets the list of nicknames this user has for other users";
	}

	rpc GetPerFriendPreferences (.CPlayer_GetPerFriendPreferences_Request) returns (.CPlayer_GetPerFriendPreferences_Response) {
		option (method_description) = "Gets the list of per-friend preferences this user has set for other users";
	}

	rpc SetPerFriendPreferences (.CPlayer_SetPerFriendPreferences_Request) returns (.CPlayer_SetPerFriendPreferences_Response) {
		option (method_description) = "Sets the logged in user's per-friend preferences for the given user";
	}

	rpc AddFriend (.CPlayer_AddFriend_Request) returns (.CPlayer_AddFriend_Response) {
		option (method_description) = "Invites another Steam user to be a friend";
	}

	rpc RemoveFriend (.CPlayer_RemoveFriend_Request) returns (.CPlayer_RemoveFriend_Response) {
		option (method_description) = "Removes a friend or ignores a friend suggestion";
	}

	rpc IgnoreFriend (.CPlayer_IgnoreFriend_Request) returns (.CPlayer_IgnoreFriend_Response) {
		option (method_description) = "Blocks or unblocks communication with the user.  Despite name, can be a non-friend.";
	}

	rpc GetCommunityPreferences (.CPlayer_GetCommunityPreferences_Request) returns (.CPlayer_GetCommunityPreferences_Response) {
		option (method_description) = "Returns the player's community preferences";
	}

	rpc SetCommunityPreferences (.CPlayer_SetCommunityPreferences_Request) returns (.CPlayer_SetCommunityPreferences_Response) {
		option (method_description) = "Sets the player's community preferences";
	}

	rpc GetNewSteamAnnouncementState (.CPlayer_GetNewSteamAnnouncementState_Request) returns (.CPlayer_GetNewSteamAnnouncementState_Response) {
		option (method_description) = "Calculates and returns what to display for UI that renders new steam announcement available";
	}

	rpc UpdateSteamAnnouncementLastRead (.CPlayer_UpdateSteamAnnouncementLastRead_Request) returns (.CPlayer_UpdateSteamAnnouncementLastRead_Response) {
		option (method_description) = "Marks latest announcement timestamp read by user";
	}
}
