Ejemplo n.º 1
0
        private bool ConnectToSharedMemory()
        {
            try
            {
                memoryStatus = AC_MEMORY_STATUS.CONNECTING;

                // Connect to shared memory
                physicsMMF    = MemoryMappedFile.OpenExisting("Local\\acpmf_physics");
                graphicsMMF   = MemoryMappedFile.OpenExisting("Local\\acpmf_graphics");
                staticInfoMMF = MemoryMappedFile.OpenExisting("Local\\acpmf_static");
                carsInfoMMF   = MemoryMappedFile.OpenExisting("Local\\acpmf_cars");

                physics    = ReadPhysics();
                graphics   = ReadGraphics();
                staticInfo = ReadStaticInfo();
                cars       = ReadCars();

                memoryStatus = AC_MEMORY_STATUS.CONNECTED;

                return(true);
            }
            catch (FileNotFoundException)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public StaticInfoEventArgs(StaticInfo staticInfo)
 {
     this.StaticInfo = staticInfo;
 }