0
我在objective-c
中創建了一個遊戲應用程序,它使用Google Play Game services
作爲realtime
Multiplayer
功能。在應用程序中,用戶必須在開始遊戲之前下注一些硬幣,並且我們希望連接的用戶必須爲相同數字的硬幣下注。 我遵循文檔https://developers.google.com/games/services/ios/realtimeMultiplayer。該應用程序在尋找實時玩家時沒有特殊角色,例如具有不同硬幣的玩家。谷歌玩具有不同角色的實時多人遊戲
- (void)createQuickStartRoom {
GPGMultiplayerConfig *config = [[GPGMultiplayerConfig alloc] init];
// Could also include variants or exclusive bitmasks here
config.minAutoMatchingPlayers = totalPlayers - 1;
config.maxAutoMatchingPlayers = totalPlayers - 1;
// Show waiting room UI
[[GPGLauncherController sharedInstance] presentRealTimeWaitingRoomWithConfig:config];
}
但是我想搜索具有相同角色的玩家,就像每個玩家在我的應用中花費相同數量的硬幣一樣。
static uint64_t const ROLE_COIN_10 = 0x1; // 001 in binary
static uint64_t const ROLE_COIN_20 = 0x2; // 010 in binary
static uint64_t const ROLE_COIN_50 = 0x4; // 100 in binary
- (void)createQuickStartRoomWithRole:(uint64_t)role {
GPGMultiplayerConfig *config = [[GPGMultiplayerConfig alloc] init];
// auto-match with two random auto-match opponents of different roles
config.minAutoMatchingPlayers = 2;
config.maxAutoMatchingPlayers = 2;
config.exclusiveBitMask = role;
// create room, etc.
// …
}
但是沒有找到所需的玩傢俱有相同的角色。它仍然提供具有不同角色的RealTime Player。 請讓我知道,如何實現這個功能。 謝謝。
嗨克萊頓,謝謝。它的工作非常完美。你救了我的一天:)。 –
你能幫我在這個http://stackoverflow.com/questions/42427673/invite-friend-in-google-play-services –