Example #1
0
        public override Object ReadGameData(Boolean forSpotter)
        {
            F12018StructWrapper latestData = workingData.CreateCopy(DateTime.UtcNow.Ticks, forSpotter);

            lock (this)
            {
                if (!initialised)
                {
                    if (!InitialiseInternal())
                    {
                        throw new GameDataReadException("Failed to initialise UDP client");
                    }
                }
                if (forSpotter)
                {
                    newSpotterData = false;
                }
            }
            if (!forSpotter && dumpToFile && dataToDump != null && workingData != null /* && latestData has some sane data?*/)
            {
                dataToDump.Add(latestData);
            }
            return(latestData);
        }