gamekit

iPhone p2p - Is there a way to connect to more than 1 devices?

和自甴很熟 提交于 2019-11-30 00:45:08
Is it possible to connect to more than 1 devices using the new GameKit framework? Till now all the examples I've seen show how we can connect to 1 device. Even the default connection interface lets the user select just one connect. Thanks. There's a fairly good overview here at the following link of how to configure and use GameKit for your App. GameKit Programming Guide: Peer-to-Peer Connectivity Unfortunately, you will not be able to use the GKPeerPickerController standard UI picker to configure the GKSession instance for you if you want to support more than 2 devices. Instead, you must

Is there a way to delete scores in Apple's Game Center programmatically?

空扰寡人 提交于 2019-11-29 18:15:58
问题 I did not find a way in the GameKit documentation to delete a player's score from within my app. Is this possible? 回答1: Happily, Apple responded to the fake score problem and now there's a more convenient and efficient solution for managing fake scores compared to sending an e-mail: Apple Announcement from October 28th, 2013: Manage Game Center Leaderboard Scores You can now view and manage the top 100 scores and usernames for all of your Game Center leaderboards. Protect your legitimate

How do I get notifications for GameKit Turn-Based matches?

我只是一个虾纸丫 提交于 2019-11-29 13:42:54
问题 I'm working on a turn based iOS game using the new turn-based iOS5 API. One of the delegate protocols you need to implement for this is GKTurnBasedEventHandlerDelegate. One of the methods to implement is handleTurnEventForMatch. This is from the Apple docs on this method: handleTurnEventForMatch Sent to the delegate when it is the local player’s turn to act in a turn-based match. - (void)handleTurnEventForMatch:(GKTurnBasedMatch *)match Parameters match - A match object containing the current

GameKit keeping connection going while device screen off or in background

蓝咒 提交于 2019-11-29 12:43:49
I am working on an appliction that requires bluetooth connectivity, which i use GameKit for data transfer, however im seeing that when i go in background mode, or I just turn off the screen in app, the bluetooth connection is dropped... Ive seen other apps that keep the connection alive in such situations, anyone have any idea if I am missing something that wont cause the connection to drop on such cases? Have been looking around but havent found anything useful... Thanks Daniel This is not intentionally supported by Apple. If you are writing this for an application that doesn't have to be

GameKit Bluetooth Transfer Problem

这一生的挚爱 提交于 2019-11-28 23:30:14
问题 I am trying to send a file via Bluetooth using the GameKit framework. The problem I am having though is that I can only send one NSData object at a time, but I need to save it on the other end. this obviously isn't possible without knowing the filename, but i don't know how to transmit that. I've tried to convert it to a string NSData*data = [NSData dataWithContentsOfFile:urlAddress]; but i can only send one NSData object, not two. Has anyone come across this problem yet? 回答1: Working with

Best option for streaming data between iPhones

折月煮酒 提交于 2019-11-28 21:40:59
问题 I would like to setup a client-server architecture for streaming data between multiple iPhones. For instance, the 'server' iPhone hosts a master list of animals. An arbitrary number of client iPhones can connect to the server iPhone then read and edit the list. Some methods I have tried: Multipeer connectivity - Only supports up to 8 clients. Would be exactly what Im looking for if there were a way around this GameKit - Ive read that bluetooth connection can be buggy when dealing with

Encode NSArray or NSDictionary using NSCoder

断了今生、忘了曾经 提交于 2019-11-28 08:19:52
I was wondering whether or not it is possible to use the NSCoder method: - (void)encodeObject:(id)objv forKey:(NSString *)key to encode either an instance of NSArray or NSDictionary. If not how do you go about encoding them? I am trying to use NSKeyedArchived / NSKeyedUnarchiver to send data between phones using GameKit. I tried it and cannot seem to retrieve the string I stored in my array. The packet class I made comes through along with the packet type integer, but not the data in the array it seems. Thanks in advance! NSKeyedArchiver/Unarchiver should encode and decode NSArrays and

Using iOS GameKit's “Bluetooth Bonjour” with other platforms

强颜欢笑 提交于 2019-11-28 03:14:48
I'm interested in connecting to iOS-based devices over Bluetooth. I can see that the "Local Network" service is exposed, but I cannot find any extra information about it. Property stored under key 0x0204 looks like a Bonjour key. Which protocol is used? How can one talk to the iOS device using Linux, Mac or one's own embedded device equipped with a Bluetooth chip? Here's SDP data extracted using Bluetooth Explorer under OS X while the iOS device runs Gameloft's Star Battalion. { 0x0000 = uint32(1330188565), 0x0200 = uint32(2), 0x0202 = string(004wD7l1A..0|0|0|ivucic-À'), 0x030a = uint32(0),

iOS Development: How do I auto match players in Game Center?

依然范特西╮ 提交于 2019-11-28 02:04:21
问题 I have a "Play Now" button in my app that allows players to be auto-matched with other random players. Maybe I'm missing this somewhere in the docs, but how do I write the code to auto match players? The Game Center sandbox server has been messed up the last few days, so I'm having a hard time trying different things since I have to guess because the Game Kit docs aren't exactly clear on how to do this. Currently, I have code setup (but untested) to create a match with a friend... NSArray

Send and receive NSData via GameKit

℡╲_俬逩灬. 提交于 2019-11-27 13:22:45
I'm trying to send some NSData over Bluetooth through GameKit . While I've got GameKit set up and are able to send small messages across, I now would like to expand and send across whole files. I've been reading that you have to split large files up into packets before sending them across individually. So I decided to create a struct to make it easier to decode the packets when they're received at the other end: typedef struct { const char *fileName; NSData *contents; int fileType; int packetnumber; int totalpackets; } file_packet; However, for small files (8KB and less) I thought one packet