syntax = "proto3"; package krpc.schema; option csharp_namespace = 'KRPC.Schema.KRPC'; option java_package = 'krpc.schema'; option java_outer_classname = 'KRPC'; option objc_class_prefix = "KRPC"; option optimize_for = LITE_RUNTIME; // Messages for connecting to the server message ConnectionRequest { Type type = 1; string client_name = 2; bytes client_identifier = 3; enum Type { RPC = 0; STREAM = 1; }; } message ConnectionResponse { Status status = 1; enum Status { OK = 0; MALFORMED_MESSAGE = 1; TIMEOUT = 2; WRONG_TYPE = 3; } string message = 2; bytes client_identifier = 3; } // Messages for calling remote procedures message Request { repeated ProcedureCall calls = 1; } message ProcedureCall { string service = 1; string procedure = 2; uint32 service_id = 4; uint32 procedure_id = 5; repeated Argument arguments = 3; } message Argument { uint32 position = 1; bytes value = 2; } message Response { Error error = 1; repeated ProcedureResult results = 2; } message ProcedureResult { Error error = 1; bytes value = 2; } message Error { string service = 1; string name = 2; string description = 3; string stack_trace = 4; } // Messages for receiving stream updates message StreamUpdate { repeated StreamResult results = 1; } message StreamResult { uint64 id = 1; ProcedureResult result = 2; } // Messages for receiving information about the server message Services { repeated Service services = 1; } message Service { string name = 1; repeated Procedure procedures = 2; repeated Class classes = 3; repeated Enumeration enumerations = 4; repeated Exception exceptions = 5; string documentation = 6; } message Procedure { string name = 1; repeated Parameter parameters = 2; Type return_type = 3; bool return_is_nullable = 4; repeated GameScene game_scenes = 6; string documentation = 5; enum GameScene { SPACE_CENTER = 0; FLIGHT = 1; TRACKING_STATION = 2; EDITOR_VAB = 3; EDITOR_SPH = 4; MISSION_BUILDER = 5; }; } message Parameter { string name = 1; Type type = 2; bytes default_value = 3; bool nullable = 4; } message Class { string name = 1; string documentation = 2; } message Enumeration { string name = 1; repeated EnumerationValue values = 2; string documentation = 3; } message EnumerationValue { string name = 1; int32 value = 2; string documentation = 3; } message Exception { string name = 1; string documentation = 2; } message Type { TypeCode code = 1; string service = 2; string name = 3; repeated Type types = 4; enum TypeCode { NONE = 0; // Values DOUBLE = 1; FLOAT = 2; SINT32 = 3; SINT64 = 4; UINT32 = 5; UINT64 = 6; BOOL = 7; STRING = 8; BYTES = 9; // Objects CLASS = 100; ENUMERATION = 101; // Messages EVENT = 200; PROCEDURE_CALL = 201; STREAM = 202; STATUS = 203; SERVICES = 204; // Collections TUPLE = 300; LIST = 301; SET = 302; DICTIONARY = 303; }; } // Collection data structures message Tuple { repeated bytes items = 1; } message List { repeated bytes items = 1; } message Set { repeated bytes items = 1; } message Dictionary { repeated DictionaryEntry entries = 1; } message DictionaryEntry { bytes key = 1; bytes value = 2; } // Aggregate data structures message Stream { uint64 id = 1; } message Event { Stream stream = 1; } message Status { string version = 1; uint64 bytes_read = 2; uint64 bytes_written = 3; float bytes_read_rate = 4; float bytes_written_rate = 5; uint64 rpcs_executed = 6; float rpc_rate = 7; bool one_rpc_per_update = 8; uint32 max_time_per_update = 9; bool adaptive_rate_control = 10; bool blocking_recv = 11; uint32 recv_timeout = 12; float time_per_rpc_update = 13; float poll_time_per_rpc_update = 14; float exec_time_per_rpc_update = 15; uint32 stream_rpcs = 16; uint64 stream_rpcs_executed = 17; float stream_rpc_rate = 18; float time_per_stream_update = 19; } // Multiplexed request messages message MultiplexedRequest { ConnectionRequest connection_request = 1; Request request = 2; } message MultiplexedResponse { Response response = 1; StreamUpdate stream_update = 2; }