Esempio n. 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");
                }
            }
        }
Esempio n. 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");
     }
 }