コード例 #1
0
        public GameHttpServer([NotNull] string prefix, [NotNull] ArenaState arenaState, [NotNull] SessionManager sessionManager, [NotNull] IDebuggerManager debuggerManager, [NotNull] ITournamentRunner tournamentRunner, [NotNull] string staticContentPath)
        {
            this.arenaState     = arenaState;
            this.sessionManager = sessionManager;
            var baseUri = new Uri(prefix.Replace("*", "localhost").Replace("+", "localhost"));

            DefaultUrl = new Uri(baseUri, string.Format("?godModeSecret={0}", arenaState.GodModeSecret)).AbsoluteUri;
            basePath   = baseUri.AbsolutePath;
            listener   = new HttpListener();
            listener.Prefixes.Add(prefix);
            handlers = new IHttpHandler[]
            {
                new RootHandler(),
                new IndexHandler(arenaState),
                new NavPanelHandler(arenaState),
                new DebuggerStartHandler(debuggerManager),
                new DebuggerStateHandler(debuggerManager),
                new DebuggerStepHandler(debuggerManager),
                new DebuggerStepToEndHandler(debuggerManager),
                new DebuggerRestartHandler(debuggerManager),
                new DebuggerResetHandler(debuggerManager),
                new DebuggerRemoveBreakpointHandler(debuggerManager),
                new DebuggerAddBreakpointHandler(debuggerManager),
                new DebuggerClearBreakpointsHandler(debuggerManager),
                new DebuggerLoadGameHandler(debuggerManager, arenaState),
                new StaticHandler(staticContentPath),
                new ArenaRankingHandler(arenaState),
                new ArenaSubmitHandler(arenaState, tournamentRunner),
                new ArenaPlayerHandler(arenaState),
                new ArenaRemovePlayerHandler(arenaState),
                new ArenaSubmitFormHandler(arenaState),
                new ArenaSetSubmitIsAllowedHandler(arenaState)
            };
            stopEvent = new ManualResetEvent(false);
        }
コード例 #2
0
 public ArenaSubmitHandler([NotNull] ArenaState arenaState, [NotNull] ITournamentRunner tournamentRunner)
     : base("arena/submit")
 {
     this.arenaState       = arenaState;
     this.tournamentRunner = tournamentRunner;
 }