public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player)
        {
            int companyId = message.ReadInt();
            int vehicleId = message.ReadInt();

            Company co = game.GameObjectCollection.Get<Company>(companyId);
            CombatVehicle vic = game.GameObjectCollection.Get<CombatVehicle>(vehicleId);
            if (player.Owns(co) && player.Owns(co))
            {
                co.AddVehicle(vic);
            }
        }
Пример #2
0
        public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player)
        {
            int baseObjID = message.ReadInt();
            int coID = message.ReadInt();

            Base obj = game.GameObjectCollection.Get<Base>(baseObjID);
            Company co = game.GameObjectCollection.Get<Company>(coID);
            if (player.Owns(obj) && player.Owns(co))
            {
                co.ResupplyPoint = obj;
            }
        }
Пример #3
0
        public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player)
        {
            int baseObjID = message.ReadInt();

            Base obj = game.GameObjectCollection.Get<Base>(baseObjID);
            if (player.Owns(obj))
            {
                obj.BuildTransportVehicle();
            }
        }
Пример #4
0
        public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player)
        {
            int coID = message.ReadInt();

            Company obj = game.GameObjectCollection.Get<Company>(coID);
            if (player.Owns(obj))
            {
                obj.Destroy();
            }
        }
        public static void ExecuteCommand(RtsCommandMessage message, ServerGame game, RemotePlayer player)
        {
            int companyId = message.ReadInt();
            int positionCount = message.ReadInt();
            List<Vector2> positions = new List<Vector2>();

            for (int i = 0; i < positionCount; i++)
            {
                positions.Add(message.ReadVector2());
            }

            Company co = game.GameObjectCollection.Get<Company>(companyId);
            if (player.Owns(co))
            {
                co.SetPositions(game.GameObjectCollection, positions);
            }
        }