Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Add proto files to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
motiejus committed Jul 4, 2012
1 parent d143916 commit 9f786bb
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -12,3 +12,11 @@ Run `GLSProtoServer`.

`GLIExample` is a working example which receives the messages from GLS, prints
them on screen and returns a proper return value.

Generating proto classes
------------------------

These two commands generate `JInPiqi.java` and `JOutPiqi.java`:

$ protoc -I=./ --java_out=./src j-in.piqi.proto
$ protoc -I=./ --java_out=./src j-out.piqi.proto
36 changes: 36 additions & 0 deletions j-in.piqi.proto
@@ -0,0 +1,36 @@

message init {
repeated string userid_list = 1;
}

message handle_user_join {
required string userid = 1;
required bytes state = 2;
}

message handle_user_leave {
required string userid = 1;
required bytes state = 2;
}

message handle_action {
required string userid = 1;
required string command_name = 2;
repeated bytes command_args = 3;
required bytes state = 4;
}

message handle_timer {
required bytes identifier = 1;
required uint32 delta = 2;
required bytes state = 3;
}

message command {
optional init init = 1;
optional handle_user_join handle_user_join = 2;
optional handle_user_leave handle_user_leave = 3;
optional handle_action handle_action = 4;
optional handle_timer handle_timer = 5;
}

35 changes: 35 additions & 0 deletions j-out.piqi.proto
@@ -0,0 +1,35 @@

message userid_list {
repeated string elem = 1;
}

message gl_recipient {
optional bool all = 1;
optional userid_list users = 2;
}

message gl_command {
optional bool cont = 1;
optional bool stop = 2;
optional userid_list kick_player = 3;
}

message gl_message {
required gl_recipient recipient = 1;
required string command_name = 2;
repeated bytes command_args = 3;
}

message gl_timer {
required bytes identifier = 1;
required uint32 duration_in_ms = 2;
required uint32 tick_duration_in_ms = 3;
}

message callback_return {
required bytes new_state = 1;
repeated gl_command commands = 2;
repeated gl_message messages = 3;
repeated gl_timer timers = 4;
}

2 changes: 0 additions & 2 deletions src/JInPiqi.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/JOutPiqi.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f786bb

Please sign in to comment.