Exemplo n.º 1
0
        public static IEnumerator GetWallet(
            Client client,
            GameSession session,
            string moneyNamespaceName,
            int slot,
            GetWalletEvent onGetWallet,
            ErrorEvent onError
            )
        {
            AsyncResult <EzGetResult> result = null;

            yield return(client.Money.Get(
                             r =>
            {
                result = r;
            },
                             session,
                             moneyNamespaceName,
                             slot
                             ));

            if (result.Error != null)
            {
                onError.Invoke(
                    result.Error
                    );
                yield break;
            }

            var wallet = result.Result.Item;

            onGetWallet.Invoke(wallet);
        }
Exemplo n.º 2
0
        public static IEnumerator Withdraw(
            Client client,
            GameSession session,
            string moneyNamespaceName,
            EzWallet wallet,
            int value,
            bool paidOnly,
            WithdrawEvent onWithdraw,
            GetWalletEvent onGetWallet,
            ErrorEvent onError
            )
        {
            AsyncResult <EzWithdrawResult> result = null;

            yield return(client.Money.Withdraw(
                             r =>
            {
                result = r;
            },
                             session,
                             moneyNamespaceName,
                             wallet.Slot,
                             value,
                             paidOnly
                             ));

            if (result.Error != null)
            {
                onError.Invoke(
                    result.Error
                    );
                yield break;
            }

            wallet = result.Result.Item;

            onWithdraw.Invoke(wallet, value);
            onGetWallet.Invoke(wallet);
        }