In our multiplayer mobile game we want to use player names from Game Center. Those player names will be shown in public leaderboards, so we want to ensure on our server that Game Center player name is actually belongs to that specific user.
I have found the way to verify player login to Game Center Setting up third-party server to interact with Game Center. After verifying Game Center login I have verified playerID.
Is there any way to get player name by this PlayerID from Apple?
Or how can I verify player name I get from client belongs to that user?
P.S. Our server is written in Java so any Java code examples would be appreciated.
Related
The documentation for GKPlayer mentions a method for creating "guest players":
The concept of guest players is introduced in iOS 9. Guest players are
treated exactly like authenticated players for Game Center multiplayer
purposes. However, guest players cannot earn achievements, post to
leaderboards, or participate in challenges. Create a guest player with
the anonymousGuestPlayer(withIdentifier:) method.
But the same documentation says there must be an authenticated player before using GameKit. And indeed, pretty much everything GameKit fails if you aren't logged into Game Center.
So what is the purpose of "guest players" and how would you use them?
its like : lets say your friend wants to play a game(that you also play) using your device. In that case your friend can directly play the game without effecting your scores and achievements if he plays as a guest. Its like a temporary way to play a game from someone else GameCenter account but without affecting his/her scores and achievements
Apple's Game Center has really gone down the toilet recently so I'm adding support for Google Play Games leaderboards and achievements to my iOS games. I'm displaying the leaderboards myself by downloading the scores using the GPGLeaderboard class. There's a property called "social" that lets me download the scores of friends - "A social leaderboard is a public leaderboard filtered by people within the local player's circles." Is there an API that will let me invite other players to my game so I can see them in these social leaderboards? I'm not sure how people are supposed to set up these social circles?
Check this documentation: Starting a real-time multiplayer game.
Invite players button. Lets the user invite friends to join a game session or specify some number of random opponents for auto-matching. When the player selects this option, your app should display either the built-in player selection user interface (UI) provided by the SDK or a custom UI for player selection.
You might also want to check on this GPGLeaderboard Class Reference wherein leaderboard objects must be created with a leaderboard ID. Once a leaderboard object is created, you may interact with it using the provided set of actions.
I am working on a game. It will use Game Center for multiplayer. I would like to be able to use CloudKit for storing levels and the local CloudKit container for storing game progress. The problem is that this requires to different accounts. Any ideas on how to link them together?
I struggled with this recently when building in syncing to my game Qiktionary. At first I associated single player game data with the currently logged in Game Center player. So when I started working on sync, I was associating the single player game data in CloudKit with the Game Center player by using a separate CKRecordZone (in the private db) for each Game Center player.
I ended up abandoning that approach because it turns out that causes some behaviour that looks to the user like data loss. For example, GC Player A is logged into your game and plays 10 single player games (or in your case, levels). Later they happen to log out of Game Center, and even later than that they come back to your game and since they are logged out, they no longer see their 10 games played. It's not obvious that the game data is there but just "missing" because they are now logged out of GC.
I did some research and most other games don't work like that. Single player game progress is not linked to the logged in Game Center player. Which means that the single player game data in CloudKit shouldn't be linked to the Game Center player either.
This is even how the GKSavedGame API from GameKit works. According to the docs:
Saved games are tied to the iCloud account, not the Game Center account
I am trying to create a turn based game using Game Center. I wanted to know if it is possible to allow the players in the match to chat between each other (either voice or text).
I have looked into it a little and seems that it is possible via the normal game but not a turn based one.
If it is not possible what are the solution or ways to allow this type chat?
Yes, you can have text chat the following way:
Without ending the turn, update the matchData object on the GKTurnBasedMatch. The updated NSData will be provided to all players that open your app and are participants in the game. So, your matchData object would have to carry both the game state and the chat state. Unfortunately, I do not see how one could trigger user notifications or badge the app for new chats without having to end the player's turn each time.
I am pretty sure i know the answer but is it possible to send data using game kit to a player who is not playing the game anymore so next time he loads the game the data will be there. Is there any sort of messaging queue in gamecenter that can hold data
Nope, this is not possible if you let Game Center host the game. But you can set up your own server which stores the data and hands it over to the client while still having Game Centers match making functionality.