Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sniper00 committed Dec 20, 2021
1 parent f73f47a commit 2ef642b
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
# v0.2
- add mongodb driver
- improve message dispatch

```lua
---old style
local function docmd(sender,sessionid, CMD,...)

end

moon.dispatch('lua',function(msg,unpack)
local sender, sz, len = moon.decode(msg, "SC")
docmd(sender, unpack(sz, len))
end)


---new style
moon.dispatch('lua',function(sender,session, cmd, ...)
-- body
local f = command[cmd]
if f then
f(sender,...)
else
error(string.format("Unknown command %s", tostring(cmd)))
end
end)
```

# v0.1 (2021-11-17)
- remove socket.readline. use: socket.read
- bugfix: buffer's move assignment operator
- message object passed by value in cpp code
- message object passed by right value in cpp code
- use isocalendar calculate datetime
- improve code

0 comments on commit 2ef642b

Please sign in to comment.