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

Parts not shown when joining a quest #53

Open
yonguelink opened this issue Feb 24, 2020 · 8 comments
Open

Parts not shown when joining a quest #53

yonguelink opened this issue Feb 24, 2020 · 8 comments

Comments

@yonguelink
Copy link

When joining someone's quest (or SOS) I do not see the parts. I see the monster, their current health, their status effects, the player buffs and basically everything else.

I tried with the default config (with ShowUnchangedParts set to true along with HidePartsAfterSeconds set to various numbers, between 0 and about a million).

The parts are properly shown when I "host" the quest.

My C# is pretty rusty and I have no setup to run this on my own (might give it a shot next week-end if this isn't resolved by then tho), so I have no idea what could be causing this.

@gabrielefilipp
Copy link
Owner

gabrielefilipp commented Feb 25, 2020

That’s because you’re not the host of the lobby (Also an intentional optimization for non hosts member to not scan every parts as they would not see damage anyway. If you want you can disable this by changing MhwHelper.cs under UpdateAndGetMonster)

@yonguelink
Copy link
Author

yonguelink commented Feb 25, 2020

Host of the lobby and host of the quest is not the same thing is it?

Because I'm usually the host of the lobby.

I'll take a look at the function you pointed tho! Thanks!

EDIT: Ah, I see. Once someone posts a quest that person seems to become the lobby host.

EDIT²: And the parts damage is not possible to get because, I imagine, the game only reports how many times a part has been broken from the host to the non-host players?

@yonguelink
Copy link
Author

yonguelink commented Feb 25, 2020

Perhaps it could be an idea to let this be configurable to the user?

Add an optional key in the Config.json that defaults to false if not set like ShowPartsEvenIfNotHost... Could even add a notice in the logs saying you are displaying/updating the monster parts even if the player isn't host, thus being unable to get the current HP of each parts and showing only the number of time they were broken.

@gabrielefilipp
Copy link
Owner

I'll push a little update tomorrow

@gabrielefilipp
Copy link
Owner

I've added that option under "MonsterWidget" -> "AlwaysShowParts". Just this to true :)

@yonguelink
Copy link
Author

yonguelink commented Mar 3, 2020

Nice! That works!

I've also noticed your (work in progress?) sync server between 2 clients. I tried it, and it ends up crashing as soon as a PULL request is made and successfully done.

It has issues with sync'ing parts that (apparently?) do not exists:

[2020-03-03 22:48:29] Sending CHECK with parameters {"command":"check","key":"WxcywiNHK6fvizjncTMHTA1lqF4=","host":"false","data":null,"version":"1.0"}
[2020-03-03 22:48:29] Received CHECK with response {"status":"ok","result":"true"}
[2020-03-03 22:48:29] Sending PULL with parameters {"command":"pull","key":"WxcywiNHK6fvizjncTMHTA1lqF4=","host":"false","data":null,"version":"1.0"}
[2020-03-03 22:48:30] Received PULL with response of size 2038 byte
[2020-03-03 22:48:30] An error has occured while sending the request: Can not convert Object to String.
[2020-03-03 22:48:30] Localization: Monster 'em036_00' part '11' not found in MonsterData.json
(... and many more for all 3 monster on the map)

Do note that the parts that were damaged did show the damage for a very brief moment before SmartHunter crashed.

EDIT: I've got the gists of how it works, might try to look into that myself.

EDIT²: I spent little time looking at what was going on... The error related to converting object to string is here: https://github.com/gabrielefilipp/SmartHunter/blob/master/SmartHunter/Game/Helpers/MhwHelper.cs#L439 The result["result"] is an object and not something you can convert to string... maybe on errors tho, idk there.

I didn't find why the app was closing, but its not related to any message in my log above :(

@gabrielefilipp
Copy link
Owner

I've pushed a new small update. Can you tell me if you still have that issue?

@yonguelink
Copy link
Author

Yeah I'm having the same issue. I managed to get some kind of debugging running and got this stack trace:

Unhandled Exception: System.InvalidOperationException: Layout measurement override of element 'System.Windows.Controls.Grid' should not return NaN values as its DesiredSize.
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at SmartHunter.App.Main()

VSCode isn't helping me much there with the debugging, I think I'll need to install Visual Studio to get better debugging details... which I can't do before the week-end at the very least. Hopefully this stack trace helps you.

Also some extras:

  • Logs file for when I open SmartHunter when already in a quest that I joined: Log.txt

  • Screenshot right before crash occurs:

before_crash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants