如何使用Google的应用内结算版本3实施游戏内货币 [英] How to implement in-game currency with Google's In-app Billing Version 3

查看:185
本文介绍了如何使用Google的应用内结算版本3实施游戏内货币的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与标题一样,我应该如何使用Google最新的应用内结算v3来实施货币系统。

Like the title says, how should I implement a currency system with Google's latest in-app billing v3.

基本信息:
我有货币。
此货币是赚取或购买的。

The basics: I have currency. This currency is earned or purchased.

货币定期给予玩家。

货币可以分批购买(1,5,10, 20,50,100)或至少是我想要的。

Currency can be purchased in lots (1,5,10,20,50,100) or atleast that is what I wanted.

Google Play v3强制您在其服务器上存储耗材的所有权详情。

Google Play v3 forces you to store ownership details of consumable items on their servers.

您不能购买相同的商品,直到它首先被消费,根据谷歌从所有权中删除,因此不再在您的游戏中拥有。

You can not purchase the same item over until it is consumed first, removed from ownership according to google, and therefore not possessed in your game any more.

这提出了一些非常痛苦的问题需要解决......如果我理解正确的话。

This presents some really painful problems to resolve... if I am understanding this correctly.

你是否制作了大量重复的商品来处理玩家是否有能力多次购买同一物品?你可以制作跟踪的免费物品吗?

Do you make a ton of "duplicate" store items to handle the players ability to make multiple purchases of the same item should he want to restock? Can you make free items that are tracked?

如果玩家购买100包,使用99.然后卸载并转移到另一台设备怎么办?他将全部100回来。你是如何处理的?

What if the player buys a 100 pack, uses 99. Then uninstalls and moves to another device? He'll get all 100 back. How do you handle that?

那么我应该如何管理所购买的货币?任何人都可以提出任何合适的策略来处理这个问题吗?

So how should I manage purchased currency? Can anyone suggest any decent strategies to handle this?

谢谢,
Gullie

Thanks, Gullie

推荐答案

通过使用inApp Billing api,您无法恢复耗材,这似乎是合乎逻辑的(您无法恢复不存在的东西)。您只能恢复由于 getPurchases()而未消耗的项目。如果您希望能够恢复消耗品,则需要在应用程序中处理该部分,并使用服务器来跟踪谁购买什么以及谁使用什么。

By just using inApp Billing api you can't restore consumable items , which seems logical (you cannot restore something that doesn't exist). You only can restore an item which has not been consumed because of getPurchases(). If you want to be able to restore consummable, you need to handle that part in your app and with a server which gonna track who buy what and who use what.

In事实上你并没有恢复购买,而是购买改变的状态:如果用户购买100金币,当他转移到另一部手机时,他想要取回额外的黄金,而不是购买。

In fact you're not restoring the purchase but the state that the purchase changed : If an user buy 100 golds , when he move to an other phone , he want to get back the extra gold , not the purchase.

每次操作后,您的应用都应将用户状态发送到服务器(货币金额,级别,购买/使用的商品......)并在启动时重新获取所有内容。

After each action your app should send the user status to the server (currency amount , level, item purchased / used ...) and get everything back on startup.

请注意,如果您想防止作弊,您必须确保应用程序和服务器之间的通信安全。

Be aware that you communication between the app and the server must be secured if you want to prevent cheaters.

使用inApp v3,您无法购买另一个项目,直到前一个项目被消耗。因此,如果用户购买100金币,他就会使用99.如果他没有使用它,可以恢复最后一个: http://developer.android.com/google/play/billing/billing_reference.html#getPurchases

With inApp v3 you cannot buy an other item until the previous one has been consumed. So if the user buy 100 gold , he used 99. The last one can be restored if he haven't consumed it : http://developer.android.com/google/play/billing/billing_reference.html#getPurchases

这篇关于如何使用Google的应用内结算版本3实施游戏内货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