Ejemplo n.º 1
0
        /// <summary>
        /// Sets sender and receiver assemblies in NetworkSupport - needed for correct serialization/deserialization
        /// </summary>
        private static void SetAssembliesNames()
        {
            string senderAssembly = NetworkSupport.ReceiveString(stream);

            NetworkSupport.SendString(Assembly.GetExecutingAssembly().GetName().Name, stream);
            NetworkSupport.SetAssemblyNames(senderAssembly, Assembly.GetExecutingAssembly().GetName().Name);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends all objects which are necessary to render scene to client
        /// Assignment - special type of assignment (reset) to indicate (new) start of work
        /// IRayScene - scene representation like solids, textures, lights, camera, ...
        /// IRenderer - renderer itself including IImageFunction; needed for RenderPixel method
        /// Receives number of threads available to render at RenderClient
        /// </summary>
        public void ExchangeNecessaryInfo()
        {
            // Set assemblies - needed for correct serialization/deserialization
            NetworkSupport.SendString(Assembly.GetExecutingAssembly().GetName().Name, stream);
            string targetAssembly = NetworkSupport.ReceiveString(stream);

            NetworkSupport.SetAssemblyNames(Assembly.GetExecutingAssembly().GetName().Name, targetAssembly);

            NetworkSupport.SendObject(new Assignment(Assignment.AssignmentType.Reset), stream);

            NetworkSupport.SendObject(Master.singleton.scenes[0], stream);

            NetworkSupport.SendObject(Master.singleton.renderers[0], stream);

            threadCountAtClient = NetworkSupport.ReceiveInt(stream);
        }