Creating an NRaas project Attn C# Devs: Overwatch

Talk nerdy to us here.
User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:06 pm

That's good to hear, I'd still give it a few more days just to make sure :)

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:15 pm

Not more harm than a typical error, but the Sleep didn't occur, the check is done before and apparently EA checks for yielding context even if they're not going to use Sleep() and it seems to be related to animations somehow. So no, no harm, unless it happens during loadup, in which case it will mess up the whole loadup sequence and you'll have an apocalypse, but as long as you don't save it's going to be fine (I had that once, I was scared....)

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:33 pm

That I don't know. Tipically it's always done before running a task that will yield, which means it will run under the Simulator. The problem being that EA doesn't return after checking the yielding context, they keep the code going and make it stop by throwing an exception. Without ErrorTrap that translates into unexpected behavior

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:37 pm

The very same Sleep() is done like that :

<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">public static void Sleep(uint tickCount)<br/>{<br/> Simulator.CheckYieldingContext();<br/> Simulator.gSimulator.Sleep(tickCount);<br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

-->
</style><pre class="text">public static void Sleep(uint tickCount)
{
Simulator.CheckYieldingContext();
Simulator.gSimulator.Sleep(tickCount);
}</pre>


See what I mean, they don't go back if it's not a yielding context, they let it go on anyway. In other places though, they do return if it's false. I don't know what to think of it...

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:46 pm

They use a bool for that : Simulator.YieldingDisabled

And yes, that doesn't make sense, that's why Twallan made his own method that actually puts the check to good use

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 5:52 pm

Forgot : no, of course it doesn't get assigned in the check, which is what would make sense, but not there, it's used to disable the yielding in some cases, they're not many, a couple perhaps

Post Reply