Пример #1
0
 public void StartClient()
 {
     client.Connect(networkAddress, networkPort);
     clientID = 0;
     insightNetworkConnection = new InsightNetworkConnection();
     insightNetworkConnection.Initialize(this, networkAddress, clientID, connectionID);
     OnClientStart();
 }
Пример #2
0
        void HandleConnect(Message msg)
        {
            // get ip address from connection
            string address = GetConnectionInfo(msg.connectionId);

            // add player info
            InsightNetworkConnection conn = new InsightNetworkConnection();

            conn.Initialize(this, address, serverHostId, msg.connectionId);
            AddConnection(conn);

            OnConnected(conn);
        }
Пример #3
0
        void HandleConnect(int connectionId)
        {
            logger.Log("[InsightServer] - Client connected connectionID: " + connectionId, this);

            // get ip address from connection
            string address = GetConnectionInfo(connectionId);

            // add player info
            InsightNetworkConnection conn = new InsightNetworkConnection();

            conn.Initialize(this, address, serverHostId, connectionId);
            AddConnection(conn);
        }
Пример #4
0
        public virtual void Start()
        {
            Application.runInBackground = true;

            clientID = 0;
            insightNetworkConnection = new InsightNetworkConnection();
            insightNetworkConnection.Initialize(this, networkAddress, clientID, connectionID);
            insightNetworkConnection.SetHandlers(messageHandlers);

            transport.OnClientConnected    = OnConnected;
            transport.OnClientDataReceived = HandleBytes;
            transport.OnClientDisconnected = OnDisconnected;
            transport.OnClientError        = OnError;

            if (AutoStart)
            {
                StartInsight();
            }
        }
Пример #5
0
        public virtual void Start()
        {
            if (DontDestroy)
            {
                DontDestroyOnLoad(this);
            }

            Application.runInBackground = true;

            if (AutoStart)
            {
                StartInsight();
            }

            clientID = 0;
            insightNetworkConnection = new InsightNetworkConnection();
            insightNetworkConnection.Initialize(this, networkAddress, clientID, connectionID);
            insightNetworkConnection.SetHandlers(messageHandlers);

            transport.OnClientConnected.AddListener(OnConnected);
            transport.OnClientDataReceived.AddListener(HandleBytes);
            transport.OnClientDisconnected.AddListener(OnDisconnected);
            transport.OnClientError.AddListener(OnError);
        }