Comments (2)
I didn't have the need for this and the usefulness in practice is a bit limited because not all users on a platform will use a game service. So you'll need a fallback mechanism anyway, and if you have it, you can use that one in any case.
But if it is important for you, I am open and accepting PRs.
from gdx-gamesvcs.
Edit: I missed the part of your comment where you already solved your issue :). Carry on 👍
One quick way around this is to extend the GpgsClient and directly access the Google Api Client:
public class CustomGpgsClient extends GpgsClient {
public GoogleApiClient getGoogleApiClient() {
return mGoogleApiClient;
}
}
Then elsewhere in your code (Mine below is in the listener) you can access the Player object manually via the google api client:
@Override
public void gsOnSessionActive() {
LOGGER.info("Player: {}",gamesClient.getPlayerDisplayName());
LOGGER.info("serviceid: {}",gamesClient.getGameServiceId());
//get google player object
Player gpgPlayer = Games.Players.getCurrentPlayer(gamesClient.getGoogleApiClient());
//access google specific props
LOGGER.info("details: {}",gpgPlayer.getPlayerId());
LOGGER.info("details: {}",gpgPlayer.getName());
LOGGER.info("details: {}",gpgPlayer.getBannerImageLandscapeUri());
LOGGER.info("details: {}",gpgPlayer.getBannerImagePortraitUri());
LOGGER.info("details: {}",gpgPlayer.getIconImageUri());
}
Obviously this is specific to the google api, so you'll have to handle skipping it if youre using multiple, or coming up with your own interface for it.
from gdx-gamesvcs.
Related Issues (20)
- App Missing Runtime Dependencies HOT 6
- GPGS Desktop: SEVERE: unable to refresh token, Help? HOT 3
- GPGS Android: Cloud Save - Gamestate Not Null? HOT 1
- GPGS Android: Disconnect from service while saving leads to crash HOT 1
- Project doesn't build with gpg on android with build tools 28 / gradle 4.6 HOT 18
- GPGS Real-time Multiplayer support HOT 1
- GameCenter Cloud save error 27 HOT 14
- Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'fewZBzlAIBvWOuukVqyWKzOi' HOT 1
- GPGS Android: UserRecoverableAuthException: NeedPermission HOT 11
- Google Play Games no achievement popup HOT 10
- Cannot log in Google Play Services when cloud save enabled HOT 7
- Runtime error java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap; HOT 2
- GameCenter: UnsupportedOperationException on loadGameState() HOT 1
- wiki update HOT 2
- android-gpgs: GpgsClient using deprecated Google APIs HOT 1
- Documentation has incorrect version label HOT 1
- ERROR while show leaderboards HOT 5
- Crash on first start after deleting data HOT 1
- Vulnerability warning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdx-gamesvcs.