diff --git a/rsctrl/src/definition/chat.proto b/rsctrl/src/definition/chat.proto new file mode 100644 index 000000000..b80c41ae3 --- /dev/null +++ b/rsctrl/src/definition/chat.proto @@ -0,0 +1,212 @@ +package rsctrl.chat; + +import "core.proto"; + +/////////////////////////////////////////////////////////////// +// Private, Group and Chat Lobby RPC. +/////////////////////////////////////////////////////////////// + +enum RequestMsgIds { + MsgId_RequestChatLobbies = 1; + MsgId_RequestCreateLobby = 2; + MsgId_RequestJoinOrLeaveLobby = 3; + MsgId_RequestSetLobbyNickname = 4; + MsgId_RequestRegisterEvents = 5; + MsgId_RequestSendMessage = 6; +} + +enum ResponseMsgIds { + // STANDARD RESPONSES. + MsgId_ResponseChatLobbies = 1; + MsgId_ResponseRegisterEvents = 2; + MsgId_ResponseSendMessage = 6; + + // EVENTS + MsgId_EventLobbyInvite = 101; + MsgId_EventChatMessage = 102; +} + +/////////////////////////////////////////////////////////////// +// BUILDING BLOCKS. + +// This is a combination of ChatLobbyInfo & PublicChatLobbyRecord. +// Which seem very similar?? + +enum LobbyPrivacyLevel { + PRIVATE = 1; + PUBLIC = 2; +} + +enum ChatType { + TYPE_PRIVATE = 1; + TYPE_LOBBY = 2; + TYPE_GROUP = 3; +} + +message ChatLobbyInfo { + required string lobby_id = 1; + required string lobby_topic = 2; + required string lobby_name = 3; + + required string lobby_nickname = 4; // empty for none set. + + enum LobbyState { + JOINED = 1; + INVITED = 2; + PUBLIC = 3; + } + + required LobbyPrivacyLevel privacy_level = 5; + required LobbyState lobby_state = 6; + + required uint32 no_peers = 7; + required uint32 last_report_time = 8; + required uint32 last_activity = 9; + + repeated string participating_friends = 10; // SSL_IDS? + repeated string nick_names = 11; +} + + +message ChatMessage { + + required ChatType chat_type = 1; + required string chat_id = 2; + + required string peer_nickname = 3; + required uint32 chatflags = 4; + + required uint32 sendTime = 5; + required uint32 recvTime = 6; + + required string msg = 7; + } + + +// RESPONSE: ResponseChatLobbies +// This is a generic Response - used often. +// lobbies, will contain a list of affected / requested Lobbies. +message ResponseChatLobbies { + + required rsctrl.core.Status status = 1; + repeated ChatLobbyInfo lobbies = 2; +} + + + +/////////////////////////////////////////////////////////////// + +// REQUEST: RequestChatLobbies +message RequestChatLobbies { + + enum LobbyType { + ALL = 1; + NEW = 2; + INVITED = 3; + PRIVATE = 4; + PUBLIC = 5; + } + + required LobbyType lobby_type = 1; + +} + +// RESPONSE: ResponseChatLobbies + +/////////////////////////////////////////////////////////////// + + +// REQUEST: RequestCreateLobby +message RequestCreateLobby { + + required string lobby_name = 1; + required string lobby_topic = 2; + + required LobbyPrivacyLevel privacy_level = 4; + + repeated string invited_friends = 3; // SSL_IDS? +} + +// RESPONSE: ResponseChatLobbies + +/////////////////////////////////////////////////////////////// + +// Accept / Deny Invite, Join / Leave Lobby (these can be combined?) + +// REQUEST: RequestJoinOrLeaveLobby +message RequestJoinOrLeaveLobby { + + enum LobbyAction { + JOIN_OR_ACCEPT = 1; + LEAVE_OR_DENY = 2; + } + + required string lobby_id = 1; + required LobbyAction action = 2; +} + +// RESPONSE: ResponseChatLobbies + +/////////////////////////////////////////////////////////////// + +// Set Nickname. +// Get is done via requesting ChatLobby Info. +// Empty lobby_ids => default id. + +// REQUEST: RequestSetLobbyNickname +message RequestSetLobbyNickname { + required string nickname = 1; + repeated string lobby_ids = 2; +} + +// RESPONSE: ResponseChatLobbies + +/////////////////////////////////////////////////////////////// + +// Request Chat Events. +// This is done by registering for events. + +// REQUEST: ReqestRegisterEvents +message RequestRegisterEvents { + + enum RegisterAction { + REGISTER = 1; + DEREGISTER = 1; + } + + required RegisterAction action = 1; +} + +// RESPONSE: ResponseRegisterEvents +message ResponseRegisterEvents { + required rsctrl.core.Status status = 1; +} + +// RESPONSE: EventLobbyInvite +message EventLobbyInvite { + required ChatLobbyInfo lobby = 1; +} + +// RESPONSE: EventChatMessage +message EventChatMessage { + required ChatMessage msg = 1; +} + +/////////////////////////////////////////////////////////////// +// Send Message. + +// Request Chat Events. +// This is done by registering for events. + +// REQUEST: RequestSendMessage +message RequestSendMessage { + required ChatMessage msg = 2; +} + +// RESPONSE: ResponseSendMessage +message ResponseSendMessage { + required rsctrl.core.Status status = 1; +} + +/////////////////////////////////////////////////////////////// + diff --git a/rsctrl/src/definition/core.proto b/rsctrl/src/definition/core.proto index 58da5bef8..ddf3f2466 100644 --- a/rsctrl/src/definition/core.proto +++ b/rsctrl/src/definition/core.proto @@ -14,8 +14,10 @@ enum ExtensionId { CORE = 0; } enum PackageId { PEERS = 1; SYSTEM = 2; - FILES = 3; - MSGS = 4; + // BELOW HERE IS STILL BEING DESIGNED. + //CHAT = 3; + //FILES = 4; + //MSGS = 5; // THEORETICAL ONES. GXS = 1000;