Commit 188558e8527123cdd1dfdb08a7a0aaea603b1fbe
1 parent
be9c9ca6
skynet 1.2.0 use session for other uses call skynet.ignoreret
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
src/agent.lua
| ... | ... | @@ -148,6 +148,8 @@ skynet.register_protocol { |
| 148 | 148 | return cmd, string.sub(data, 3) |
| 149 | 149 | end, |
| 150 | 150 | dispatch = function(session, address, cmd, data) |
| 151 | + skynet.ignoreret() | |
| 152 | + skynet.trace() --执行序的跟踪统计 | |
| 151 | 153 | cs(function() |
| 152 | 154 | if cmd == actionCodes.Sys_heartBeat then |
| 153 | 155 | agent_util:heart_beat(agentInfo) |
| ... | ... | @@ -188,6 +190,7 @@ skynet.register_protocol { |
| 188 | 190 | pack = skynet.pack, |
| 189 | 191 | unpack = skynet.unpack, |
| 190 | 192 | dispatch = function(session, address, submethod, ...) |
| 193 | + skynet.trace() --执行序的跟踪统计 | |
| 191 | 194 | local result |
| 192 | 195 | if not agentInfo.role then |
| 193 | 196 | result = "__OFFLINE__" |
| ... | ... | @@ -253,11 +256,14 @@ end |
| 253 | 256 | |
| 254 | 257 | skynet.start(function() |
| 255 | 258 | skynet.dispatch("lua", function(session, source, command, ...) |
| 259 | + skynet.trace() --执行序的跟踪统计 | |
| 256 | 260 | local f = CMD[command] |
| 257 | 261 | if f then |
| 258 | 262 | if command == "exit" then |
| 263 | + skynet.ignoreret() | |
| 259 | 264 | f(...) |
| 260 | 265 | elseif command == "start" then |
| 266 | + skynet.ignoreret() | |
| 261 | 267 | f(session, source, ...) |
| 262 | 268 | else |
| 263 | 269 | skynet.ret(skynet.pack(f(...))) | ... | ... |