Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handle invalid/corrupted animation zipmods #34

Open
ManlyMarco opened this issue Jun 6, 2024 · 1 comment
Open

Better handle invalid/corrupted animation zipmods #34

ManlyMarco opened this issue Jun 6, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@ManlyMarco
Copy link
Contributor

ManlyMarco commented Jun 6, 2024

Catch failed zipmod loads and provide a useful message to help debug the issue. Currently it's just:

XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String arg) [0x00029] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReaderImpl.Throw (System.String res) [0x00000] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace () [0x0012c] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x002d4] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlTextReader.Read () [0x00000] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.XmlReader.MoveToContent () [0x0003a] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderUsedAnimations.Read3_Animations () [0x00008] in <2ffcb7f16a044af3bc60f23de2c66c40>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in :0
Rethrow as InvalidOperationException: There is an error in XML document (1, 1).
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle, System.Xml.Serialization.XmlDeserializationEvents events) [0x0011b] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader, System.String encodingStyle) [0x00000] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream) [0x0001c] in <1d98d70bb7d8453b80c25aa561fdecd1>:0
at AnimationLoader.UsedAnimations.Read () [0x00022] in <3ee9350102704cfea00069f47a558609>:0
at AnimationLoader.SwapAnim.Start () [0x00000] in <3ee9350102704cfea00069f47a558609>:0

Which later results in:

NullReferenceException: Object reference not set to an instance of an object
at AnimationLoader.SwapAnim+Hooks.ExtendList (System.Object __instance) [0x0003e] in <3ee9350102704cfea00069f47a558609>:0
at (wrapper dynamic-method) HSceneProc.DMDHSceneProc::CreateAllAnimationList(HSceneProc)
at (wrapper dynamic-method) HSceneProc.DMDHSceneProc::CreateListAnimationFileName(HSceneProc,bool)
at (wrapper dynamic-method) HSceneProc+d__153.DMD<HSceneProc+d__153::MoveNext>(HSceneProc/d__153)
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <548b4fa0e7e04f27a1b7580930bfb7dc>:0

It would help in cases like #33

@ManlyMarco ManlyMarco added bug Something isn't working enhancement New feature or request labels Jun 6, 2024
@IDontHaveIdea
Copy link
Collaborator

Hi,

This is a utility file that saves the animations used for the "New" animation indicator functionality to work like the regular game animations.

at AnimationLoader.UsedAnimations.Read () [0x00022] in <3ee9350102704cfea00069f47a558609>:0

The file is readable since is xml but fixing it will depend on the user knowledge of xml. Thinking of just overwrite it since the only side effect is that the "New" symbol will appear again for all the AnimationLoader animations.

I'm doing a revision of the manifest.xml for the animations when done will upload a patched AnimationLoader with a new [katarsys] KPlug Animations vX.X.X.zipmod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants