Пример #1
0
        public ActionResult addRoaster(int profileID)
        {
            CabModel mdl = new CabModel();

            mdl = CabHelper.addRoaster(profileID);
            return(View("addRoaster", mdl));
        }
        /// <summary>
        /// Creates an empty AssetBundle request with a randomly generated CAB identifier.
        /// </summary>
        /// <returns>The asset bundle request with a random CAB identifier.</returns>
        public static AssetBundleCreateRequest CreateEmptyAssetBundleRequest()
        {
            var buffer = Properties.Resources.empty;

            CabHelper.RandomizeCab(buffer);
            return(AssetBundle.LoadFromMemoryAsync(buffer));
        }
Пример #3
0
        // GET: Cab
        public ActionResult viewRoaster(int profileID)
        {
            CabModel mdl = new CabModel();

            mdl.currentRoasterList = CabHelper.getCurrentRoasterList(profileID);
            return(View("viewRoaster", mdl));
        }
Пример #4
0
        internal static AssetBundle LoadFromFileWithRandomizedCabIfRequired(string path, uint crc, ulong offset, bool confirmFileExists)
        {
            var bundle = AssetBundle.LoadFromFile(path, crc, offset);

            if (bundle == null && (!confirmFileExists || File.Exists(path)))
            {
                byte[] buffer;
                using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read))
                {
                    var fullLength   = stream.Length;
                    var longOffset   = (long)offset;
                    var lengthToRead = fullLength - longOffset;
                    stream.Seek(longOffset, SeekOrigin.Begin);
                    buffer = stream.ReadFully((int)lengthToRead);
                }

                CabHelper.RandomizeCabWithAnyLength(buffer);

                XuaLogger.ResourceRedirector.Warn($"Randomized CAB for '{path}' in order to load it because another asset bundle already uses its CAB-string. You can ignore the previous error message, but this is likely caused by two mods incorrectly using the same CAB-string.");

                return(AssetBundle.LoadFromMemory(buffer));
            }
            else
            {
                return(bundle);
            }
        }
Пример #5
0
 public ActionResult saveRoaster(CabModel mdl)
 {
     CabHelper.saveRoaster(mdl);
     return(RedirectToAction("viewRoaster", new { profileID = mdl.roaster.ProfileID }));
 }