Пример #1
0
    public void OnLoginAckPlayerServerId(byte[] pBuf)
    {
        GameProto.LoginAckPlayerServerId oRet = GameProto.LoginAckPlayerServerId.Parser.ParseFrom(pBuf);
        if (oRet == null)
        {
            H5Helper.H5LogStr("OnLoginAckPlayerServerId error parse");
            return;
        }

        string  szUrl = GameInstance.Instance().proUrlHost + GameInstance.Instance().proGetRoleUri;
        WWWForm form  = new WWWForm();

        form.AddField("platform", GameInstance.Instance().proPlatform);
        form.AddField("name", GameInstance.Instance().proName);
        form.AddField("head_img", GameInstance.Instance().proHeadImage);
        form.AddField("sex", GameInstance.Instance().proSex.ToString());
        form.AddField("access_token", GameInstance.Instance().proAccessToken);
        form.AddField("expires_date", GameInstance.Instance().proExpiresDate.ToString());
        form.AddField("openid", GameInstance.Instance().proOpenId);
        form.AddField("server_id", oRet.DwServerId.ToString());

        StartCoroutine(H5Helper.SendPost(szUrl, form, OnRoleData));
    }