Пример #1
0
        public CmdCheatSendFBGift(string[] serialized)
        {
            this.m_inboxCmd = null;
            foreach (KeyValuePair <string, FbPlatformUser> pair in Service.Binder.FacebookAdapter.Friends)
            {
                UnityEngine.Debug.Log(string.Format("Friend id: {0} username: {1} imageUrl: {2}", pair.Key, pair.Value.userName, pair.Value.ImageUrl));
            }
            string targetPlayerFBid = !(serialized[0] != "D") ? GameLogic.Binder.GameState.Player.SocialData.FacebookId : serialized[0];
            string id = !(serialized[1] != "D") ? "PetBoxSmall" : serialized[1];

            if (ConfigShops.GetShopEntry(id) == null)
            {
                UnityEngine.Debug.LogError("Invalid shop entry id");
            }
            else
            {
                string facebookId = GameLogic.Binder.GameState.Player.SocialData.FacebookId;
                if (facebookId == null)
                {
                    UnityEngine.Debug.LogError("Cannot send facebook gift when not logged into Facebook");
                }
                else
                {
                    this.m_inboxCmd = SocialGift.CreateFacebookGiftCommand(facebookId, targetPlayerFBid, "PetBoxSmall");
                }
            }
        }
Пример #2
0
 public void onSendButtonClicked()
 {
     if (this.SendGiftButton.ActiveType == CellButtonType.Unlock)
     {
         string facebookId = GameLogic.Binder.GameState.Player.SocialData.FacebookId;
         if (this.FbUser.id == null)
         {
         }
         SocialInboxCommand inboxCommand = SocialGift.CreateFacebookGiftCommand(facebookId, facebookId, "PetBoxSmall");
         Service.Binder.PlayerService.SendSocialInboxCommand(inboxCommand);
         this.SendGiftButton.setCellButtonStyle(CellButtonType.UnlockLocked, "SENT");
     }
 }
Пример #3
0
        public static SocialInboxCommand CreateFacebookGiftCommand(string senderFBid, string targetPlayerFBid, [Optional, DefaultParameterValue("PetBoxSmall")] string giftId)
        {
            SocialInboxCommand command2 = new SocialInboxCommand();

            command2.socialPlatform = PlatformConnectType.Facebook;
            command2.targetSocialid = targetPlayerFBid;
            command2.CommandId      = InboxCommandIdType.GiftShopProduct;
            InboxCommandParameterType type = new InboxCommandParameterType();

            type.Add("shopEntryId", giftId);
            type.Add("rewardSource", RewardSourceType.FacebookFriend.ToString());
            type.Add("senderFBid", senderFBid);
            command2.Parameters = type;
            return(command2);
        }
Пример #4
0
 public CmdCheatSendFBGift(SocialInboxCommand command)
 {
     this.m_inboxCmd = command;
 }