protected override void SaveFile(string tmpname)
 {
     if (Item == null)
     {
         Item = SimGesture.SaveGesture(this);
     }
     byte[] bs = AssetData;
     if (bs != null && bs.Length > 0)
     {
         NeedsSave = false;
         FileName  = "anim_cache/" + tmpname + ".anim";
         WriteLine("saving anim file " + FileName);
         TaskQueueHandler.WithLock(SimAssetStore.SavingFileLock, () => {
             if (Directory.Exists("anim_cache"))
             {
                 File.WriteAllBytes(FileName, AssetData);
             }
         });
     }
     //WorldObjects.Master.GetModuleName()
 }
Beispiel #2
0
 public static SimAsset FindOrCreateAsset(UUID uUID, AssetType type)
 {
     SimAsset anim = FindAsset(uUID);
     if (anim != null)
     {
         //taskQueueQuick.Enqueue("ProbeCache " + type + " " + uUID, anim.ProbeCache);
         return anim;
     }
     lock (WorldObjects.UUIDTypeObject)
     {
         string noname = null;
         anim = FindAsset(uUID);
         if (anim == null)
         {
             switch (type)
             {
                 case AssetType.Animation:
                     anim = new SimAnimation(uUID, noname);
                     break;
                 case AssetType.Sound:
                 case AssetType.SoundWAV:
                     anim = new SimSound(uUID, noname, type);
                     break;
                 case AssetType.Texture:
                 case AssetType.ImageJPEG:
                 case AssetType.ImageTGA:
                 case AssetType.TextureTGA:
                     anim = new SimTexture(uUID, noname, type);
                     break;
                 case AssetType.Gesture:
                     anim = new SimGesture(uUID, noname);
                     break;
                 case AssetType.LSLText:
                 case AssetType.LSLBytecode:
                     anim = new SimScript(uUID, noname, type);
                     break;
                 case AssetType.Notecard:
                     anim = new SimNotecard(uUID, noname);
                     break;
                 case AssetType.CallingCard:
                     anim = new SimCallingCard(uUID, noname);
                     break;
                 case AssetType.Clothing:
                     anim = new SimClothing(uUID, noname);
                     break;
                 case AssetType.Bodypart:
                     anim = new SimBodypart(uUID, noname);
                     break;
                 case AssetType.Landmark:
                     anim = new SimLandmark(uUID, noname);
                     break;
                 case AssetType.Link:
                     anim = new SimLandmark(uUID, noname);
                     break;
                 case AssetType.LinkFolder:
                     anim = new SimLandmark(uUID, noname);
                    // anim = new Sim(uUID, noname);
                     break;
                 //case AssetType.Object:
                    // anim = new SimObjectImpl(uUID, null, null);
                     break;
                 default:
                     throw new NotImplementedException("FindOrCreateAsset " + type);
                     break;
             }
             uuidAssetSetValue(uUID, anim);
         }
         anim.AssetType = type;
         taskQueueQuick.Enqueue("ProbeCache " + type + " " + uUID, anim.ProbeCache);
     }
     {
         InternAsset(anim);
         return anim;
     }
 }