开发者

GKSession sendDataToAllPeers on client?

开发者 https://www.devze.com 2023-02-19 05:37 出处:网络
My current sessionMode is GKSessionModeServer. If I\'m on a 开发者_运维问答client and I do the following:

My current sessionMode is GKSessionModeServer. If I'm on a 开发者_运维问答client and I do the following:

[mySession sendDataToAllPeers:packet withDataMode:GKSendDataReliable error:nil];

Will that send data to every peer in the server or just to the server itself. Sorry for asking a simple question, but I only have 2 devices to test with.


Great question!

Yes, it will send the data to ALL the thingies connected to that server.

BTW if you're just getting started with networking, you may find this useful...

Most effective way to do networking on Mac/iPhone?

And here is an absolutely critical tip regarding gamekit:

Critical tip: Client/Server GKSessions

You have done the right thing by using GKSessionModeServer.

0

精彩评论

暂无评论...
验证码 换一张
取 消