Updated Interfaces (markdown)

jeena 2011-02-14 13:22:11 -08:00
parent 172f527fb8
commit fec2a5c1e7

@ -1,9 +1,9 @@
## ggs_vm_runner
<pre>
ggs_vm_runner:start_link() -> GameVm
ggs_vm_runner:define(GameVM, SourceCode) -> ok
ggs_vm_runner:user_command(GameVM, User, Command, Args) -> ok
start_link() -> GameVm
define(GameVM, SourceCode) -> ok
user_command(GameVM, User, Command, Args) -> ok
</pre>
Only `start_link()` has a return value, the other two always return `ok`.
@ -19,3 +19,11 @@ handle_cast({game, Command, Headers, Data}, State) -> {noreply, NewState}</pre>
- `Data` is just a String.
- `server` and `game` are atoms to indicate the receiver.
- `Command` is just a String.
## ggs_protocol
<pre>parse(RawData) -> {Headers, DataString}
create(Headers, DataString) -> RawData
</pre>
- `Headers` are a proplist [[http://www.erlang.org/doc/man/proplists.html]] so you can use proplist:get_value(token) to get the value of the header "Token".