Updated Interfaces (markdown)
parent
172f527fb8
commit
fec2a5c1e7
1 changed files with 11 additions and 3 deletions
|
@ -1,9 +1,9 @@
|
||||||
## ggs_vm_runner
|
## ggs_vm_runner
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
ggs_vm_runner:start_link() -> GameVm
|
start_link() -> GameVm
|
||||||
ggs_vm_runner:define(GameVM, SourceCode) -> ok
|
define(GameVM, SourceCode) -> ok
|
||||||
ggs_vm_runner:user_command(GameVM, User, Command, Args) -> ok
|
user_command(GameVM, User, Command, Args) -> ok
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Only `start_link()` has a return value, the other two always return `ok`.
|
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.
|
- `Data` is just a String.
|
||||||
- `server` and `game` are atoms to indicate the receiver.
|
- `server` and `game` are atoms to indicate the receiver.
|
||||||
- `Command` is just a String.
|
- `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".
|
Reference in a new issue