Apple Game Center 沙盒:玩家邀请有效,但不能自动匹配

发布于 2024-11-01 02:01:30 字数 730 浏览 5 评论 0原文

我已经使用标准匹配界面屏幕在我的 IOS 游戏中实现了多人游戏。如果我邀请沙盒中的另一个玩家,一切都会正常:另一个玩家收到推送通知,游戏启动等等......我们可以享受一个很酷的多人游戏会话。

问题是当我尝试使用自动匹配(不邀请特定朋友)时。我在两台设备上启动游戏,启动相同的标准配对界面屏幕,然后在两台设备上单击“立即玩”。 然后我等待 5 分钟,然后 matchmakerViewController 失败并出现错误: “由于与服务器通信错误,无法完成请求的操作”

这是否意味着自动匹配在沙箱中不起作用?

感谢您的帮助!

这是我的代码:

- (IBAction) hostMatch:(id)sender
{   
    GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
    request.minPlayers = 2;
    request.maxPlayers = 2;

    GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
    mmvc.matchmakerDelegate = self;

    [self presentModalViewController:mmvc animated:YES];        
}

I've implemented Multi-player in my IOS game using the standard matchmaking interface screen. Everything works well if I invite another player in the sandbox : the other player receives the push notification, the game is launched etc... and we can enjoy a cool multiplayer session.

The problem is when I try to use auto-match (without inviting a specific friend). I start the game on 2 devices, launch the same standard matchmaking interface screen and click on "play now" on both.
Then I wait for 5 minutes before matchmakerViewController fails with the error:
"The requested operation could not be completed due to an error communicating with the server"

Does it mean auto-match doesn't work in sandbox?

Thank you for your help!

here's my code:

- (IBAction) hostMatch:(id)sender
{   
    GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
    request.minPlayers = 2;
    request.maxPlayers = 2;

    GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
    mmvc.matchmakerDelegate = self;

    [self presentModalViewController:mmvc animated:YES];        
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

活泼老夫 2024-11-08 02:01:30

我已经修复了游戏中心邀请问题。请按照以下步骤操作:-
1- 检查您的推送通知是否已在设置中开启,并且朋友邀请是否已在您的游戏中心帐户设置中开启。
2-现在安装最新版本的水果忍者游戏
3-打开游戏中心并登录,然后将其置于后台
3-打开水果忍者直接进入新游戏=>多人=>游戏中心
4-现在您将看到两个选项(邀请朋友并立即在右上角玩)
5-点击立即游戏按钮,游戏中心将为您找到不受欢迎的游戏。
6-当游戏开始时,你可以在右上角看到你不邀请的朋友的名字。游戏结束后,直接进入后台游戏中心的游戏部分,进入游戏列表中的水果忍者。在这里您将看到最近播放的选项。触摸它。在这里,您将在列表顶部看到一个玩家名称(与您一起玩过的玩家),触摸该名称即可立即向他发送好友请求。
7-如果他接受请求,转到朋友=>(您最近添加的朋友)=>一起玩游戏(水果忍者)=>点击游戏(右上角)
8-现在游戏将打开,你将看到GC页面点击邀请按钮选择最近添加的朋友,然后发送,等待他并准备玩。

现在您的gc id已验证,您可以邀请您的任何朋友并可以玩任何游戏(支持邀请功能)。

I have a fix to the game center invite problem . So follow the steps:-
1- check that your push notifications are on in settings and friend invites are on in your game center account setting.
2-now install the latest version of fruit ninja game
3-open game center and sign in, then put it in background
3-open fruit ninja directly goto new game=>multiplayer=>gamecenter
4-now you will see two options ( invite friend & play now at the top right corner)
5-hit the play now button, so the game center will find the uninvited game for you.
6- when the game starts and you are able to see your uninvited friend name at the top right corner. After the game finishes, go directly to game center in the background and in your games section and go into fruit ninja in game list. Here you will see the recently played option. Touch it. Here you will see at the top of the list a player name ( whom you played with ) touch the name and send him friend request immediately.
7-if he accepts request goto friends=>(your recently added friend)=>gameplayed together(frut ninja)=>hit play(at upper right)
8-now the game will open up and u will see the GC page hit the invite button choose the recently added friend, and then send , waiting for him and ready to play.

Now your gc id have verified and you can invite any of your friends and can play any game (which supports invite feature).

心清如水 2024-11-08 02:01:30

在没有看到代码的情况下不确定您的问题可能是什么,但自动匹配肯定可以在沙箱上工作。对我来说,以下方法可以解决问题:

GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = 2;
request.maxPlayers = 4;
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[self presentModalViewController:mmvc animated:YES];

Not sure what your problem might be without seeing the code, but auto-match definitely works on sandbox. For me the following does the trick:

GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = 2;
request.maxPlayers = 4;
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[self presentModalViewController:mmvc animated:YES];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文