Пример #1
0
        public virtual async Task <RoleLeaveZoneResponse> RoleLeave(RoleLeaveZoneRequest req)
        {
            var role = roles.RemoveByKey(req.roleID);

            if (role == null)
            {
                return(new RoleLeaveZoneResponse()
                {
                    s2c_code = RoleLeaveZoneResponse.CODE_ROLE_NOT_EXIST
                });
            }
            var zone = role.zone;

            if (zone == null)
            {
                return(new RoleLeaveZoneResponse()
                {
                    s2c_code = RoleLeaveZoneResponse.CODE_ZONE_NOT_EXIST
                });
            }
            //最后才删除//
            zone.currentRoleCount--;
            zone.area.currentRoleCount--;
            req.zoneUUID = zone.uuid;
            var rsp = await zone.area.service.CallAsync <RoleLeaveZoneResponse>(req);

            if (!Response.CheckSuccess(rsp))
            {
                log.Error(rsp);
            }
            zone.RemoveTeamID(role.enter.teamID);
            return(rsp);
        }
Пример #2
0
 public virtual Task <RoleLeaveZoneResponse> logic_rpc_Handle(RoleLeaveZoneRequest req)
 {
     //log.Info(req);
     return(RoleLeave(req));
 }