summaryrefslogtreecommitdiff
path: root/library/proto
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-09 21:42:22 +0400
committerAlexander Gavrilov2012-03-09 21:42:22 +0400
commit75c569b09773c0d7644d54fd77350e6ff1073475 (patch)
tree98e5b2e7b2cbe9c60435be0921c8b06e20e1184f /library/proto
parentedf77cf270e3ff7c4a08cd85fcaf537b254f6273 (diff)
downloaddfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.gz
dfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.bz2
dfhack-75c569b09773c0d7644d54fd77350e6ff1073475.tar.xz
Add some experimental message definitions to the main library.
Diffstat (limited to 'library/proto')
-rw-r--r--library/proto/.gitignore2
-rw-r--r--library/proto/CoreProtocol.proto59
2 files changed, 61 insertions, 0 deletions
diff --git a/library/proto/.gitignore b/library/proto/.gitignore
new file mode 100644
index 00000000..a1fb10cc
--- /dev/null
+++ b/library/proto/.gitignore
@@ -0,0 +1,2 @@
+*.pb.cc
+*.pb.h
diff --git a/library/proto/CoreProtocol.proto b/library/proto/CoreProtocol.proto
new file mode 100644
index 00000000..33ec0f4a
--- /dev/null
+++ b/library/proto/CoreProtocol.proto
@@ -0,0 +1,59 @@
+package dfproto;
+
+option optimize_for = LITE_RUNTIME;
+
+message CoreTextFragment {
+ required string text = 1;
+
+ enum Color {
+ COLOR_BLACK = 0;
+ COLOR_BLUE = 1;
+ COLOR_GREEN = 2;
+ COLOR_CYAN = 3;
+ COLOR_RED = 4;
+ COLOR_MAGENTA = 5;
+ COLOR_BROWN = 6;
+ COLOR_GREY = 7;
+ COLOR_DARKGREY = 8;
+ COLOR_LIGHTBLUE = 9;
+ COLOR_LIGHTGREEN = 10;
+ COLOR_LIGHTCYAN = 11;
+ COLOR_LIGHTRED = 12;
+ COLOR_LIGHTMAGENTA = 13;
+ COLOR_YELLOW = 14;
+ COLOR_WHITE = 15;
+ };
+ optional Color color = 2;
+}
+
+message CoreTextNotification {
+ repeated CoreTextFragment fragments = 1;
+}
+
+message CoreErrorNotification {
+ enum ErrorCode {
+ CR_WOULD_BREAK = -2;
+ CR_NOT_IMPLEMENTED = -1;
+ CR_FAILURE = 0;
+ CR_OK = 1;
+ CR_WRONG_USAGE = 2;
+ };
+
+ required ErrorCode code = 1;
+}
+
+message CoreBindRequest {
+ required string method = 1;
+ optional string plugin = 2;
+ optional int32 min_version = 3;
+}
+
+message CoreBindReply {
+ required int32 assigned_id = 1;
+ required int32 version = 2;
+}
+
+message CoreRunStringRequest {
+ required string command = 1;
+ repeated string arguments = 2;
+}