FriendCloudProto/src/main/protobuf/CommonMessages.proto

43 lines
1.3 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package moe.nekojimi.friendcloud.protos;
import "google/protobuf/any.proto";
message MessageHeader {
uint64 sender_id = 1;
uint64 message_id = 2;
uint64 reply_to_message_id = 3;
}
message FriendCloudMessage {
MessageHeader header = 1;
google.protobuf.Any body = 2;
}
message LoginMessage {
}
enum Error {
ERROR_UNSPECIFIED = 0;
ERROR_WHO_THE_FUCK_ARE_YOU = 1; // sender unidentified or unauthenticated
ERROR_PERMISSION_DENIED = 2; // you can't do that
ERROR_OBJECT_NOT_FOUND = 3; // one or more object(s) specified don't exist
ERROR_INTERNAL = 4; // internal error
ERROR_OUT_OF_DATE = 5; // your action is impossible because you have an out-of-date state (in a way that matters)
ERROR_CHECKSUM_FAILURE = 6; // a supplied checksum didn't match the relevant data
ERROR_PIECE_NOT_POSSESSED = 7; // you asked for a file piece I don't have
ERROR_INVALID_ARGUMENT = 8; // an argument specified is outside the expected range
ERROR_NOT_EXPECTING_REPLY = 9; // you sent a reply to a message that I wasn't expecting a reply to
ERROR_INVALID_PROTOBUF = 10; // your message couldn't be decoded at all
}
message ErrorMessage {
Error error = 1;
}
message PingMessage {
}
message PongMessage {
}