Example #1
0
    public void OnPeerConnected(NetPeer peer)
    {
        Debug.Log("[SERVER] We have new peer " + peer.EndPoint);
        _ourPeer = peer;
        NetDataWriter writer = new NetDataWriter();                 // Create writer class
        //send video resolution
        Vector2 size = VideoCapture.GetImageSize();

        writer.Put(string.Format("{0};{1}", size.x, size.y));
        peer.Send(writer, SendOptions.ReliableOrdered);             // Send with reliability
    }