首页 > 解决方案 > 我可以在不使用 Photon 身份验证的情况下在 Unity 中创建登录系统吗?

问题描述

我在 Photon for Unity 中创建登录系统时遇到问题,我已经尝试过一切,我运行了整个谷歌并尝试了一切,但我总是有一些错误!在我最后一次尝试中,我在 Unity 控制台上遇到了这个错误:

Operation failed: OperationResponse 230: ReturnCode: 32755 (Custom authentication service error: Error). Parameters: {} Server: NameServer
 UnityEngine.Debug:LogError(Object)
 NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1623)
 ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
 ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
 ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
 PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)

还有这个其他错误:

 Custom Authentication failed (either due to user-input or configuration or AuthParameter string format). Calling: OnCustomAuthenticationFailed()
 UnityEngine.Debug:LogError(Object)
 NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1660)
 ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
 ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
 ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
 PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)

所以我厌倦了使用 Photon Auth,想知道我是否可以在 Unity 内部创建一个登录系统,而不是 Photon,Photon 只会向其他玩家显示玩家的名字,以及其他正常的东西。仅在 Unity 上而不在 Photon 上进行身份验证是否存在问题?

标签: authenticationunity3dloginphoton

解决方案


看看 WWWForm 的统一性,你将不得不做一些服务器端编程来将数据存储在数据库中,但使用 PHP 应该很容易。您必须编写一些 C# 代码来统一解析数据(作为字符串),然后再发布表单并在您取回对象时对数据进行排序。

https://docs.unity3d.com/ScriptReference/WWWForm.html


推荐阅读