Beispiel #1
0
        public async Task <GameState> Handle(Guid tableId, TimeoutCommand command)
        {
            Task <GameState> loadStateTask = _reader.LoadTableState(tableId);

            await loadStateTask;

            GameState currentState = loadStateTask.Result;
            GameState newState     = CommandsHandler.Handle(currentState, command);

            await _writer.WriteGameState(newState);

            return(newState);
        }
Beispiel #2
0
        static void Handle(WorldClient client, string message, ChatActivableChannelsEnum channel)
        {
            if (message.StartsWith(CommandsHandler.CommandsPrefix))
            {
                CommandsHandler.Handle(message, client);
                return;
            }

            var handler = ChatHandlers.FirstOrDefault(x => x.Key == channel);

            if (handler.Value != null)
            {
                handler.Value(client, message);
            }
            else
            {
                client.Character.Reply("Ce chat n'est pas géré");
            }
        }
Beispiel #3
0
        public async Task <ActionResult <string> > Post([FromBody] PlayChampionshipCommand command)
        {
            var result = await _commandsHandler.Handle(command);

            return(Ok(result.ResultData));
        }