PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
MIT License
275 stars 52 forks source link

Plugin intergration #57

Closed Bruesr closed 2 years ago

Bruesr commented 2 years ago

Dear all,

I have just started working with the plugin and I am struggling a bit with the integration. I have three questions about this. After initializing the EOSmanager i need to log in the user either through Persistent login or with another method. Is it safe to assume that we should always try and log in the user with persistent login first and if that fails continue with another method? Secondly, how do i get the avatar of a user. This if for both the local user and a friend? Finally, i want to change the language of the game when I boot up the game. I have set up my supported languages inside the dev portal, however im not sure how to get the list of supported languages or the current language of the epic games launcher. How can this be done?

andrew-hirata-playeveryware commented 2 years ago

Hello and sorry for the long wait in replying!

Yes, that's the general pattern. i.e. if persistent login works, that means the user has logged in with that before and it is reasonable that the user would expect that flow. However, if you're integrating with something like the Epic Game Store, I believe they pass along credentials that you can use the login with as well. Those can be grabbed via environment variables, or via the EOSManager.GetCommandLineArgsFromEpicLauncher method, which will return a struct with known env variables that the launcer passes.

I don't know of a way to actually grab any associated Icon or avatar with the EOS SDK. From looking though the API for the EOS SDK that the plugin is built upon, I don't see any methods for doing so either.

Concerning getting the current language for the epic games launcher, you should be able to fetch the preferred language for the User via the Epic.OnlineServices.UserInfo.UserInfoData struct. There is an example of how to do this in PlayEveryWare.EpicOnlineServices.Samples.EOSAchievementManager.QueryUserInformation .