Exemple #1
0
        public MissionLogEventGameObjectSpawn(MissionLogEventHeader header)
            : base(header)
        {
            GameInfo.ObjectsClassification.TryGetValue(this.RawParameters.GetString("TYPE"), out var purpose);

            if (purpose == null)
            {
                purpose = new GameObjectItem(GameObjectClass.Other, "Unknown");
            }

            this.Object = new GameObject(this.RawParameters.GetInt("ID"), this.RawParameters.GetString("TYPE"))
            {
                Classification = purpose.Classification.ToString("g"),
                Purpose        = purpose.Purpose,
                Country        = new Country(this.RawParameters.GetInt("COUNTRY")),
            };

            this.Object.CoalitionIndex = this.Server.GetCoalitionIndex(this.Object.Country);
            this.PlayerId = this.RawParameters.GetInt("PID");
        }
Exemple #2
0
        public MissionLogEventPlaneSpawn(MissionLogEventHeader header)
            : base(header)
        {
            GameObjectItem purpose;

            GameInfo.ObjectsClassification.TryGetValue(this.RawParameters.GetString("TYPE"), out purpose);
            if (purpose == null)
            {
                purpose = new GameObjectItem(GameObjectClass.Other, "Unknown");
            }

            this.Player = new Player()
            {
                Id       = this.RawParameters.GetInt("PID"),
                Country  = new Country(this.RawParameters.GetInt("COUNTRY")),
                IsInAir  = this.RawParameters.GetInt("INAIR") == 0,
                IsOnline = true,
                LoginId  = this.RawParameters.GetGuid("LOGIN"),
                NickId   = this.RawParameters.GetGuid("IDS"),
                NickName = this.RawParameters.GetString("NAME"),
                Plane    = new Plane(this.RawParameters.GetInt("PLID"), this.RawParameters.GetString("TYPE"))
                {
                    Bullets        = this.RawParameters.GetInt("BUL"),
                    Bombs          = this.RawParameters.GetInt("BOMB"),
                    Classification = GameObjectClass.Plane.ToString("g"),
                    Fuel           = this.RawParameters.GetDouble("FUEL"),
                    Payload        = this.RawParameters.GetString("PAYLOAD"),
                    Purpose        = purpose.Purpose,
                    Shells         = this.RawParameters.GetInt("SH"),
                    Skin           = this.RawParameters.GetString("SKIN"),
                    WeaponMods     = this.RawParameters.GetString("WM"),
                },
                BotPilot = new GameObject(this.RawParameters.GetInt("PID"), "BotPilot"),
                SortieId = this.EventID,
            };
            this.Player.CoalitionIndex = this.Server.GetCoalitionIndex(this.Player.Country);
            this.Server.Players.PlayerSpawn(this.Player);
        }