Skip to content
Permalink
Browse files

Progress on track

- Disabled while not finished
  • Loading branch information
Splamy committed Jan 31, 2020
1 parent f997486 commit c4ca505c719f33be4c04147bd27f543fc7c7458e
Showing with 161 additions and 61 deletions.
  1. +1 −0 TS3AudioBot.sln
  2. +4 −0 TS3AudioBot/Bot.cs
  3. +1 −2 TS3AudioBot/Core.cs
  4. +155 −59 TS3AudioBot/Environment/Stats.cs
@@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.targets = Directory.Build.targets
GitVersion.yml = GitVersion.yml
README.md = README.md
TS3AudioBot.ruleset = TS3AudioBot.ruleset
EndProjectSection
@@ -18,6 +18,7 @@
using TS3AudioBot.CommandSystem.Text;
using TS3AudioBot.Config;
using TS3AudioBot.Dependency;
using TS3AudioBot.Environment;
using TS3AudioBot.Helper;
using TS3AudioBot.History;
using TS3AudioBot.Localization;
@@ -57,6 +58,7 @@ public sealed class Bot : IDisposable
private PlayManager playManager;
private IVoiceTarget targetManager;
private Player player;
private Stats stats;

public Bot(Id id, ConfBot config, BotInjector injector)
{
@@ -121,6 +123,7 @@ public E<string> InitializeBot()
playManager = Injector.GetModule<PlayManager>();
targetManager = Injector.GetModule<IVoiceTarget>();
sessionManager = Injector.GetModule<SessionManager>();
stats = Injector.GetModule<Stats>();

player.OnSongEnd += playManager.SongStoppedEvent;
player.OnSongUpdated += (s, e) => playManager.Update(e);
@@ -453,6 +456,7 @@ private void BeforeResourceStarted(object sender, PlayInfoEventArgs e)
private void CallScript(ExecutionInformation info, string command, bool answer, bool skipRights)
{
Log.Debug("Calling script (skipRights:{0}, answer:{1}): {2}", skipRights, answer, command);
stats.TrackCommandCall(answer);

info.AddModule(new CallerInfo(false)
{
@@ -114,8 +114,7 @@ private E<string> Run(ParameterData setup)
builder.GetModule<RightsManager>().CreateConfigIfNotExists(setup.Interactive);
builder.GetModule<BotManager>().RunBots(setup.Interactive);
builder.GetModule<WebServer>().StartWebServer();
if (setup.SendStats)
builder.GetModule<Stats>()?.StartSendStats();
builder.GetModule<Stats>().StartTimer(setup.SendStats);

return R.Ok;
}

0 comments on commit c4ca505

Please sign in to comment.
You can’t perform that action at this time.