Skip to content

Instantly share code, notes, and snippets.

@akirayu101
Created November 27, 2014 09:41
Show Gist options
  • Save akirayu101/74addc70a48475990d59 to your computer and use it in GitHub Desktop.
Save akirayu101/74addc70a48475990d59 to your computer and use it in GitHub Desktop.
test gm
rpc_lua = {}
function rpc_lua:call(fn_name, ...)
return self[fn_name](self, ...)
end
function rpc_lua:test1(arg1, arg2, arg3)
print "test1"
end
function rpc_lua:test2(arg1, arg2)
print "test2"
end
function rpc_lua:eval(str)
print(loadstring("return ".. str)())
self:call(loadstring("return ".. str)())
end
rpc_lua:eval("'test1', 1, 2, 3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment