Some cleanups
This commit is contained in:
@@ -17,60 +17,21 @@ namespace RemoteControl.Patches
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public class LogicStack_LogicStackTick
|
||||
{
|
||||
private struct State
|
||||
{
|
||||
internal object LockObj;
|
||||
internal bool Taken;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[UsedImplicitly]
|
||||
private static void Prefix(out State __state)
|
||||
private static void Prefix()
|
||||
{
|
||||
__state = new State
|
||||
{
|
||||
LockObj = SubscriptionManager.Lock,
|
||||
Taken = false
|
||||
};
|
||||
// System.Threading.Monitor.Enter(__state.LockObj, ref __state.Taken);
|
||||
try
|
||||
{
|
||||
RemoteControl.Log("logic stack tick: start prefix");
|
||||
RemoteControl.Subscribers.SendUpdate();
|
||||
RemoteControl.Log("logic stack tick: end prefix");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
RemoteControl.Log($"prefix: Exception {e}:\n {e.StackTrace}");
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
private static void Postfix(State __state)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!GameManager.RunSimulation) return;
|
||||
RemoteControl.Log("logic stack tick: start prefix");
|
||||
SubscriptionManager.RescanNetworks();
|
||||
RemoteControl.Log("logic stack tick: start postfix");
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
RemoteControl.Log("logic stack tick: start postfix");
|
||||
RemoteControl.Log($"postfix: Exception {e}: \n{e.StackTrace}");
|
||||
RemoteControl.Log("logic stack tick: end postfix");
|
||||
}
|
||||
finally
|
||||
{
|
||||
// if (__state.Taken)
|
||||
// {
|
||||
// System.Threading.Monitor.Exit(__state.LockObj);
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user