【修改】更新单元测试
This commit is contained in:
25
example/plugin/example_plugin_regist.lua
Normal file
25
example/plugin/example_plugin_regist.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
function plugin_ctx_new(sess, plug_env, sess_context)
|
||||
print("now begin to create new ctx context example regist")
|
||||
sess_context.data = "this is example regist sess context data"
|
||||
print("session data is", sess_context.data)
|
||||
end
|
||||
|
||||
function plugin_ctx_free(sess, sess_context, plug_env)
|
||||
print("now begin to free ctx context example regist")
|
||||
print("session data is", sess_context.data)
|
||||
end
|
||||
|
||||
function plugin_load(stellar, plug_env)
|
||||
print("now load lua plugin example regist")
|
||||
print("this example aims to test regist function")
|
||||
plug_env.data = "my example regist plugin env"
|
||||
--[[ 由于未订阅消息, 注册函数应该永远不会触发 ]]
|
||||
plug_env.id = plugin_manage.register(stellar, plugin_ctx_new, plugin_ctx_free, plug_env)
|
||||
print("plugin env data is", plug_env.data)
|
||||
print("after regist, plugin id is", plug_env.id)
|
||||
end
|
||||
|
||||
function plugin_unload(plug_env)
|
||||
print("now unload lua plugin example regist")
|
||||
print("plugin env data is", plug_env.data)
|
||||
end
|
||||
Reference in New Issue
Block a user