Exemple #1
0
        public MissionLogEventInfluenceAreaInfo(MissionLogEventHeader header)
            : base(header)
        {
            var country        = new Country(this.RawParameters.GetInt("COUNTRY"));
            var coalition      = this.Server.CoalitionIndexes.FirstOrDefault(c => c.Country.Id == country.Id);
            var coalitionIndex = coalition?.Index ?? 0;

            var id           = this.RawParameters.GetInt("AID");
            var existingArea = this.Server.Areas[id];

            if (existingArea != null)
            {
                this.Server.Areas[id].Country   = country;
                this.Server.Areas[id].Coalition = coalitionIndex;
                this.Server.Areas[id].IsEnabled = this.RawParameters.GetInt("ENABLED") == 1;
                this.Area = this.Server.Areas[id];
            }
            else
            {
                this.Area = new Area(this.RawParameters.GetInt("AID"), country, this.RawParameters.GetInt("ENABLED") == 1)
                {
                    Coalition = coalitionIndex,
                };
            }

            this.PlanesByCoalition = new List <CoalitionPlanesCount>();
            var planesNumber = Util.SequenceToIntArray(this.RawParameters.GetString("BC"));
        }
Exemple #2
0
 public MissionLogEventGroupInitInfo(MissionLogEventHeader header)
     : base(header)
 {
     this.GroupId   = this.RawParameters.GetInt("GID");
     this.ObjectIds = Util.SequenceToIntArray(this.RawParameters.GetString("IDS"));
     this.LeaderId  = this.RawParameters.GetInt("LID");
 }
Exemple #3
0
        public MissionLogEventInfluenceAreaInfo(MissionLogEventHeader header)
            : base(header)
        {
            var country        = new Country(RawParameters.GetInt("COUNTRY"));
            var coalition      = Server.CoalitionIndexes.FirstOrDefault(c => c.Country.Id == country.Id);
            int coalitionIndex = 0;

            if (coalition != null)
            {
                coalitionIndex = coalition.Index;
            }

            var id           = RawParameters.GetInt("AID");
            var existingArea = Server.Areas[id];

            if (existingArea != null)
            {
                Server.Areas[id].Country   = country;
                Server.Areas[id].Coalition = coalitionIndex;
                Server.Areas[id].IsEnabled = RawParameters.GetInt("ENABLED") == 1 ? true : false;
                Area = Server.Areas[id];
            }
            else
            {
                Area = new Area(RawParameters.GetInt("AID"),
                                country,
                                RawParameters.GetInt("ENABLED") == 1 ? true : false)
                {
                    Coalition = coalition.Index,
                };
            }
            PlanesByCoalition = new List <CoalitionPlanesCount>();
            var planesNumber = Util.SequenceToIntArray(RawParameters.GetString("BC"));
        }