public void Assets_OnReceived(AssetDownload transfer, Asset asset) { if (!IsExporting) { return; } if (transfer.Success) { AssetComplete(asset.AssetID); string sfile = SimAsset.CFileName(asset.AssetID, asset.AssetType); try { var data = asset.AssetData; if (data != null && data.Length > 1) { lock (fileWriterLock) File.WriteAllBytes(assetDumpDir + Path.GetFileName(sfile), asset.AssetData); return; } } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error); } } }
private void Asset_Xfer(object sender, XferReceivedEventArgs e) { if (!IsExporting) { return; } UUID assetID = GetAssetID(e.Xfer); var assetType = e.Xfer.AssetType; if (assetType == AssetType.Unknown) { // probly an taskinv so ingnore return; } lock (ToDownloadAssets) if (e.Xfer.Success) { AssetComplete(assetID); string sfile = SimAsset.CFileName(assetID, assetType); try { lock (fileWriterLock) File.WriteAllBytes(assetDumpDir + Path.GetFileName(sfile), e.Xfer.AssetData); } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error); } } }
public void OnObjectSound(UUID objectID, UUID soundID, float gain) { if (!MaintainSounds) { return; } SimObject o = SimObjectFn(objectID); if (o == null) { return; } o.ConfirmedObject = true; if (soundID == UUID.Zero) { o.OnSound(UUID.Zero, gain); if (o.ShouldEventSource) { SendNewRegionEvent(SimEventType.EFFECT, "On-Attach-Sound-Gain-Change", o, gain); } } else { SimAsset sound = EnqueueRequestAsset(soundID, AssetType.Sound, true); o.OnSound(soundID, gain); if (o.ShouldEventSource) { SendNewRegionEvent(SimEventType.EFFECT, "On-Single-Sound-Gain-Change", o, sound, gain); } } // RegionMasterTexturePipeline.RequestAsset(soundID, AssetType.SoundWAV, true); }
public void PurgeCache() { string sfile = Path.GetDirectoryName(SimAsset.CFileName(UUID.Zero, AssetType.Texture)); if (Directory.Exists(sfile)) { Directory.Delete(sfile, true); Directory.CreateDirectory(sfile); } }
static bool ValidateSimAssetIdForPrefab(SimAsset prefab) { if (AssetDatabase.TryGetGUIDAndLocalFileIdentifier(prefab, out string guid, out long localId)) { if (prefab.Guid != guid) { prefab.Editor_SetGuid(guid); EditorUtility.SetDirty(prefab); DebugEditor.LogAssetIntegrity($"[{nameof(SimAssetBankUpdater)}] Updated {prefab.name}'s assetId to: {guid}"); PrefabUtility.RecordPrefabInstancePropertyModifications(prefab); return(true); } } return(false); }
public void Init(UUID id) { if (id == UUID.Zero) { return; } AssetType assetType = AssetType.Texture; SimAsset sa = SimAssetStore.FindOrCreateAsset(id, assetType); if (!sa.NeedsRequest) { return; } { StartTextureDownload(id); } sa.NeedsRequest = false; lock (AssetRequestType) { if (AssetRequestType.ContainsKey(id)) { return; } AssetRequestType[id] = AssetType.Texture; } // Callbacks client.Assets.RequestImage(id, ImageType.Normal, 101300.0f, 0, 0, delegate(TextureRequestState state, AssetTexture assetTexture) { if (state == TextureRequestState.Finished) { Assets_OnImageReceived(assetTexture); sa.SetAsset(assetTexture); return; } else if (state == TextureRequestState.Progress) { // DisplayPartialImage(assetTexture); } else if (state == TextureRequestState.Timeout) { AssetRequestType.Remove(id); } }, false); }
internal void OnAssetDownloaded(UUID uUID, Asset asset) { EnsureCached(asset, uUID); WorldObjects.RegisterUUIDMaybe(uUID, asset); SimAsset A = SimAssetStore.FindOrCreateAsset(uUID, asset.AssetType); A.SetAsset(asset); //A.TypeData = asset.AssetData; if (false) { BotClient Client = this.client; AutoResetEvent UploadCompleteEvent = new AutoResetEvent(false); if (Client.AnimationFolder == UUID.Zero) { Client.AnimationFolder = Client.Inventory.FindFolderForType(AssetType.Animation); } DateTime start = new DateTime(); Client.Inventory.RequestCreateItemFromAsset(asset.AssetData, A.Name, "Anim captured " + uUID, AssetType.Animation, InventoryType.Animation, Client.AnimationFolder, delegate(bool success, string status, UUID itemID, UUID assetID) { WriteLine( String.Format( "RequestCreateItemFromAsset() returned: Success={0}, Status={1}, ItemID={2}, AssetID={3}", success, status, itemID, assetID)); WriteLine(String.Format("Upload took {0}", DateTime.Now. Subtract(start))); UploadCompleteEvent.Set(); }); UploadCompleteEvent.WaitOne(); //A.Name //SetAnimationName(asset.AssetID, s); } // Debug(s); // RegisterUUID(asset.AssetID, s); }
public SimAssetBundle(string assetbundleName, string[] assetPaths) { this.name = assetbundleName; m_AllAssets = new Dictionary <string, SimAsset>(); foreach (var a in assetPaths) { var asset = new SimAsset(a); if (!m_AllAssets.ContainsKey(asset.name)) { m_AllAssets.Add(asset.name, asset); } else { LogMgr.E("资源已加载: {0}", asset); } } loaded = false; }
private static void RevertUnwantedOverrides(LevelGridAuth castedTarget) { Transform transform = castedTarget.transform; //////////////////////////////////////////////////////////////////////////////////////// // Cache Data //////////////////////////////////////////////////////////////////////////////////////// SimAsset simAsset = castedTarget.PrefabSimAsset; // Tilemaps TilemapCache[] tilemapCaches = new TilemapCache[transform.childCount]; for (int i = 0; i < transform.childCount; i++) { var tilemap = transform.GetChild(i).GetComponent <Tilemap>(); if (tilemap != null) { tilemapCaches[i] = CacheTilemap(tilemap); } } //////////////////////////////////////////////////////////////////////////////////////// // Revert //////////////////////////////////////////////////////////////////////////////////////// PrefabUtility.SetPropertyModifications(castedTarget.gameObject, new PropertyModification[0]); //////////////////////////////////////////////////////////////////////////////////////// // Restore //////////////////////////////////////////////////////////////////////////////////////// castedTarget.PrefabSimAsset = simAsset; // Tilemaps for (int i = 0; i < transform.childCount; i++) { var tilemap = transform.GetChild(i).GetComponent <Tilemap>(); if (tilemap != null && i < tilemapCaches.Length) { RestoreTilemap(tilemap, tilemapCaches[i]); } } EditorSceneManager.MarkSceneDirty(castedTarget.gameObject.scene); }
public SimAssetId GetSimAssetId() { GameObject simGO = GetSimGameObject(); if (!simGO) { Log.Error($"[{nameof(ViewBindingDefinition)}] ({gameObject.name}) Failed to find Sim GameObject... The binding will not work."); return(SimAssetId.Invalid); } SimAsset assetIdAuth = simGO.GetComponent <SimAsset>(); if (!assetIdAuth) { Log.Error($"[{nameof(ViewBindingDefinition)}] ({gameObject.name}) The Sim GameObject {simGO.name} doesn't " + $"have any {nameof(SimAsset)} component attached to it. The binding will not work."); return(SimAssetId.Invalid); } return(assetIdAuth.GetSimAssetId()); }
private void Assets_OnImageReceived(AssetTexture assetTexture) { try { byte[] jpegdata; ManagedImage imgManaged; Image image; SimAsset sa = SimAssetStore.FindOrCreateAsset(assetTexture.AssetID, assetTexture.AssetType); if (!OpenJPEG.DecodeToImage(assetTexture.AssetData, out imgManaged, out image)) { throw new Exception("decoding failure"); } jpegdata = assetTexture.AssetData; sa._TypeData = jpegdata; UUIDTypeObjectSetValue(assetTexture.AssetID, jpegdata); assetTexture.Decode(); } catch (Exception excp) { System.Console.WriteLine("Error decoding image: " + excp.Message); } }
public ImageDownload StartTextureDownload(UUID id) { AssetType type = AssetType.Texture; SimAsset simAsset = SimAssetStore.FindOrCreateAsset(id, type); AssetCache Cache = (RegionMasterTexturePipeline == null ? null : RegionMasterTexturePipeline.Cache); if (Cache != null && Cache.HasAsset(id #if COGBOT_LIBOMV , type #endif )) { ImageDownload dl = Cache.GetCachedImage(id); if (dl != null) { simAsset.SetAsset(dl); } return(dl); } lock (TexturesSkipped) if (TexturesSkipped.Contains(id)) { return(null); } lock (AssetRequestType) { if (AssetRequestType.ContainsKey(id)) { return(null); } AssetRequestType[id] = AssetType.Texture; } TextureRequested++; SlowConnectedQueue.Enqueue(() => client.Assets.RequestImage(id, ImageType.Normal, RegionMasterTexturePipeline_OnDownloadFinished)); return(null); }
/* * * private bool RequestObjectProperties(IList<SimObject> objects, int msPerRequest, Simulator sim) * { * // Create an array of the local IDs of all the prims we are requesting properties for * uint[] localids = new uint[objects.Count]; * * lock (PrimsWaiting) * { * PrimsWaiting.Clear(); * * for (int i = 0; i < objects.Count; ++i) * { * localids[i] = objects[i].LocalID; * PrimsWaiting.Add(objects[i].ID, objects[i].Prim); * } * } * * Client.Objects.SelectObjects(sim, localids); * * return AllPropertiesReceived.WaitOne(2000 + msPerRequest * objects.Count, false); * } */ private void Assets_OnImageReceived(TextureRequestState state, AssetTexture asset) { if (!IsExporting) { return; } lock (ToDownloadAssets) if (state == TextureRequestState.Finished) { AssetComplete(asset.AssetID); if (state == TextureRequestState.Finished) { string sfile = Path.GetFileName(SimAsset.CFileName(asset.AssetID, asset.AssetType)); try { lock (fileWriterLock) File.WriteAllBytes(assetDumpDir + sfile, asset.AssetData); } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); } return; if (asset.Decode()) { try { lock (fileWriterLock) File.WriteAllBytes(assetDumpDir + asset.AssetID + ".tga", asset.Image.ExportTGA()); } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); } } else { try { lock (fileWriterLock) File.WriteAllBytes(assetDumpDir + sfile, asset.AssetData); } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client); } return; } Logger.Log("Finished downloading image " + asset.AssetID, Helpers.LogLevel.Info, Client); } else { Logger.Log("Failed to download image " + asset.AssetID + ":" + state, Helpers.LogLevel.Warning, Client); } } }
public void ActivateTooltipDisplay(ItemAuth itemGameActionAuth, Entity itemOwner) { if (!Input.GetKey(KeyCode.LeftAlt)) { if (_currentDelayedTooltipActivationCoroutine == null) { _currentDelayedTooltipActivationCoroutine = this.DelayedCall(_displayDelay, () => { ActivateTooltipDisplay(itemGameActionAuth, itemOwner); }); return; } else { StopCoroutine(_currentDelayedTooltipActivationCoroutine); _currentDelayedTooltipActivationCoroutine = null; } } if (itemGameActionAuth != null) { SimAsset simAsset = itemGameActionAuth.GetComponent <SimAsset>(); if (simAsset != null) { Entity itemEntity = FindItemFromAssetId(simAsset.GetSimAssetId(), itemOwner); if (itemEntity != Entity.Null) { _itemName.text = itemGameActionAuth.Name; // update title Text UpdateTooltipDescription(itemEntity, itemGameActionAuth); UpdateTooltipColors(Color.white); _shouldBeDisplayed = true; } } } }
//public override void Assets_OnXferReceived(XferDownload xfer) //{ // //AssetRequests. // //RegisterUUIDMaybe(xfer.ID, xfer); //} public SimAsset EnqueueRequestAsset(UUID id, AssetType assetType, bool priority) { if (id == UUID.Zero) { return(null); } SimAsset sa = SimAssetStore.FindOrCreateAsset(id, assetType); if (!sa.NeedsRequest) { return(sa); } if (assetType == AssetType.Texture) { StartTextureDownload(id); return(sa); } sa.NeedsRequest = false; if (assetType == AssetType.SoundWAV) { return(sa); } //if (assetType == AssetType.Sound) return sa; lock (AssetRequestType) { if (AssetRequestType.ContainsKey(id)) { return(sa); } AssetRequestType[id] = assetType; SlowConnectedQueue.Enqueue( () => RegionMasterTexturePipeline.RequestAsset(id, assetType, priority, Assets_OnAssetReceived)); } return(sa); }
private void CreateNewGameObjects(SimAssetBank.Lookup simAssetBank) { Entities .WithAll <BindedViewType_GameObject>() .WithNone <BindedGameObjectTag>() .WithoutBurst() .WithStructuralChanges() .ForEach((Entity viewEntity, in SimAssetId id, in BindedSimEntity simEntity) => { EntityManager.AddComponent <BindedGameObjectTag>(viewEntity); SimAsset simAsset = simAssetBank.GetSimAsset(id); if (simAsset.BindedViewPrefab != null) { GameObject viewGO = Object.Instantiate(simAsset.BindedViewPrefab); var bindedSimEntityManaged = viewGO.GetOrAddComponent <BindedSimEntityManaged>(); bindedSimEntityManaged.Register(simEntity); EntityManager.AddComponentObject(viewEntity, bindedSimEntityManaged); EntityManager.AddComponentObject(viewEntity, viewGO.transform); } }).Run();
public byte[] TextureBytesForUUID(UUID uUID) { //imlicitly DeclareTexture(uUID); SimAsset assettt = SimAssetStore.FindOrCreateAsset(uUID, AssetType.Texture); var AssetData = assettt.AssetData; if (AssetData != null) { assettt.IsTraced = false; return(AssetData); } assettt.IsTraced = true; ImageDownload ID = null; //lock (uuidTypeObject) { object iObject; if (UUIDTypeObjectTryGetValue(uUID, out iObject)) { if (iObject is ImageDownload) { ID = (ImageDownload)iObject; } } } if (ID == null) { ID = StartTextureDownload(uUID); if (ID == null) { var giveUpTick = DateTime.Now;//.AddMinutes(1);// +1 * 60000; while (ID == null) { ID = StartTextureDownload(uUID); if (ID == null) { lock (TexturesSkipped) if (TexturesSkipped.Contains(uUID)) { return(null); } if (DateTime.Now > giveUpTick) { lock (TexturesSkipped) TexturesSkipped.Add(uUID); //if (Settings.LOG_LEVEL == Helpers.LogLevel.Warning) Debug("-- ---- ---GIVEUP SculptMesh " + uUID); return(null); } //Thread.Sleep(5000); DoEvents(); return(null); } } } lock (UUIDTypeObjectLock) { UUIDTypeObjectSetValue(uUID, ID); } } if (Settings.LOG_LEVEL == Helpers.LogLevel.Debug) { Debug("-|-|- SUCCEED SculptMesh " + uUID); } return(ID.AssetData); }
public override CmdResult ExecuteRequest(CmdRequest args) { if (args.Length < 1) { return(ShowUsage()); // " downloadtexture [texture-uuid] [discardlevel]"; } TextureID = UUID.Zero; DownloadHandle.Reset(); Asset = null; if (UUID.TryParse(args[0], out TextureID)) { int discardLevel = 0; if (args.Length > 1) { if (!Int32.TryParse(args[1], out discardLevel)) { return(ShowUsage()); // " downloadtexture [texture-uuid] [discardlevel]"; } } Client.Assets.RequestImage(TextureID, ImageType.Normal, Assets_OnImageReceived); if (DownloadHandle.WaitOne(120 * 1000, false)) { if (resultState == TextureRequestState.Finished) { if (Asset != null && SimAsset.Decode(Asset)) { try { File.WriteAllBytes(Asset.AssetID + ".jp2", Asset.AssetData); } catch (Exception ex) { Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex); } return (Success(string.Format("Saved {0}.jp2 ({1}x{2})", Asset.AssetID, Asset.Image.Width, Asset.Image.Height))); } else { return(Failure("failed to decode texture " + TextureID.ToString())); } } else if (resultState == TextureRequestState.NotFound) { return(Failure("Simulator reported texture not found: " + TextureID.ToString())); } else { return(Failure("Download failed for texture " + TextureID + " " + resultState)); } } else { return(Failure("Timed out waiting for texture download")); } } else { return(ShowUsage()); // " downloadtexture [texture-uuid]"; } }
static public string argString(object arg) { if (arg == null) { return("NIL"); } Type type = arg.GetType(); if (arg is BotClient) { arg = ((BotClient)arg).GetAvatar(); if (arg is BotClient) { return(((BotClient)arg).ToString()); } } if (arg is WorldObjects) { arg = ((WorldObjects)arg).TheSimAvatar; } if (arg is Simulator) { Simulator sim = (Simulator)arg; uint globalX, globalY; Utils.LongToUInts(sim.Handle, out globalX, out globalY); return("'(simulator " + argString(sim.Name) + " " + globalX / 256 + " " + globalY / 256 + " " + argString(sim.IPEndPoint.ToString()) + ")"); } if (arg is Avatar) { Avatar prim = (Avatar)arg; arg = "'(SimAvatarFn "; //+ argString(prim.ID.ToString()); if (prim.Name != null) { arg = arg + " " + argString(prim.Name); } return(arg + ")"); } if ((arg is AssetAnimation) || (arg is AssetTexture) || (arg is AssetSound)) { Asset prim = (Asset)arg; arg = SimAssetStore.GetSimAsset(prim); } if (arg is SimAsset) { SimAsset prim = (SimAsset)arg; AssetType tyepe = prim.AssetType; arg = "'(Sim" + tyepe + "Fn "; //+ argString(prim.ID.ToString()); if (prim.Name != null) { arg = arg + " " + argString(prim.Name); } return(arg + ")"); } if (arg is Primitive) { Primitive prim = (Primitive)arg; arg = "'(SimObjectFn " + argString(prim.ID.ToString()); if (prim.Properties != null) { arg = arg + " " + argString(prim.Properties.Name); } return(arg + ")"); } if (arg is SimAvatar) { SimAvatar prim = (SimAvatar)arg; arg = "'(SimAvatarFn " + argString(prim.GetName()); return(arg + ")"); } if (arg is SimObject) { SimObject prim = (SimObject)arg; arg = "'(SimObjectFn " + argString(prim.ID.ToString()); string name = prim.GetName(); if (!string.IsNullOrEmpty(name)) { arg = arg + " #|" + argString(name) + "|# "; } return(arg + ")"); } if (type.IsEnum) { return(argString(arg.ToString())); } //InternalDictionary if (arg is IList) { String dictname = "'(list " + type.Name; IList list = (IList)arg; foreach (object key in list) { dictname += " " + argString(key); } return(dictname + ")"); } if (arg is Parcel) { String dictname = "'(parcel"; Parcel list = (Parcel)arg; dictname += " " + argString(list.SnapshotID.ToString()); dictname += " " + argString(list.Name); return(dictname + ")"); } if (arg is Group) { String dictname = "'(Group"; Group list = (Group)arg; dictname += " " + argString(list.Name); return(dictname + ")"); } if (arg is IDictionary) { String dictname = "'(dict " + type.Name; IDictionary dict0 = (IDictionary)arg; IDictionary dict = dict0; lock (dict.SyncRoot) { foreach (object key in dict.Keys) { Object o = dict[key]; dictname += " " + argString(key) + "=" + argString(o); } return(dictname + ")"); } } //if (arg is Quaternion) //{ // Quaternion quat = (Quaternion)arg; // quat.Normalize(); // arg = WorldSystem.QuatToRotation(quat); //} if (arg is Quaternion) { Quaternion vect = (Quaternion)arg; return("'(Quaternion " + vect.X + " " + vect.Y + " " + vect.Z + " " + vect.W + ")"); } if (arg is UUID) { // if (true) return argString(arg.ToString()); object found = WorldObjects.GridMaster.GetObject((UUID)arg); if (found == null || found is UUID) { return(argString(arg.ToString())); } return(argString(found)); } if (arg is Vector3) { Vector3 vect = (Vector3)arg; return("'(Vector3 " + vect.X + " " + vect.Y + " " + vect.Z + ")"); } if (arg is Vector2) { Vector2 vect = (Vector2)arg; return("'(Vector2 " + vect.X + " " + vect.Y + ")"); } if (arg is Vector3d) { Vector3d vect = (Vector3d)arg; return("'(Vector3d " + vect.X + " " + vect.Y + " " + vect.Z + ")"); } if (type.IsArray) { Array a = (Array)arg; return("#{/*" + type + "*/" + argsListString(a) + "}"); } if (arg is String) { return("\"" + arg.ToString().Replace("\"", "\\\"") + "\""); } if (type.Namespace.StartsWith("System")) { return("" + arg); } if (arg is IEnumerable) { IEnumerable a = (IEnumerable)arg; return("'(/*" + type + "*/" + argsListString(a) + ")"); } if (type.IsValueType) { String tostr = "{" + arg + ""; foreach (FieldInfo fi in type.GetFields()) { if (!fi.IsStatic) { tostr += ","; tostr += fi.Name + "="; tostr += argString(fi.GetValue(arg)); } } return(argString(tostr + "}")); } if (!type.IsValueType) { String tostr = "{" + arg + ""; foreach (FieldInfo fi in type.GetFields()) { if (!fi.IsStatic) { tostr += ","; tostr += fi.Name + "="; tostr += fi.GetValue(arg); } } return(argString(tostr + "}")); } return("" + arg); }
public override CmdResult ExecuteRequest(CmdRequest args) { if (NOSEARCH_ANIM) { String str = args.str; WriteLine("PLAY ECHO " + str); return(Success("\nStart assets " + str + "\n")); } bool writeInfo = !args.IsFFI; if (args.Length < 1) { Dictionary <UUID, int> gestures = WorldSystem.TheSimAvatar.GetCurrentAnimDict(); string alist = String.Empty; foreach (var anim in gestures) { AppendItem("assets", WorldSystem.GetAsset(anim.Key)); if (!writeInfo) { continue; } alist += WorldSystem.GetAnimationName(anim.Key); alist += " "; alist += anim.Value; alist += Environment.NewLine; } if (writeInfo) { WriteLine("Currently: {0}", alist); } return(SuccessOrFailure()); // " anim [seconds] HOVER [seconds] 23423423423-4234234234-234234234-23423423 +CLAP -JUMP STAND"; } int argStart = 0; int time = 1300; //should be long enough for most animations base.SetWriteLine("message"); string directive = args[0].ToLower(); int mode = 0; int defaultAnimTime = 2; int animsRan = 0; AssetType defaultSearch = AssetType.Gesture; for (int i = argStart; i < args.Length; i++) { string a = args[i]; if (String.IsNullOrEmpty(a)) { continue; } try { float ia; if (float.TryParse(a, out ia)) { if (ia > 0.0) { time = (int)(ia * 1000); Thread.Sleep(time); continue; } } } catch (Exception) { } char c = a.ToCharArray()[0]; if (c == '-') { mode = -1; a = a.Substring(1); } else if (c == '+') { mode = 1; a = a.Substring(1); } else { mode = 0; } if (a == "") { continue; } if (a.ToLower() == "stopall") { Dictionary <UUID, bool> animations = new Dictionary <UUID, bool>(); var anims = TheSimAvatar.GetCurrentAnims(); foreach (var ani in anims) { animations[ani] = false; } int knownCount = animations.Count; Client.Self.Animate(animations, true); WriteLine("stopping all"); continue; } try { defaultSearch = (AssetType)Enum.Parse(typeof(AssetType), a, true); continue; } catch { } UUID anim = WorldSystem.GetAssetUUID(a, defaultSearch); if (anim == UUID.Zero) { try { if (a.Substring(2).Contains("-")) { anim = UUIDParse(a); } } catch (Exception) { } } if (anim == UUID.Zero) { anim = WorldSystem.GetAssetUUID(a, AssetType.Unknown); } if (anim == UUID.Zero) { Failure("skipping unknown animation/gesture " + a); continue; } SimAsset asset = SimAssetStore.FindAsset(anim); animsRan++; AppendItem("assets", WorldSystem.GetAsset(anim)); if (asset is SimGesture) { Client.Self.PlayGesture(asset.AssetID); continue; } if (asset is SimSound) { Client.Sound.PlaySound(asset.AssetID); continue; } if (asset != null && !(asset is SimAnimation)) { Failure("Dont know how to play " + asset); continue; } try { switch (mode) { case -1: Client.Self.AnimationStop(anim, true); if (writeInfo) { WriteLine("\nStop anim " + WorldSystem.GetAnimationName(anim)); } continue; case +1: Client.Self.AnimationStart(anim, true); if (writeInfo) { WriteLine("\nStart anim " + WorldSystem.GetAnimationName(anim)); } continue; default: try { int val = time; Client.Self.AnimationStart(anim, true); if (writeInfo) { WriteLine("\nRan anim " + WorldSystem.GetAnimationName(anim) + " for " + val / 1000 + " seconds."); } Thread.Sleep(val); } finally { Client.Self.AnimationStop(anim, true); } continue; } } catch (Exception e) { return(Failure("\nRan " + animsRan + " asserts but " + e)); } } return(SuccessOrFailure()); }