Skip to content

Commit

Permalink
优化笔误
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Apr 16, 2024
1 parent b1c418c commit 5817926
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion script/driver/unqlite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end

function Unqlite:open(name)
if not self.driver then
local driver = Unqlite.create()
local driver = unqlite.create()
local jcodec = json.jsoncodec()
driver.set_codec(jcodec)
self.driver = driver
Expand Down
7 changes: 4 additions & 3 deletions script/network/net_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ prop:reader("sessions", {}) --会话列表
prop:reader("session_type", "default") --会话类型
prop:reader("session_count", 0) --会话数量
prop:reader("listener", nil) --监听器
prop:reader("broad_token", nil) --监听器
prop:reader("broad_token", nil) --广播token
prop:reader("codec", nil) --编解码器
prop:accessor("msgtype", 0) --消息类型

function NetServer:__init(session_type)
self.session_type = session_type
Expand Down Expand Up @@ -81,12 +82,12 @@ function NetServer:on_socket_accept(session)
self:add_session(session)
-- 绑定call回调
session.call_client = function(cmd_id, flag, session_id, body)
local send_len = session.call_pb(session_id, cmd_id, flag, 0, 0, body)
local send_len = session.call_pb(session_id, cmd_id, flag, self.msgtype, 0, body)
if send_len <= 0 then
log_err("[NetServer][call_client] call_pb failed! code:{}", send_len)
return false
end
return true
return trues
end
session.on_call_pb = function(recv_len, session_id, cmd_id, flag, type, crc8, body)
if session_id > 0 then
Expand Down
2 changes: 1 addition & 1 deletion script/store/store_kv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function StoreKV:sync_whole()
self.wholes[self.primary_key] = self.primary_id
end
log_debug("[StoreKV][sync_whole] {}.{}={}", self.primary_id, self.sheet, self.wholes)
if not self.driver :put(self.primary_id, self.wholes, self.sheet) then
if not self.driver:put(self.primary_id, self.wholes, self.sheet) then
log_err("[StoreKV][sync_whole] sync {}.{} failed!", self.primary_id, self.sheet)
end
end
Expand Down

0 comments on commit 5817926

Please sign in to comment.