Exemplo n.º 1
0
        private void InitializeClientBackend()
        {
            if (Client == null)
            {
                Debug.LogWarning("Ignorance Client: Backend instance reference was null. This shouldn't happen, but to be safe we'll reinitialize it.");
                Client = new IgnoranceClient();
            }

            // Sets address, port, channels to expect, verbosity, the server poll time and maximum packet size.
            Client.ConnectAddress    = cachedConnectionAddress;
            Client.ConnectPort       = port;
            Client.ExpectedChannels  = Channels.Length;
            Client.PollTime          = clientMaxNativeWaitTime;
            Client.MaximumPacketSize = MaxAllowedPacketSize;
            Client.Verbosity         = (int)LogType;

            Client.IncomingOutgoingBufferSize = ClientDataBufferSize;
            Client.ConnectionEventBufferSize  = ClientConnEventBufferSize;

            // Initializes the packet buffer. Allocates once, that's it.
            if (InternalPacketBuffer == null)
            {
                InternalPacketBuffer = new byte[PacketBufferCapacity];
            }
        }
Exemplo n.º 2
0
        private void InitializeClientBackend()
        {
            if (Client == null)
            {
                Debug.LogWarning("Ignorance: IgnoranceClient reference for Client mode was null. This shouldn't happen, but to be safe we'll reinitialize it.");
                Client = new IgnoranceClient();
            }

            Client.ConnectAddress    = cachedConnectionAddress;
            Client.ConnectPort       = port;
            Client.ExpectedChannels  = Channels.Length;
            Client.PollTime          = clientMaxNativeWaitTime;
            Client.MaximumPacketSize = MaxAllowedPacketSize;
            Client.Verbosity         = (int)LogType;

            // Initializes the packet buffer.
            if (InternalPacketBuffer == null)
            {
                InternalPacketBuffer = new byte[PacketBufferCapacity];
            }
        }