Esempio 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);
            }
        }
Esempio n. 2
0
 public StaticInfoEventArgs(StaticInfo staticInfo)
 {
     this.StaticInfo = staticInfo;
 }