« first day (2187 days earlier)      last day (2752 days later) » 
01:00 - 18:0018:00 - 21:00

6:02 PM
@Meraj99 start with any project, and write some useful/missing unit tests for it and make pull request. Once you got how project totally works then you can contribute to add/fix/optimize functionality.
 
Low-hanging fruit sounds like a euphemism for testicles
 
It's true it, it does.
I'm so tired I can't make sentences in English.
Nor can I write IL apparently.
 
@TomW Not in the climate I live in
 
@Obviously yes just go with long
not sure why you need to cast to int, is there a specific reason?
 
@Teomanshipahi Well, that works I guess.
 
6:06 PM
yeah that field is set to int in the other model thats why
 
Fix your model to match with data store
 
Apparently when you call a static method that returns void and takes no parameters you require a nop instruction before and after the call.
 
@Tomwa you are writing IL for a commercial app? Or it is a framework or something :)
 
I am injecting code into an existing XNA app with Mono.Cecil so that I can add modding support.
 
oh OK.. it is cold water for me. Good luck :)
 
6:13 PM
Its an entity cant fix the model @Teomanshipahi
 
@Obviously auto generated entity? How come it is exported as int if it is bigint in SQL?
 
its int in the sql, I have two entities, one has int and the other is bigint
 
so why you have 2 entities? why not use one?
 
they are different
 
@Teomanshipahi Wrong Alex ;)
 
6:21 PM
I have someone managed to inject an empty instruction
It just says:

IL_0007:
With nothing next to it.
 
@Alex there is no way to refer other Alex. We found a bug in SO. I am sending Pull-Alex-Request.
 
I expect:

IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
I get:
IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
IL_0008:
Instruction count when my program writes the dll is 4 not 5.
 
@Teomanshipahi No worries! I don't mind it :) I'm mostly in the WPF room but love getting pinged in here. It makes me wonder if an old question got answered
 
6:37 PM
If you like WPF here's a riddle for you.
Why does WPF hate XNA?
Run an XNA app via WPF? Access Violation at 15m.

Run an XNA app via WinForms? No problem.
 
@KendallFrey Is it snowing by you yet?
 
not quite
 
o hey it's kendall
 
Does anyone here under CIL?
 
Is there a good way to go from a SqlCommand and a table name to a create table script?
 
6:41 PM
This morning it was hanging around 30F
I had Ice on my car windshield for the first time this season
It's a little early IMO
 
@Tomwa Where are you getting that from?
 
Yeah, I think it was upper 30s here.
 
@KendallFrey I'm writing it.
 
@Tomwa I like that :)
 
@Tomwa Then I don't understand the premise of your question
 
6:42 PM
I'm getting really weird IL
It's not what I inserted :|
{
// Code size 8 (0x8)
.maxstack 0
IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
IL_0008:
// Exception count 1
.try IL_049d to IL_04e5 finally handler IL_04e5 to IL_04f3
}
 
How are you "getting" what you wrote?
 
Ildasm
 
That's what I expected the first time I asked
 
On the assembly after it is written to disk
 
So, why are you concerned?
 
6:45 PM
Peverify says: [offset 0x00000000] try end > code size
 
The body of the method after I inject my IL before writing it to disk is:

IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
 
Are you using ilasm?
 
I'm hooking countless other methods, yet this one is being bizarre.
Yes.
 
What's the full code for that method?
 
6:46 PM
For which method?
The one I'm injecting? Or the one I'm injecting into?
 
the one you wrote
 
The one that does the injecting?
 
1 min ago, by Tomwa
The body of the method after I inject my IL before writing it to disk is:

IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
that one
 
Ah gotcha.
Here's the IL i'm injecting:

.method public hidebysig static void Test() cil managed
{
// Code size 8 (0x8)
.maxstack 8
IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
IL_0006: nop
IL_0007: ret
} // end of method


Here's the Game method after injection:

