private void Application_logMessageReceived(string message, string stackTrace, LogType type) { if (socketerServer) { byte[] messageBytes = System.Text.Encoding.UTF8.GetBytes(message); byte[] messageBuffer = new byte[messageBytes.Length + 4]; messageBuffer[0] = (byte)'C'; messageBuffer[1] = (byte)'O'; messageBuffer[2] = (byte)'N'; messageBuffer[3] = (byte)type; Array.Copy(messageBytes, 0, messageBuffer, 4, messageBytes.Length); foreach (int connectionId in connections.Keys) { socketerServer.SendNetworkMessage(messageBuffer, connectionId); } } }
private IEnumerator BroadcastIpCo() { yield return(new WaitForSeconds(0.1f)); while (true) { socketer.SendNetworkMessage(udpMessage); yield return(broadcastWait); } }
public void SendMessageToServer(byte[] message) { socketerClient.SendNetworkMessage(message); }