Пример #1
0
        /// <summary>
        /// connect host mode
        /// </summary>
        internal static void ConnectLocalServer()
        {
            if (LogFilter.Debug)
            {
                Debug.Log("Client Connect Local Server");
            }

            RegisterSystemHandlers(true);

            connectState = ConnectState.Connected;

            // create local connection objects and connect them
            ULocalConnectionToServer connectionToServer = new ULocalConnectionToServer();
            ULocalConnectionToClient connectionToClient = new ULocalConnectionToClient();

            connectionToServer.connectionToClient = connectionToClient;
            connectionToClient.connectionToServer = connectionToServer;

            connection = connectionToServer;
            connection.SetHandlers(handlers);

            // create server connection to local client
            NetworkServer.SetLocalConnection(connectionToClient);
            connectionToClient.Send(new ConnectMessage());
        }
Пример #2
0
        internal void ConnectHost(NetworkServer server)
        {
            logger.Log("Client Connect Host to Server");
            connectState = ConnectState.Connected;

            InitializeAuthEvents();

            // create local connection objects and connect them
            (IConnection c1, IConnection c2) = PipeConnection.CreatePipe();

            server.SetLocalConnection(this, c2);
            hostServer = server;
            Connection = new NetworkConnection(c1);
            RegisterHostHandlers(Connection);
            _ = OnConnected();
        }
Пример #3
0
        internal void InternalConnectLocalServer()
        {
            // create local connection to server
            connection = new ULocalConnectionToServer();
            SetHandlers(connection);

            // create server connection to local client
            ULocalConnectionToClient connectionToClient = new ULocalConnectionToClient(this);

            NetworkServer.SetLocalConnection(connectionToClient);

            connectState = ConnectState.Connected;

            active = true;
            RegisterSystemHandlers(true);

            packetQueue.Enqueue(MessagePacker.Pack(new ConnectMessage()));
        }
Пример #4
0
        public static void ConnectHost()
        {
            logger.Log("Client Connect Host to Server");

            RegisterSystemHandlers(true);

            connectState = ConnectState.Connected;

            // create local connection objects and connect them
            ULocalConnectionToServer connectionToServer = new ULocalConnectionToServer();
            ULocalConnectionToClient connectionToClient = new ULocalConnectionToClient();

            connectionToServer.connectionToClient = connectionToClient;
            connectionToClient.connectionToServer = connectionToServer;

            connection = connectionToServer;
            connection.SetHandlers(handlers);

            // create server connection to local client
            NetworkServer.SetLocalConnection(connectionToClient);
        }
Пример #5
0
        // connect host mode
        internal static void ConnectLocalServer()
        {
            if (LogFilter.Debug)
            {
                Debug.Log("Client Connect Local Server");
            }

            RegisterSystemHandlers(true);

            connectState = ConnectState.Connected;

            // create local connection to server
            connection = new ULocalConnectionToServer();
            connection.SetHandlers(handlers);

            // create server connection to local client
            ULocalConnectionToClient connectionToClient = new ULocalConnectionToClient();

            NetworkServer.SetLocalConnection(connectionToClient);

            localClientPacketQueue.Enqueue(new BufferHolder(MessagePacker.PackWriter(new ConnectMessage())));
        }
Пример #6
0
        internal void ConnectHost(NetworkServer server)
        {
            if (LogFilter.Debug)
            {
                Debug.Log("Client Connect Host to Server");
            }

            RegisterSystemHandlers(true);

            connectState = ConnectState.Connected;

            // create local connection objects and connect them
            var connectionToServer = new ULocalConnectionToServer();
            var connectionToClient = new ULocalConnectionToClient();

            connectionToServer.connectionToClient = connectionToClient;
            connectionToClient.connectionToServer = connectionToServer;

            connection = connectionToServer;
            connection.SetHandlers(handlers);

            // create server connection to local client
            server.SetLocalConnection(connectionToClient);
        }