Exemple #1
0
        /// <summary>
        /// Performs write to server stream
        /// </summary>
        /// <param name="data">data to write to server</param>
        public static void WriteToServer(byte[] data)
        {
            if (IsConnected)// && mySocket != null)
            {
                mySocket.Send(data);
            }
            else
            {
                // observable
                FoolObservable.OnSendError();
                UnityEngine.Debug.LogWarning("Can't send data to server: Not connected.");

                FoolNetwork.Reconnect();
            }
        }
 public void OnClick()
 {
     FoolNetwork.JoinRandom();
 }