.method public hidebysig static void performTenMinuteClockUpdate() cil managed
{
// Code size 8 (0x8)
.maxstack 0
IL_0000: nop
IL_0001: call void [Extender]Extender.Game.Weather::OnTenMinute()
 
I don't understand the relationship between those two methods
 
6:51 PM
Essentially I just wrote a static method of the same return type and duplicated the IL for the call.

I wove that IL with Mono.Cecil as I did with countless other methods.
I'm not sure I understand what you're asking me for?
 
Me neither
But at this point I'm confused over what you're doing where with what when if maybe who knows
2
 
I have two assemblies:

Stardew Valley - The game assembly.

Extender - My class that I want to take over.

I have three methods at play here that ACTUALLY execute:

WeaveStaticCall - Injects a static call into the game assembly.
StardewValley.Game1::performTenMinuteClockUpdate() - The game method I want to redirect.
Extender.Game.Weather.OnTenMinute() - My method I want performTenMinuteClockUpdate() to redirect to.
I cleared all the existing instructions from performTenMinuteClockUpdate() and injected a call to the static method Extender.Game.Weather.OnTenMinute()
 
I stopped understanding at "My class that I want to take over"
Can you be more specific?
 
The game code does things i.e. Updates the character position, in Extender I write code to alter or replace that code.
 
10 mins ago, by Kendall Frey
Are you using ilasm?
 
6:56 PM
you're trying to alter existing code on the fly?
 
At this point it doesn't seem like it
 
No, I'm opening a pre-existing assembly, modifying it with Mono.Cecil, and saving it to disk.
 
12 mins ago, by Kendall Frey
That's what I expected the first time I asked
blep
 
After that the launcher loads the modified assembly, loads the mods and allows them to hook into the Extender class to control the game.
 
...i have enough fun trying to get code i directly modify to work like i tell it to
 
6:58 PM
I have about 80 methods currently properly hooked, and PEVerify gives me the greenlight.
But this one, adds that weird instruction at the end for some reason.
 
So it sounds like performTenMinuteClockUpdate is being rewritten with a smaller chunk of IL, but the try/finally block isn't updated to reflect that. Am I right?
 
That's the thing, there is no try
Not in the original game code, not in my code, not in the injected IL.
 
do or do not...
@Tomwa There is in the disassembled code:
> .try IL_049d to IL_04e5 finally handler IL_04e5 to IL_04f3
 
I know, but I don't know HOW that got there!
What is it that I'm not explaining properly?
That is the code of the method body right before I write the file to disk.
 
Well right now that try block is looking very out of place
I can't explain it, and apparently you can't either
 
7:10 PM
Okay so two weird things.
First is while there is no try in the code, their IS try in the game's CIL.
.try
{
IL_049d: br.s IL_04da
IL_049f: ldloca.s V_4
IL_04a1: call instance !0 valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<class StardewValley.GameLocation>::get_Current()
IL_04a6: stloc.s V_5
IL_04a8: ldloc.s V_5
IL_04aa: ldsfld int32 StardewValley.Game1::timeOfDay
IL_04af: callvirt instance void StardewValley.GameLocation::performTenMinuteUpdate(int32)
IL_04b4: ldloc.s V_5
IL_04b6: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
But I did method.Body.Instructions.Clear();
Why is the .try and .finally still there?
 
Perhaps try/finally is not considered part of the method body
 
I suppose that's how the finally manages to get called before a method finishes?
 
I suppose that doesn't have anything to do with it
 
Evidently Mono.Cecil considers them NOT part of the body.
Or rather not part of the instructions
target.Body.ExceptionHandlers.Clear();
Does the job
Wait a second
Now I get: drawAboveAlwaysFrontLayer][offset 0x0000006A] Endfinally from outside a finally handler
Well apparently try/finally blocks are a different monster all together.
@KendallFrey Thanks for humbling my rantings, I think I'll go read some more about CIL until I understand how this works
And I fixed it
So tired, might grab a nap.
 
7:41 PM
G'afternoon
 
Howdy
 
I'm using TFS and I'm seeing behavior I've never seen before. When I opened my project today, Visual Studio reported that the tfs server was offline. It said it would open in offline mode and I Xed out of the pop-up because there was no cancel. It opened it offline anyway, and I closed it and tried again, and it continues to open in offline mode. I restarted with the same results, I get the message : The solution was offline during its previous session and will remain offline.

Attempting to right-click on the solution and bring it online, every single file is apparently marked as modified,
 
I've never used TFS before unfortunately.
Always used Git
 
Doh
 
8:19 PM
Does c# have a yield from? I want my public method to do setup/teardown for an internal generator and I dislike having to do foreach (var result in MyInternalGenerator()) { yield return result}.
 
I am like 90 percent sure it does.
 
@MorganThrapp What are you thinking of when you say "yield from"?
 
In Python there's yield from. Let me give you an example.
 
If you mean a monadic iterator method, nah m8 ur screwed
C# doesn't like monads
 
def foo():
    for i in range(10):
        yield i

def bar():
    x = foo()
    for i in range(5):
        yield from x
 
8:24 PM
And I assume you can't just do return MyInternalGenerator()
@MorganThrapp Oh, you mean kind of like Take?
 
No, because I'm doing stuff with the results of MyInternalGenerator before I pass it out.
That is quite possible, I have not looked at Take.
 
That looks like it just returns the first 5 results of foo(), which is what Take is for
 
Oh, no, not quite. That's just a bad example. :P
149
A: In practice, what are the main uses for the new "yield from" syntax in Python 3.3?

Praveen GollakotaLet's get one thing out of the way first. The explanation that yield from g is equivalent to for v in g: yield v does not even begin to do justice to what yield from is all about. Because, let's face it, if all yield from does is expand the for loop, then it does not warrant adding yield from to ...

Basically it lets you change for x in y: yield x into yield from y.
 
oh, so is that code repeating foo() 5 times?
 
So, really, I could rewrite bar to just be def bar(): yield from foo().
Expect that's without the limiter, but yeah.
 
8:29 PM
Now I'm confused
what does that code do?
 
I think I may be too. :P
I actually may not need it, now that I think about it more.
 
8:56 PM
um wtf
> 'Type' does not contain a definition for 'BaseType'
 
@KendallFrey What are you writing?
 
code
 
Very specific.
 
ohhh I think
because it's PCL
fuck PCL
 
01:00 - 18:0018:00 - 21:00

« first day (2187 days earlier)      last day (2752 days later) »