Пример #1
0
        public void OnPeerConnected(NetPeer peer)
        {
            LiteNetConnection  network     = new LiteNetConnection(peer);
            RailNetPeerWrapper persistence = new RailNetPeerWrapper(network);
            ConnectionServer   con         = new ConnectionServer(network, persistence, m_WorldData);

            con.PrepareForClientConnection();
            peer.Tag = con;
            m_Server.Connected(con);
        }
        public void OnPeerConnected(NetPeer peer)
        {
            LiteNetConnection  network     = new LiteNetConnection(peer);
            RailNetPeerWrapper persistence = new RailNetPeerWrapper(network);
            ConnectionClient   connection  = new ConnectionClient(
                network,
                persistence,
                m_Session.World);

            m_Session.ConnectionCreated(connection);
            peer.Tag = connection;
        }