What even is this iterator.

Started by Kyna Tiona, January 11, 2017, 04:33:26 AM

Previous topic - Next topic

Kyna Tiona

[DebuggerHidden]
public static IEnumerable<Thing> AllLaunchableThings(Map map)
{
TradeUtility.<AllLaunchableThings>c__Iterator166 <AllLaunchableThings>c__Iterator = new TradeUtility.<AllLaunchableThings>c__Iterator166();
<AllLaunchableThings>c__Iterator.map = map;
<AllLaunchableThings>c__Iterator.<$>map = map;
TradeUtility.<AllLaunchableThings>c__Iterator166 expr_15 = <AllLaunchableThings>c__Iterator;
expr_15.$PC = -2;
return expr_15;
}


......So, I need to detour this function for a mod I'm working on, because I had to move the trade beacon functionality out of the thing and put it in a comp. It mostly all handles itself, but stuff still needs to know where to go to figure out what items are tradeable.

The trouble is, I barely even understand what I'm looking at, much less how to modify it...

RawCode

check movenext() method

if you cant see that method, use dnspy and check again

Kyna Tiona

Hm. So I switched over to dnSpy from ILSpy (so much prettier!), but I'm still not seeing movenext(). Or rather, dnSpy is seeing movenext(), but clicking "go to reference" just sends me to the TradeUtility class, with the movenext() in question still being nowhere to be found.

RawCode

please check closely provided screenshot, "go to references" will work too, but you are expected to check for proper referenced and not checking referenced of random types and methods.

applications in use are dnspy and notepad++

[attachment deleted by admin due to age]

skullywag

Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Kyna Tiona

Quote from: RawCode on January 11, 2017, 06:10:10 AM
please check closely provided screenshot, "go to references" will work too, but you are expected to check for proper referenced and not checking referenced of random types and methods.

applications in use are dnspy and notepad++

As I said, "go to references" does not send me to anything. The screenshots are showing methods that do not appear when I look at the same place in dnSpy. Where does Notepad++ come into play?

Quote from: skullywag on January 11, 2017, 01:23:12 PM
Or use this version of ilspy:

https://github.com/Zhentar/ILSpy

Oh, so that's what that "saved by Zhentar" thing was about. I downloaded it, but it was a solution rather than an executable, and it didn't build properly. "Could not find NRefactory", among 944 other errors. How do I use this?

RawCode

QuoteWhere does Notepad++ come into play?
you are expected to export entire source with "compiler generated code" into folder on desktop and use notepad++ to navigate around.
don't ask where you can read about this, it's from article on wiki.

as for zhentar's ilspy, you are expected to download precompiled bundle, extract it somewhere and execute, not source code itself, ofc you can download source code and build it self, but...looks like you are not able to do it yet.

please provide detailed step by step information about your actions, with screens, don't forget screens of il\dnspy configuration to make sure, that you have proper settings and all code do show.

skullywag

Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Kyna Tiona

Quote from: RawCode on January 11, 2017, 07:19:57 PM
QuoteWhere does Notepad++ come into play?
you are expected to export entire source with "compiler generated code" into folder on desktop and use notepad++ to navigate around.
don't ask where you can read about this, it's from article on wiki.

as for zhentar's ilspy, you are expected to download precompiled bundle, extract it somewhere and execute, not source code itself, ofc you can download source code and build it self, but...looks like you are not able to do it yet.

please provide detailed step by step information about your actions, with screens, don't forget screens of il\dnspy configuration to make sure, that you have proper settings and all code do show.

I swear you're trying to be rude. = /

Quote from: skullywag on January 11, 2017, 07:21:08 PM
https://github.com/Zhentar/ILSpy/releases grab it from releases tab on github its already built then.

Oh! Yes, that would make sense. I feel a little silly now. And yeah, it's totally readable with this version of ILSpy. I had been assuming I was looking at some crazy low-level coding thing I wasn't prepared to deal with, not an ILSpy error.

Thanks, that makes this really straightforward!

RawCode

i am trying hard to be "not rude" still, it's extremely hard, because any action expect spoonfeeding is "rude" by popular misbelieve.

i had provided method names with RVA and metadata tags, you can get all required data with just a little effort, just try a little bit and you will get source code of iterator and in addition you will get skills that will "unlock" all other iterators.

Fluffy (l2032)

RawCode is just too smart for the rest of us, and not a native english speaker. He (mostly) means well, but he can sometimes come across as being rude. Don't let it bother you.

Kyna Tiona

Quote from: Fluffy (l2032) on January 12, 2017, 08:38:05 AM
RawCode is just too smart for the rest of us, and not a native english speaker. He (mostly) means well, but he can sometimes come across as being rude. Don't let it bother you.

Oh, okay.

......[Blink] Wah! Somehow I guess I just assumed you were a mystical entity that bestowed mods from afar, for some reason. Your UIs are amazing and the dynamic relations tab is to date the only UI to ever arouse me. Which was honestly incredibly unsettling and I hope it doesn't ever happen again, but point being, I am a fan of yours, and I have an overwhelming desire to tell you this~

skullywag

Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?