Beispiel #1
0
        /// <summary>
        /// Sends data to all players in the match.
        /// </summary>
        /// <returns>The error code; 0 means successful.</returns>
        /// <param name="data">A byte array representing the data to be sent.</param>
        /// <param name="reliable">Whether to send it using reliable method; using false for this sends it faster but does not guarantee delivery or the order of delivering multiple data packets.</param>
        public int SendDataToAll(byte[] data, bool reliable)
        {
            int code  = 0;
            var error = new NSError();

            if (!gkMatch.SendDataToAllPlayers(NSData.FromByteArray(data),
                                              reliable ? GKMatchSendDataMode.Reliable : GKMatchSendDataMode.Unreliable,
                                              error))
            {
                code = error.Code();
            }

            error = null;
            return(code);
        }
Beispiel #2
0
        /// <summary>
        /// Sends data to all players in the match.
        /// </summary>
        /// <returns>The error code; 0 means successful.</returns>
        /// <param name="data">A byte array representing the data to be sent.</param>
        /// <param name="reliable">Whether to send it using reliable method; using false for this sends it faster but does not guarantee delivery or the order of delivering multiple data packets.</param>
        public int SendDataToAll(byte[] data, bool reliable)
        {
            int code = 0;
            var error = new NSError();

            if (!gkMatch.SendDataToAllPlayers(NSData.FromByteArray(data),
                                                  reliable ? GKMatchSendDataMode.Reliable : GKMatchSendDataMode.Unreliable,
                                                  error)) {
                code = error.Code();
            }

            error = null;
            return code;
        }