public void StartIdleing(int index, IdleInfo info) { if (Accounts.TryGetValue(index, out var accounts)) { accounts.Last().IsLast = true; foreach (var acc in accounts) { try { Titan.Instance.ThreadManager.StartIdling(acc, info); } catch (Exception ex) { _log.Error(ex, "Could not start botting for account {Account}: {Message}", acc.JsonAccount.Username, ex.Message); } } } else { _log.Error("Could not export accounts for current index {Index}. " + "Does it exist?", Index); } }
public void StartIdleing(int index, IdleInfo info) { List <TitanAccount> accounts; if (Accounts.TryGetValue(index, out accounts)) { try { Titan.Instance.ThreadManager.StartWatchdog(); } catch (Exception ex) { _log.Warning(ex, "Could not start Watchdog thread, starting to idle without one!"); } foreach (var acc in accounts) { try { Titan.Instance.ThreadManager.StartIdling(acc, info); } catch (Exception ex) { _log.Error(ex, "Could not start botting for account {Account}: {Message}", acc.JsonAccount.Username, ex.Message); } } } else { _log.Error("Could not export accounts for current index {Index}. " + "Does it exist?", Index); } }
private void HandleTimerOfInfo(IdleUnitType unit, bool isStarted) { IdleInfo info = App.GetIdleData().GetInfo(unit); if (info != null) { if (isStarted) { info.idleActivation.hasTimerFinished = false; } else { info.idleActivation.hasTimerFinished = true; } } }
public override string GetInteractionName() { IdleInfo idle = (InteractionDefinition as Definition).Idle; string animationName = idle.AnimationName; if (string.IsNullOrEmpty(animationName)) { animationName = idle.CustomJazzGraph; } if (string.IsNullOrEmpty(animationName)) { animationName = idle.SeatedAnimationName; } return(animationName); }
private void SetUpData(IdleInfo info) { SetUpCount(info.currentCount, info.data.totalCount); SetUpCost(info.nextCost.cost.cost); SetUpIncreaseUnit(info.defaultUnitIncreasePerSecond, info.permanentMultiplier); SetUpFinalUnit(info.defaultUnitIncreasePerSecond, info.data.totalCount); if (info.data.hasTimerBeforeNextClick) { fillTimer = info.currentBlockTime; } else { fillTimer = 0.0f; } unitType = info.unitType; }
public Definition(Sim.PlaySpecificIdle.Definition definition) { Posture = definition.Posture; PostureChecks = definition.PostureChecks; Idle = definition.Idle; mInteractionName = definition.InteractionName; if (string.IsNullOrEmpty(mInteractionName)) { mInteractionName = Idle.AnimationName; } List <string> path = new List <string> (definition.MenuPath); path.RemoveAt(0); mPath = path.ToArray(); }
public static void DoRandomIdle(Sim sim, InteractionPriority priority) { //20% chance of doing random idle. int percentage = RandomUtil.GetInt(1, 100); if (percentage <= 50) { string idle; IdleInfo info = null; bool customJazzGraph; ProductVersion version; idle = IdleManager.ChooseTraitIdle(sim.TraitManager.GetRandomVisibleElement().mTraitGuid, Sims3.SimIFace.CAS.CASAgeGenderFlags.Adult, Sims3.SimIFace.CAS.CASAgeGenderFlags.Female, out customJazzGraph, out version); foreach (IdleAnimationInfo item in IdleManager.sTraitIdleAnimations.Values) { if (item.Animations != null) { info = item.Animations.Find(delegate(IdleInfo i) { return(!string.IsNullOrEmpty(i.AnimationName) && i.AnimationName.Equals(idle)); }); } if (info != null) { break; } } if (info != null) { // CommonMethodsOFBBistroSet.PrintMessage(info.AnimationName); Sim.PlayAnim(sim, info.AnimationName); } } else { sim.IdleManager.PlayOneFacialIdle(); } }
public TCL.CompletionCode cmdProc( Interp interp, TclObject[] argv ) { int i; Notifier notifier = (Notifier)interp.getNotifier(); Object info; if ( assocData == null ) { /* * Create the "after" information associated for this * interpreter, if it doesn't already exist. */ assocData = (AfterAssocData)interp.getAssocData( "tclAfter" ); if ( assocData == null ) { assocData = new AfterAssocData( this ); interp.setAssocData( "tclAfter", assocData ); } } if ( argv.Length < 2 ) { throw new TclNumArgsException( interp, 1, argv, "option ?arg arg ...?" ); } /* * First lets see if the command was passed a number as the first argument. */ bool isNumber = false; int ms = 0; if ( argv[1].InternalRep is TclInteger ) { ms = TclInteger.get( interp, argv[1] ); isNumber = true; } else { string s = argv[1].ToString(); if ( ( s.Length > 0 ) && ( System.Char.IsDigit( s[0] ) ) ) { ms = TclInteger.get( interp, argv[1] ); isNumber = true; } } if ( isNumber ) { if ( ms < 0 ) { ms = 0; } if ( argv.Length == 2 ) { /* * Sleep for at least the given milliseconds and return. */ long endTime = System.DateTime.Now.Ticks / 10000 + ms; while ( true ) { try { System.Threading.Thread.Sleep( ms ); return TCL.CompletionCode.RETURN; } catch ( System.Threading.ThreadInterruptedException e ) { /* * We got interrupted. Sleep again if we havn't slept * long enough yet. */ long sysTime = System.DateTime.Now.Ticks / 10000; if ( sysTime >= endTime ) { return TCL.CompletionCode.RETURN; } ms = (int)( endTime - sysTime ); continue; } } } TclObject cmd = getCmdObject( argv ); cmd.preserve(); assocData.lastAfterId++; TimerInfo timerInfo = new TimerInfo( this, notifier, ms ); timerInfo.interp = interp; timerInfo.command = cmd; timerInfo.id = assocData.lastAfterId; assocData.handlers.Add( timerInfo ); interp.setResult( "after#" + timerInfo.id ); return TCL.CompletionCode.RETURN; } /* * If it's not a number it must be a subcommand. */ int index; try { index = TclIndex.get( interp, argv[1], validOpts, "option", 0 ); } catch ( TclException e ) { throw new TclException( interp, "bad argument \"" + argv[1] + "\": must be cancel, idle, info, or a number" ); } switch ( index ) { case OPT_CANCEL: if ( argv.Length < 3 ) { throw new TclNumArgsException( interp, 2, argv, "id|command" ); } TclObject arg = getCmdObject( argv ); arg.preserve(); /* * Search the timer/idle handler by id or by command. */ info = null; for ( i = 0; i < assocData.handlers.Count; i++ ) { Object obj = assocData.handlers[i]; if ( obj is TimerInfo ) { TclObject cmd = ( (TimerInfo)obj ).command; if ( ( cmd == arg ) || cmd.ToString().Equals( arg.ToString() ) ) { info = obj; break; } } else { TclObject cmd = ( (IdleInfo)obj ).command; if ( ( cmd == arg ) || cmd.ToString().Equals( arg.ToString() ) ) { info = obj; break; } } } if ( info == null ) { info = getAfterEvent( arg.ToString() ); } arg.release(); /* * Cancel the handler. */ if ( info != null ) { if ( info is TimerInfo ) { ( (TimerInfo)info ).cancel(); ( (TimerInfo)info ).command.release(); } else { ( (IdleInfo)info ).cancel(); ( (IdleInfo)info ).command.release(); } SupportClass.VectorRemoveElement( assocData.handlers, info ); } break; case OPT_IDLE: if ( argv.Length < 3 ) { throw new TclNumArgsException( interp, 2, argv, "script script ..." ); } TclObject cmd2 = getCmdObject( argv ); cmd2.preserve(); assocData.lastAfterId++; IdleInfo idleInfo = new IdleInfo( this, notifier ); idleInfo.interp = interp; idleInfo.command = cmd2; idleInfo.id = assocData.lastAfterId; assocData.handlers.Add( idleInfo ); interp.setResult( "after#" + idleInfo.id ); break; case OPT_INFO: if ( argv.Length == 2 ) { /* * No id is given. Return a list of current after id's. */ TclObject list = TclList.newInstance(); for ( i = 0; i < assocData.handlers.Count; i++ ) { int id; Object obj = assocData.handlers[i]; if ( obj is TimerInfo ) { id = ( (TimerInfo)obj ).id; } else { id = ( (IdleInfo)obj ).id; } TclList.append( interp, list, TclString.newInstance( "after#" + id ) ); } interp.resetResult(); interp.setResult( list ); return TCL.CompletionCode.RETURN; } if ( argv.Length != 3 ) { throw new TclNumArgsException( interp, 2, argv, "?id?" ); } /* * Return command and type of the given after id. */ info = getAfterEvent( argv[2].ToString() ); if ( info == null ) { throw new TclException( interp, "event \"" + argv[2] + "\" doesn't exist" ); } TclObject list2 = TclList.newInstance(); TclList.append( interp, list2, ( ( info is TimerInfo ) ? ( (TimerInfo)info ).command : ( (IdleInfo)info ).command ) ); TclList.append( interp, list2, TclString.newInstance( ( info is TimerInfo ) ? "timer" : "idle" ) ); interp.resetResult(); interp.setResult( list2 ); break; } return TCL.CompletionCode.RETURN; }
private void HandleButtonPressed(IdleUnitType unitType) { IdleInfo info = App.GetIdleData().GetInfo(unitType); App.GetLevelData().unitsToBeAddedNextTick += info.defaultUnitIncreasePerSecond * info.permanentMultiplier * (int)App.GetLevelData().currentMultiplier; IdleCurrency unit = App.GetLevelData().Unit; unit = unit - info.nextCost.cost.cost; if (unit < 0) { unit = 0; } App.GetLevelData().Unit = unit; //Formula for upgrading cost IdleCurrency currentCost = info.nextCost.cost.cost; if (info.hasAdsForCost) { if (info.alwaysVideo) { info.nextCost.isVideo = true; } else { info.currentCountOfTap++; if (info.currentCountOfTap >= info.adsEveryHowManyTap) { info.nextCost.isVideo = true; } else { info.nextCost.isVideo = false; IdleCurrency priceOnBaseCost = info.data.baseCost * info.data.percentageOnBaseCost; priceOnBaseCost *= 0.01f; IdleCurrency priceOnNewCost = currentCost * info.data.percentageOnNewCost; priceOnNewCost *= 0.01f; info.nextCost.cost.cost += (priceOnBaseCost + priceOnNewCost); } } } else { info.nextCost.isVideo = false; IdleCurrency priceOnBaseCost = info.data.baseCost * info.data.percentageOnBaseCost; priceOnBaseCost *= 0.01f; IdleCurrency priceOnNewCost = currentCost * info.data.percentageOnNewCost; priceOnNewCost *= 0.01f; info.nextCost.cost.cost += (priceOnBaseCost + priceOnNewCost); } int addition = (int)App.GetLevelData().currentMultiplier; D.Log($"addition is {addition}"); info.currentCount += addition; info.growth.currentSliderValue = 0; for (int i = 0; i < info.currentCount; i++) { if (i < info.growth.firstHalfClicks) { info.growth.currentSliderValue += info.growth.firstHalfGrowthRate; } else { info.growth.currentSliderValue += info.growth.lastHalfGrowthRate; } } if (info.data.hasTimerBeforeNextClick) { NotificationParam param = new NotificationParam(Mode.intData); param.intData.Add((int)info.unitType); App.Notify(Notification.StartBlockIng, param); } App.Notify(Notification.UnitsUpdated); }
private void EvaluateInfos() { // D.Log($"Evaluating info"); for (int i = 0; i < App.GetIdleData().idleLevels.Count; i++) { for (int j = 0; j < App.GetIdleData().idleLevels[i].idleInfos.Count; j++) { IdleInfo info = App.GetIdleData().idleLevels[i].idleInfos[j]; LogicStatus status = App.GetLogicEvaluator().EvaluateLogic(info.logicToUnlock); if (info.nextCost.cost.cost < App.GetLevelData().Unit&& status == LogicStatus.Fulfilled) { info.idleActivation.isAffordable = true; } else { info.idleActivation.isAffordable = false; } if (info.data.hasTimerBeforeNextClick) { if (info.idleActivation.hasTimerFinished) { info.idleActivation.isClickable = true; } else { info.idleActivation.isClickable = false; } } if (!info.data.isLockedByDefault) { info.idleActivation.isUnlocked = true; } else { if (info.dependsOnAllPrevious) { bool canUnlock = true; for (int k = 0; k < j; k++) { IdleInfo prevInfo = App.GetIdleData().idleLevels[i].idleInfos[k]; if (prevInfo.currentCount < prevInfo.data.totalCount) { canUnlock = false; break; } } info.idleActivation.isUnlocked = canUnlock; } else { int filledDependencies = 0; for (int k = 0; k < info.dependsOn.dependencies.Count; k++) { IdleUnitType type = info.dependsOn.dependencies[i].unitType; int requiredCount = info.dependsOn.dependencies[i].countToUnlock; int actualCount = App.GetIdleData().GetCount(type); if (requiredCount <= actualCount) { info.dependsOn.dependencies[i].isComplete = true; filledDependencies++; } else { info.dependsOn.dependencies[i].isComplete = false; } } if (filledDependencies == info.dependsOn.dependencies.Count) { info.idleActivation.isUnlocked = true; } else { info.idleActivation.isUnlocked = false; } } } } } App.Notify(Notification.ButtonsUpdated); }
public TCL.CompletionCode cmdProc(Interp interp, TclObject[] argv) { int i; Notifier notifier = (Notifier)interp.getNotifier(); Object info; if (assocData == null) { /* * Create the "after" information associated for this * interpreter, if it doesn't already exist. */ assocData = (AfterAssocData)interp.getAssocData("tclAfter"); if (assocData == null) { assocData = new AfterAssocData(this); interp.setAssocData("tclAfter", assocData); } } if (argv.Length < 2) { throw new TclNumArgsException(interp, 1, argv, "option ?arg arg ...?"); } /* * First lets see if the command was passed a number as the first argument. */ bool isNumber = false; int ms = 0; if (argv[1].InternalRep is TclInteger) { ms = TclInteger.get(interp, argv[1]); isNumber = true; } else { string s = argv[1].ToString(); if ((s.Length > 0) && (System.Char.IsDigit(s[0]))) { ms = TclInteger.get(interp, argv[1]); isNumber = true; } } if (isNumber) { if (ms < 0) { ms = 0; } if (argv.Length == 2) { /* * Sleep for at least the given milliseconds and return. */ long endTime = System.DateTime.Now.Ticks / 10000 + ms; while (true) { try { System.Threading.Thread.Sleep(ms); return(TCL.CompletionCode.RETURN); } catch (System.Threading.ThreadInterruptedException e) { /* * We got interrupted. Sleep again if we havn't slept * long enough yet. */ long sysTime = System.DateTime.Now.Ticks / 10000; if (sysTime >= endTime) { return(TCL.CompletionCode.RETURN); } ms = (int)(endTime - sysTime); continue; } } } TclObject cmd = getCmdObject(argv); cmd.preserve(); assocData.lastAfterId++; TimerInfo timerInfo = new TimerInfo(this, notifier, ms); timerInfo.interp = interp; timerInfo.command = cmd; timerInfo.id = assocData.lastAfterId; assocData.handlers.Add(timerInfo); interp.setResult("after#" + timerInfo.id); return(TCL.CompletionCode.RETURN); } /* * If it's not a number it must be a subcommand. */ int index; try { index = TclIndex.get(interp, argv[1], validOpts, "option", 0); } catch (TclException e) { throw new TclException(interp, "bad argument \"" + argv[1] + "\": must be cancel, idle, info, or a number"); } switch (index) { case OPT_CANCEL: if (argv.Length < 3) { throw new TclNumArgsException(interp, 2, argv, "id|command"); } TclObject arg = getCmdObject(argv); arg.preserve(); /* * Search the timer/idle handler by id or by command. */ info = null; for (i = 0; i < assocData.handlers.Count; i++) { Object obj = assocData.handlers[i]; if (obj is TimerInfo) { TclObject cmd = ((TimerInfo)obj).command; if ((cmd == arg) || cmd.ToString().Equals(arg.ToString())) { info = obj; break; } } else { TclObject cmd = ((IdleInfo)obj).command; if ((cmd == arg) || cmd.ToString().Equals(arg.ToString())) { info = obj; break; } } } if (info == null) { info = getAfterEvent(arg.ToString()); } arg.release(); /* * Cancel the handler. */ if (info != null) { if (info is TimerInfo) { ((TimerInfo)info).cancel(); ((TimerInfo)info).command.release(); } else { ((IdleInfo)info).cancel(); ((IdleInfo)info).command.release(); } SupportClass.VectorRemoveElement(assocData.handlers, info); } break; case OPT_IDLE: if (argv.Length < 3) { throw new TclNumArgsException(interp, 2, argv, "script script ..."); } TclObject cmd2 = getCmdObject(argv); cmd2.preserve(); assocData.lastAfterId++; IdleInfo idleInfo = new IdleInfo(this, notifier); idleInfo.interp = interp; idleInfo.command = cmd2; idleInfo.id = assocData.lastAfterId; assocData.handlers.Add(idleInfo); interp.setResult("after#" + idleInfo.id); break; case OPT_INFO: if (argv.Length == 2) { /* * No id is given. Return a list of current after id's. */ TclObject list = TclList.newInstance(); for (i = 0; i < assocData.handlers.Count; i++) { int id; Object obj = assocData.handlers[i]; if (obj is TimerInfo) { id = ((TimerInfo)obj).id; } else { id = ((IdleInfo)obj).id; } TclList.append(interp, list, TclString.newInstance("after#" + id)); } interp.resetResult(); interp.setResult(list); return(TCL.CompletionCode.RETURN); } if (argv.Length != 3) { throw new TclNumArgsException(interp, 2, argv, "?id?"); } /* * Return command and type of the given after id. */ info = getAfterEvent(argv[2].ToString()); if (info == null) { throw new TclException(interp, "event \"" + argv[2] + "\" doesn't exist"); } TclObject list2 = TclList.newInstance(); TclList.append(interp, list2, ((info is TimerInfo)?((TimerInfo)info).command:((IdleInfo)info).command)); TclList.append(interp, list2, TclString.newInstance((info is TimerInfo)?"timer":"idle")); interp.resetResult(); interp.setResult(list2); break; } return(TCL.CompletionCode.RETURN); }
public override bool Run() { try { IdleInfo info = (InteractionDefinition as Definition).Idle; bool flag = Actor.Posture.Satisfies(CommodityKind.Sitting, null); if (!string.IsNullOrEmpty(info.CustomJazzGraph)) { while (!Actor.HasExitReason(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached))) { if (!AnimationTone.ControlLoop(this)) { break; } Sim.CustomIdle idle = Sim.CustomIdle.Singleton.CreateInstance(Actor, Actor, GetPriority(), true, true) as Sim.CustomIdle; idle.Hidden = true; idle.JazzGraphName = info.CustomJazzGraph; idle.LoopTimes = info.PickCustomJazzGraphLoopCount(); idle.ExtraWaitTime = info.CasOnly ? 0x78 : 0x0; if (idle.JazzGraphName == "TraitWorkaholic") { idle.IdleObject = Actor.Inventory.Find <IPhoneCell>() as GameObject; idle.ObjectName = "phonecell"; } idle.RunInteraction(); } } else { string animationName = null; if (flag) { animationName = info.SeatedAnimationName; } if (string.IsNullOrEmpty(animationName)) { animationName = info.AnimationName; } while (!Actor.HasExitReason(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached))) { if (!AnimationTone.ControlLoop(this)) { break; } Actor.PlaySoloAnimation(animationName, true, info.ProductVersion); } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } return(false); }
public void FeedIdleInfo(IdleInfo info) { _idleInfo = info; }
public void SetUp(IdleInfo info) { SetUpData(info); if (!info.idleActivation.isUnlocked && info.currentCount < info.data.totalCount) { ShowAsPerStatus(ButtonStatus.Locked); if (info.dependsOnAllPrevious) { for (int i = 0; i < dependenciesShow.Length; i++) { dependenciesShow[i].Hide(); } for (int i = 0; i < unlockAllElseShow.Length; i++) { unlockAllElseShow[i].Show(); } } else { for (int i = 0; i < dependenciesShow.Length; i++) { dependenciesShow[i].Show(); } for (int i = 0; i < unlockAllElseShow.Length; i++) { unlockAllElseShow[i].Hide(); } if (requirementsToUnlock == null) { requirementsToUnlock = new List <RequirementView>(); for (int i = 0; i < info.dependsOn.dependencies.Count; i++) { GameObject gObj = Instantiate(requirementGameObject, dependenciesHolder); RequirementView view = gObj.GetComponent <RequirementView>(); requirementsToUnlock.Add(view); view.SetUp(info.dependsOn.dependencies[i]); } } else { if (info.dependsOn.dependencies.Count != requirementsToUnlock.Count) { D.LogError($"Dependencies count {info.dependsOn.dependencies.Count} is not equal to requirements Count {requirementsToUnlock.Count}"); } else { for (int i = 0; i < info.dependsOn.dependencies.Count; i++) { requirementsToUnlock[i].SetUp(info.dependsOn.dependencies[i]); } } } } } else if (info.currentCount == info.data.totalCount) { ShowAsPerStatus(ButtonStatus.Finished); } else { if (info.idleActivation.isAffordable && info.idleActivation.isClickable) { ShowAsPerStatus(ButtonStatus.Enabled); } else { ShowAsPerStatus(ButtonStatus.Disabled); } } }
public void StartIdling(TitanAccount account, IdleInfo info) { account.FeedIdleInfo(info); _count = 0; _log.Debug("Starting idling thread in games {@Games} using account {Account}.", info.GameID, account.JsonAccount.Username); _taskDic.Add(account, Task.Run(() => { var timedOut = false; try { account.StartTick = DateTime.Now.Ticks; var result = WaitFor <Result> .Run(TimeSpan.FromMinutes(info.Minutes + 2), account.Start); switch (result) { case Result.Success: _count++; break; case Result.AlreadyLoggedInSomewhereElse: _log.Error("Could not idle with account {Account}. The account is " + "already logged in somewhere else.", account.JsonAccount.Username); break; case Result.TimedOut: _log.Error("Processing thread for {Account} has timed out."); break; case Result.SentryRequired: _log.Error("The account has 2FA enabled. Please set {sentry} to {true} " + "in the accounts.json file.", "sentry", true); break; case Result.RateLimit: _log.Error("The Steam Rate Limit has been reached. Please try again in a " + "few minutes."); break; } } catch (TimeoutException) { var timeSpent = new DateTime(DateTime.Now.Ticks).Subtract(new DateTime(account.StartTick)); _log.Error("Connection to account {Account} timed out. It was not possible to " + "stop idle in the games after {Timespan} seconds.", account.JsonAccount.Username, timeSpent.Seconds); timedOut = true; } finally { if (timedOut) { account.Stop(); } _taskDic.Remove(account); } })); }
public void StartIdling(TitanAccount account, IdleInfo info) { if (_taskDic.ContainsKey(account)) { _log.Warning("Account is already reporting / commending / idling. Aborting forcefully!"); FinishBotting(account); } account.FeedIdleInfo(info); _count = 0; _log.Debug("Starting idling thread in games {@Games} using account {Account}.", info.GameID, account.JsonAccount.Username); _taskDic.Add(account, Task.Run(() => { var timedOut = false; try { account.StartTick = DateTime.Now.Ticks; var result = WaitFor <Result> .Run(TimeSpan.FromMinutes(info.Minutes + 2), account.Start); switch (result) { case Result.Success: _count++; if (account.IsLast) { _log.Information("SUCCESS! Titan has successfully idled {Amount} times in {Games}.", _count, account._idleInfo.GameID.ToString()); Titan.Instance.UIManager.SendNotification( "Titan", _count + "x was idled in " + account._idleInfo.GameID + " games!" ); account.IsLast = false; } break; case Result.AlreadyLoggedInSomewhereElse: _log.Error("Could not idle with account {Account}. The account is " + "already logged in somewhere else.", account.JsonAccount.Username); break; case Result.TimedOut: _log.Error("Processing thread for {Account} has timed out."); break; case Result.SentryRequired: _log.Error("The account has 2FA enabled. Please set {sentry} to {true} " + "in the accounts.json file.", "sentry", true); break; case Result.RateLimit: _log.Error("The Steam Rate Limit has been reached. Please try again in a " + "few minutes."); break; case Result.NoMatches: _log.Error("Could not find a live match for target."); break; } } catch (TimeoutException) { var timeSpent = new DateTime(DateTime.Now.Ticks).Subtract(new DateTime(account.StartTick)); _log.Error("Connection to account {Account} timed out. It was not possible to " + "stop idle in the games after {Timespan} seconds.", account.JsonAccount.Username, timeSpent.Seconds); timedOut = true; } finally { if (timedOut) { account.Stop(); } _taskDic.Remove(account); } })); }
public void OnConnect(IObjectConnection connection) { Connections[connection] = new IdleInfo { LastTicks = DateTime.Now.Ticks, HasPonged = true }; }