コード例 #1
0
        public Task SubmitTransaction(string playerId, string command, string args)
        {
            var dto = new TransactionCommandDto {
                PlayerId = playerId, Command = command, Args = args
            };

            return(_scene.RpcVoid("transaction.submit", dto));
        }
コード例 #2
0
        public async Task <T> Map <T>(TransactionCommandDto source) where T : TransactionCommand, new()
        {
            var currency = await currencyRepository.FindAsync(source.CurrencyId);

            var user = await currentUserService.GetCurrentUserAsync();

            var cantorWallet   = cantorWalletRepository.GetCantorWallet();
            var cantorCurrency = cantorWallet.CantorCurrencies
                                 .FindByCurrency(source.CurrencyId);
            var userBoughtCurrency = user.Currencies.FindByCurrency(currency);

            return(new T()
            {
                Currency = currency,
                Amount = source.Amount,
                User = user,
                CantorWallet = cantorWallet,
                CantorCurrency = cantorCurrency,
                UserCurrency = userBoughtCurrency,
            });
        }