example for sproto

This commit is contained in:
Cloud Wu
2014-09-07 21:29:53 +08:00
parent 01269c88ff
commit 872b3c2743
4 changed files with 102 additions and 54 deletions

View File

@@ -1,6 +1,8 @@
local sprotoparser = require "sprotoparser"
local proto = sprotoparser.parse [[
local proto = {}
proto.c2s = sprotoparser.parse [[
.package {
type 0 : integer
session 1 : integer
@@ -17,7 +19,7 @@ get 2 {
what 0 : string
}
response {
result 0 : boolean
result 0 : string
}
}
@@ -26,11 +28,17 @@ set 3 {
what 0 : string
value 1 : string
}
response {
ok 0 : boolean
}
}
]]
proto.s2c = sprotoparser.parse [[
.package {
type 0 : integer
session 1 : integer
}
heartbeat 1 {}
]]
return proto