Exemplo n.º 1
0
        //public Match_FightinfoResponse GetFightInfo(Guid managerId, Guid awayId, bool isHomeBot, bool isAwayBot, bool syncAwayFlag = false, string homeSiteId = "", string awaySiteId = "")
        //{
        //    DicNpcEntity homeNpc = null;
        //    DicNpcEntity awayNpc = null;
        //    if (string.IsNullOrEmpty(homeSiteId))
        //    {
        //        homeNpc = CacheFactory.NpcdicCache.GetNpc(managerId);
        //        awayNpc = CacheFactory.NpcdicCache.GetNpc(awayId);
        //    }
        //    bool isHomeNpc = null != homeNpc;
        //    bool isAwayNpc = null != awayNpc;
        //    DTOBuffMemberView homeView, awayView;
        //    BuffDataCore.Instance().GetMembers(out homeView, out awayView,
        //        homeSiteId, managerId, isHomeNpc, awaySiteId, awayId, isAwayNpc, true, syncAwayFlag);
        //    Match_FightManagerinfo home, away;
        //    if (isHomeNpc)
        //        home = MatchDataHelper.GetFightinfo(homeNpc, homeView);
        //    else
        //        home = MatchDataHelper.GetFightinfo(managerId, isHomeBot, homeView, homeSiteId);
        //    if (isAwayNpc)
        //        away = MatchDataHelper.GetFightinfo(awayNpc, awayView);
        //    else
        //        away = MatchDataHelper.GetFightinfo(awayId, isAwayBot, awayView, awaySiteId);
        //    if (home == null || away == null)
        //        return ResponseHelper.Create<Match_FightinfoResponse>(MessageCode.NbParameterError);

        //    var response = ResponseHelper.CreateSuccess<Match_FightinfoResponse>();
        //    response.Data = new Match_Fightinfo();
        //    response.Data.Home = home;
        //    response.Data.Away = away;
        //    return response;
        //}

        //public Match_FightManagerinfo GetFightManagerFightInfo(Guid managerId, bool isBot = false)
        //{
        //    if (CacheFactory.NpcdicCache.IsNpc(managerId))
        //    {
        //        return CacheFactory.NpcdicCache.GetFightManagerinfo(managerId);
        //    }
        //    else
        //    {
        //        return MatchDataHelper.GetFightinfo(managerId, isBot);
        //    }
        //}
        #endregion

        #region GetProcess
        public MatchProcessResponse GetCrossMatchProcess(Guid matchId, int matchType)
        {
            var baseData = MemcachedFactory.MatchClient.Get <BaseMatchData>(matchId);

            if (baseData != null)
            {
                if (baseData.ErrorCode != (int)MessageCode.Success)
                {
                    return(ResponseHelper.Create <MatchProcessResponse>(baseData.ErrorCode));
                }
            }
            var process = MemcachedFactory.MatchProcessClient.Get <byte[]>(matchId);

            if (null == process)
            {
                var dateChar = ShareUtil.GetDateFromComb(matchId);
                var match    = MatchprocessMgr.GetByMatchId(dateChar, matchType, matchId);
                if (null != match)
                {
                    process = match.Process;
                }
            }
            if (null == process)
            {
                return(ResponseHelper.Create <MatchProcessResponse>(MessageCode.MatchMiss));
            }
            var response = ResponseHelper.CreateSuccess <MatchProcessResponse>();

            response.Data = process;
            return(response);
        }
Exemplo n.º 2
0
        MatchprocessEntity GetProcess(Guid matchId, int matchType)
        {
            string dateChar = "";

            dateChar = ShareUtil.GetDateFromComb(matchId);

            //return MatchprocessMgr.GetByMatchId("20140402", (int)EnumMatchType.Tour, new Guid("D2184144-8A13-45D2-BC50-A30D000567AC"));
            return(MatchprocessMgr.GetByMatchId(dateChar, matchType, matchId));
        }