Ejemplo n.º 1
0
        /// <summary>
        /// Give coins to friends who were hired in this show.
        /// These coins are stored in the db in the escrow table until the friend logs in next time.
        /// </summary>
        /// <param name="serverAccount"></param>
        /// <param name="coins"></param>
        public static void GiveFashionMinigameHiredFriendsCoins(ServerAccount serverAccount, int coins)
        {
            if (coins <= 0)
            {
                // No coins to give, done.
                return;
            }

            FashionMinigameServiceAPI.GetAllHiredFriends(serverAccount, delegate(ICollection <long> friendList)
            {
                EscrowManagerServiceAPI.CreateEscrowTransaction(friendList, serverAccount.FacebookAccountId, EscrowType.FashionCityJobCoins.ToString(), coins, VerifyGiveCoinSuccess);
            });
        }
Ejemplo n.º 2
0
        private void ProcessEscrowTransaction(Message receivedMessage, Guid sessionId)
        {
            EscrowType escrowType = CheckType.TryAssignType <EscrowType>(receivedMessage.Data[0]);

            ServerAccount serverAccount = mServerStateMachine.SessionManager.GetServerAccountFromSessionId(sessionId);

            EscrowManagerServiceAPI.GetEscrowTransactions(serverAccount.FacebookAccountId, 0, escrowType, "", true,
                                                          delegate(XmlDocument responseXml)
            {
                switch (escrowType)
                {
                case EscrowType.FashionCityJobCoins:
                    AwardMinigameCoins(serverAccount, responseXml, EscrowType.FashionCityJobCoins, sessionId);
                    break;

                default:
                    //TODO: log here about invalid callbacks
                    break;
                }
            });
        }