在 Android 上获取 OpenFeint 玩家 ID

发布于 2024-12-09 11:15:05 字数 340 浏览 7 评论 0原文

我已将 OpenFeint 集成到我的 Android 游戏中,我想知道需要添加什么才能获取 OpenFeint 玩家 ID。我想要 ID 或用户名,以便允许用户在设备之间转移他们的游戏帐户,并使用 OpenFeint 进行身份验证。

这是我使用 OpenFeint 的代码:

OpenFeintSettings ofsettings = new OpenFeintSettings(gameName, gameKey, gameSecret, gameID);
OpenFeint.initialize(this, ofsettings, new OpenFeintDelegate() {});

I've integrated OpenFeint into my Android game, and I'm wondering what i need to add in order to get the OpenFeint player id. I want the id or the username so I can allow users to transfer their game accounts between devices, authenticating with OpenFeint.

Here's my code for using OpenFeint:

OpenFeintSettings ofsettings = new OpenFeintSettings(gameName, gameKey, gameSecret, gameID);
OpenFeint.initialize(this, ofsettings, new OpenFeintDelegate() {});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泛泛之交 2024-12-16 11:15:05

@Andy嗨,当我在我开发的游戏中实现openFeint时,我还需要玩家ID

,我使用了以下代码

    import com.openfeint.api.OpenFeint;  
        import com.openfeint.api.resource.User;
        import android.app.Activity;
        import android.os.Bundle;

  public class ABC extends Activity {


     User u;
        String Name;



    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.score);



         u = OpenFeint.getCurrentUser();

    // user id received 

        Name = u.name;

    System.out.println("** The User  id is **   "  + Name  );

}
}

@Andy hi i also needed the player id when i implemented openFeint in the game i developed

I used the following code

    import com.openfeint.api.OpenFeint;  
        import com.openfeint.api.resource.User;
        import android.app.Activity;
        import android.os.Bundle;

  public class ABC extends Activity {


     User u;
        String Name;



    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.score);



         u = OpenFeint.getCurrentUser();

    // user id received 

        Name = u.name;

    System.out.println("** The User  id is **   "  + Name  );

}
}
只是一片海 2024-12-16 11:15:05

如果您不是 100% 购买 OpenFeint,请查看 Swarm,它提供了一组类似的功能(排行榜、成就、云数据保存等)。 Swarm 的云数据将完全满足您的需求,并允许您将数据保存到用户的帐户,因此无论他们使用什么设备,他们都可以使用所有数据:)

If you're not 100% sold on OpenFeint, check out Swarm, which provides a similar set of features (leaderboards, achievements, cloud data save, etc). Swarm's Cloud Data would do exactly what you're looking for, and allow you to save data to a user's account, so no matter what device they're on, they have all of their data available :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文