简体   繁体   English

有一些方法可以防止 Playfab 上的多设备登录吗?

[英]There is some method for prevent multi-device login on Playfab?

Are there some method to prevent multi-device login using Playfab?是否有一些方法可以防止使用 Playfab 进行多设备登录?

I have a card game with Playfab authentication.我有一个带有 Playfab 身份验证的纸牌游戏。 I must have a login control for cheaters, I would like to have only one login for each player and for each of their device, if a user login with a new device, the old device must be logged out automatically.我必须有一个作弊者的登录控制,我希望每个玩家和他们的每台设备只有一个登录名,如果用户使用新设备登录,则必须自动注销旧设备。

I try to change the session ticket or entity ticket at runtime in my c# code but I read in another post that Playfab is designed for multi-device login, in fact there isn't any function to change the session or entity ticket. I try to change the session ticket or entity ticket at runtime in my c# code but I read in another post that Playfab is designed for multi-device login, in fact there isn't any function to change the session or entity ticket.

I saw somebody using CloudScript, but I don't know how it works and I don't know if it is heavy to do this.我看到有人在使用 CloudScript,但我不知道它是如何工作的,也不知道这样做是否繁重。

A possible option could be to execute a custom cloudscript function on game startup to save on Player Data the current deviceId.一个可能的选项是在游戏启动时执行自定义 cloudscript function 以将当前设备 ID 保存在玩家数据上。 Every request will have to be validated using this "token", so client will have to pass this kind of information at every call.每个请求都必须使用此“令牌”进行验证,因此客户端必须在每次调用时传递此类信息。

If deviceId matches with the one saved on server, execution continues smoothly, otherwise an error should be passed as response to the client.如果 deviceId 与保存在服务器上的匹配,则继续顺利执行,否则应将错误作为响应传递给客户端。 This error can be used to show a popup on client to inform user for example.例如,此错误可用于在客户端显示弹出窗口以通知用户。

At every login, deviceId is updated on PlayerData.每次登录时,都会在 PlayerData 上更新 deviceId。 In this way, you know it is read on every request, but written only once (on game startup).通过这种方式,您知道每次请求都会读取它,但只写入一次(在游戏启动时)。 Also, only the last logged will be able to get server data.此外,只有最后记录的才能获取服务器数据。 Other devices won't be able to get proper responses from server until the app is rebooted.在重新启动应用程序之前,其他设备将无法从服务器获得正确的响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM