コード例 #1
0
    public void InviteFriendToRoom(string title, string desc, string roomInfo)
    {
        Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false;

        if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform())
        {
            return;
        }
        Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D;

        byte[] array = null;
        if (texture2D)
        {
            array = texture2D.EncodeToPNG();
        }
        int thumbDataLen = 0;

        if (array != null)
        {
            thumbDataLen = array.Length;
        }
        IApolloSnsService apolloSnsService = IApollo.Instance.GetService(1) as IApolloSnsService;

        if (apolloSnsService == null)
        {
            return;
        }
        if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ)
        {
            ApolloAccountInfo accountInfo = this.GetAccountInfo(false);
            if (accountInfo != null)
            {
                string url = string.Concat(new string[]
                {
                    "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=",
                    accountInfo.OpenId,
                    "&ADTAG=gameobj.msg_invite&",
                    ApolloHelper.QQ_SHARE_GAMEDATA,
                    "=",
                    roomInfo
                });
                string thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png";
                apolloSnsService.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl);
            }
        }
        else
        {
            apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, thumbDataLen, roomInfo);
        }
    }
コード例 #2
0
ファイル: ApolloHelper.cs プロジェクト: TonyDongGuaPi/joework
    public void ShareToFriend(string title, string desc)
    {
        Singleton <ApolloHelper> .GetInstance().m_bShareQQBox = false;

        if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform())
        {
            return;
        }
        Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D;

        if (texture2D == null)
        {
            return;
        }
        byte[] array = texture2D.EncodeToPNG();
        int    num   = 0;

        if (array != null)
        {
            num = array.Length;
        }
        IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService;

        if (apolloSnsService == null)
        {
            return;
        }
        if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2)
        {
            ApolloAccountInfo accountInfo = this.GetAccountInfo(false);
            if (accountInfo != null)
            {
                string text  = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.get_OpenId() + "&ADTAG=gameobj.msg_invite";
                string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png";
                apolloSnsService.SendToQQ(2, title, desc, text, text2);
            }
        }
        else
        {
            apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, num, "SendToWeixin_extInfo");
        }
    }
コード例 #3
0
ファイル: ApolloHelper.cs プロジェクト: TonyDongGuaPi/joework
    public void ShareRecruitFriend(string title, string desc, string roomInfo)
    {
        if (!MonoSingleton <ShareSys> .GetInstance().IsInstallPlatform())
        {
            return;
        }
        Texture2D texture2D = Resources.Load("Share/120", typeof(Texture2D)) as Texture2D;

        byte[] array = null;
        if (texture2D)
        {
            array = texture2D.EncodeToPNG();
        }
        int num = 0;

        if (array != null)
        {
            num = array.Length;
        }
        IApolloSnsService apolloSnsService = IApollo.get_Instance().GetService(1) as IApolloSnsService;

        if (apolloSnsService == null)
        {
            return;
        }
        if (Singleton <ApolloHelper> .GetInstance().CurPlatform == 2)
        {
            ApolloAccountInfo accountInfo = this.GetAccountInfo(false);
            if (accountInfo != null)
            {
                string text  = "http://youxi.vip.qq.com/m/act/b1068bb755_sgame_104290.html?_wv=1&QQ_SHARE_GAMEDATA=" + roomInfo;
                string text2 = "http://image.smoba.qq.com/yywj/share_pic/120.png";
                apolloSnsService.SendToQQ(2, title, desc, text, text2);
            }
        }
        else
        {
            apolloSnsService.SendToWeixin(title, desc, "MSG_INVITE", array, num, roomInfo);
        }
    }
コード例 #4
0
    public void ShareToFriend(string title, string desc)
    {
        byte[] thumbImgData = (Resources.Load("Share/120", typeof(Texture2D)) as Texture2D).EncodeToPNG();
        int    thumbDataLen = 0;

        if (thumbImgData != null)
        {
            thumbDataLen = thumbImgData.Length;
        }
        IApolloSnsService service = IApollo.Instance.GetService(1) as IApolloSnsService;

        if (Singleton <ApolloHelper> .GetInstance().CurPlatform == ApolloPlatform.QQ)
        {
            ApolloAccountInfo accountInfo   = this.GetAccountInfo(false);
            string            url           = "http://gamecenter.qq.com/gcjump?appid=1104466820&pf=invite&from=androidqq&plat=qq&originuin=" + accountInfo.OpenId + "&ADTAG=gameobj.msg_invite";
            string            thumbImageUrl = "http://image.smoba.qq.com/yywj/share_pic/120.png";
            service.SendToQQ(ApolloShareScene.QSession, title, desc, url, thumbImageUrl);
        }
        else
        {
            service.SendToWeixin(title, desc, "MSG_INVITE", thumbImgData, thumbDataLen, "SendToWeixin_extInfo");
        }
    }