diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index da62e83..3ca82a6 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -100,6 +100,18 @@ function _M.loginRpc( agent, data ) role:startActionUcode() else role:reloadWhenLogin() + if role:getProperty("del") == 1 then + local ret, res= roleByUid(role:getProperty("uid")) + if not ret then + response.result = "NOT_EXIST" + SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) + end + role = require("models.Role").new({key = tostring(res["id"])}) + role:load() + role:loadAll() + role:startActionUcode() + agent.role = role + end end @@ -490,7 +502,7 @@ function _M.createRpc(agent, data) skynet.error("[ERROR] cbbackd cant call center uid: " .. uid .. " roleId:" .. roleId) end end) - + -- cb1活跃回馈 onCb1Back(newRole) @@ -506,7 +518,8 @@ function _M.unRegisterRpc(agent, data) return 0 end - if not roleUnRegister(roleId) then return 1 end + role:setProperty("del", 1) + --if not roleUnRegister(roleId) then return 1 end SendPacket(actionCodes.Role_unRegisterRpc, MsgPack.pack({})) return true end -- libgit2 0.21.2