summaryrefslogtreecommitdiff
path: root/example/example_plugin-1.lua
blob: 52b0500c8cea1e61e359e4769db9743a26d44282 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function plugin_ctx_new(sess, plug_env, sess_context)
    print("now begin to create new ctx context example-1")
    print(plug_env.data)
    sess_context.id = 100
end

function plugin_ctx_free(sess, sess_context, plug_env)
    print("now begin to free ctx context example-1")
    print(sess_context.id)
end

function plugin_load(stellar, plug_env)
    print("now begin to load plugin example-1")
    plug_env.data = "my example-1 plugin env"
    plug_env.newid = 1000
    plugin_manage.register(stellar, plugin_ctx_new, plugin_ctx_free, plug_env)
    plug_env.messid = 100
end

function plugin_unload(plug_env)
    print("now running unload plugin example-1 function")
    print(plug_env.__penv_pointer)
    print(plug_env.data)
    print(plug_env.newid)
    print(plug_env.messid)
end