Exemple #1
0
    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);
            }
        }
    }
Exemple #2
0
    private IEnumerator BroadcastIpCo()
    {
        yield return(new WaitForSeconds(0.1f));

        while (true)
        {
            socketer.SendNetworkMessage(udpMessage);
            yield return(broadcastWait);
        }
    }
Exemple #3
0
 public void SendMessageToServer(byte[] message)
 {
     socketerClient.SendNetworkMessage(message);
 }