| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- local AccountInfoMgr = class("AccountInfoMgr")
- function AccountInfoMgr:ctor()
- self.CurrentDeleteTime = 0 -- 0 表示没有删除操作
- self:RegisterNetEvents()
- end
- function AccountInfoMgr:RegisterNetEvents()
- ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_USER_DELETE_ACK,self.On_SCUserDeleteAck,self)
- ManagerContainer.NetManager:NetRegister(ProtoMsgId.SC_USER_DELETE_INFO_ACK,self.On_SCUserDeleteInfoAck,self)
- end
- function AccountInfoMgr:UnRegisterNetEvents()
- ManagerContainer.NetManager:UnRegisterPbIdCallback(ProtoMsgId.SC_USER_DELETE_ACK)
- ManagerContainer.NetManager:UnRegisterPbIdCallback(ProtoMsgId.SC_USER_DELETE_INFO_ACK)
- end
- function AccountInfoMgr:RegisterAllDataEvents()
-
- end
- function AccountInfoMgr:ResetAllData()
- end
- function AccountInfoMgr:Destroy()
- self:UnRegisterNetEvents()
- end
- function AccountInfoMgr:SendDeleteReq()
- ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_USER_DELETE_REQ,{status = 0})
- end
- function AccountInfoMgr:SendCancelDeleteReq()
- ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_USER_DELETE_REQ,{status = 1})
- end
- function AccountInfoMgr:SendGetDeleteInfoReq()
- ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_USER_DELETE_INFO_REQ,{})
- end
- --删除或者取消请求
- function AccountInfoMgr:On_SCUserDeleteAck(data)
- LogError(Inspect(data))
- if data.error ~= 0 then
- return
- end
- self.CurrentDeleteTime = data.time
- -- LogError("self.CurrentDeleteTime = "..self.CurrentDeleteTime )
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.ACCOUNT_DELETE_CHANGE)
- if data.time ~= 0 then
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.ACCOUNT_DELETE_NTF)
- end
- end
- --查询
- function AccountInfoMgr:On_SCUserDeleteInfoAck(data)
- LogError(Inspect(data))
- if data.error ~= 0 then
- return
- end
- self.CurrentDeleteTime = data.time
- -- LogError("self.CurrentDeleteTime = "..self.CurrentDeleteTime )
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.ACCOUNT_DELETE_CHANGE)
- end
- function AccountInfoMgr:IsDeleteAccount()
- return self.CurrentDeleteTime ~= 0
- end
- function AccountInfoMgr:GetCurDeleteTime()
- -- LogError("self.CurrentDeleteTime = "..self.CurrentDeleteTime )
- return self.CurrentDeleteTime
- end
- return AccountInfoMgr
|