Example #1
0
        public IActionResult ReportBattlePhase(
            [FromBody] ReportBattlePhase.Request req, [FromServices] GeneralManager gm)
        {
            gm.EnqueueJob(() =>
            {
                gm.MatchManager.RecieveBattlePhaseReport(req.battleServerSessionId, req.phase);
            });

            var res = new ReportBattlePhase.Response();

            return(Ok(res));
        }
        public async Task <IActionResult> ReportBattlePhase([FromBody] ReportBattlePhase.Request req)
        {
            foreach (Battle.Phase phase in Enum.GetValues(typeof(Battle.Phase)))
            {
                var str = Enum.GetName(typeof(Battle.Phase), phase);
                if (str == req.phase)
                {
                    var requester = new evomatching.ProtocolModels.Matching.ReportBattlePhase();
                    requester.request.battleServerSessionId = SelfHost.sessionId;
                    requester.request.phase = phase;
                    var response = await requester.PostAsync(MatchingServerInfo.AreaUri(SelfHost.matchingArea));

                    var res = new ReportBattlePhase.Response();
                    return(Ok(res));
                }
            }

            return(BuildErrorResponse(Error.LowCode.BadParameter));
        }