protoloader.lua 433 B

1234567891011121314
  1. -- module proto as examples/proto.lua
  2. package.path = "./examples/?.lua;" .. package.path
  3. local skynet = require "skynet"
  4. local sprotoparser = require "sprotoparser"
  5. local sprotoloader = require "sprotoloader"
  6. local proto = require "proto"
  7. skynet.start(function()
  8. sprotoloader.save(proto.c2s, 1)
  9. sprotoloader.save(proto.s2c, 2)
  10. -- don't call skynet.exit() , because sproto.core may unload and the global slot become invalid
  11. end)