Ejemplo n.º 1
0
        private void RequestTaskCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var taskLetter = ((TaskLetter)e.Parameter).Body;

            taskLetter = _vocabularyProcesser.ReplaceVocabulary(e.Session, taskLetter);

            var title    = "Tasks for " + DateTime.Now.ToString("M dd");
            var fileName = _configurationAccessor.GetBaseFolder() + Path.DirectorySeparatorChar + title.ToLower().Replace(' ', '-') + ".txt";

            File.WriteAllText(fileName, taskLetter);

            foreach (var processor in CommandProcessors.Values)
            {
                taskLetter = processor.DeleteCommandFrom(taskLetter);
            }

            taskLetter = _vocabularyProcesser.ReplaceVocabulary(Session, taskLetter);

            var sendFileArgs = new SendFileEventArgs
            {
                FileName = fileName,
                Title    = title,
                Sender   = e.Session.Domme.Name,
            };

            OnSendFile(sendFileArgs);
        }
Ejemplo n.º 2
0
 private void PlayRedLightGreenLightVideoTauntCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     lock (_sessionLock)
     {
         Session = e.Session;
     }
     BeginSession((Script)e.Parameter);
 }
Ejemplo n.º 3
0
 private void RiskyPickStartCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     lock (_sessionLock)
     {
         Session = e.Session;
     }
     BeginSession((Script)e.Parameter);
 }
Ejemplo n.º 4
0
 private void PlayCensorshipSucksVideoTauntCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     lock (_sessionLock)
     {
         Session = e.Session;
     }
     BeginSession((Script)e.Parameter);
 }
Ejemplo n.º 5
0
        private void PlayVideoCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var playEventArgs = (PlayVideoEventArgs)e.Parameter;

            OnPlayVideo(playEventArgs);

            OnDommeSaid(e.Session.Domme, playEventArgs.Result.GetErrorMessageOrDefault());
        }
Ejemplo n.º 6
0
        private void HideCensorshipBarCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var eventArgs = new CensorshipBarChangedEventArgs()
            {
                IsVisible = false,
            };

            OnCensorshipBarChanged(eventArgs);

            OnDommeSaid(e.Session.Domme, eventArgs.Result.GetErrorMessageOrDefault());
        }
Ejemplo n.º 7
0
        private void EndCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var sub = e.Session.Sub;

            e.Session.Phase = GetNextPhase(e.Session.Phase);
            if (e.Session.Phase == SessionPhase.AfterSession)
            {
                e.Session.Scripts.Clear();
                return;
            }
            var type = "Stroke";

            if (e.Session.Phase == SessionPhase.Modules)
            {
                type = string.Empty;
            }
            var selectScript = _scriptAccessor.GetAvailableScripts(e.Session.Domme, e.Session.Sub, type, e.Session.Phase)
                               .OnSuccess(scripts =>
            {
                if (scripts.Count == 0)
                {
                    return(_scriptAccessor.GetFallbackMetaData(e.Session, e.Session.Phase));
                }
                return(Result.Ok(scripts[new Random().Next(scripts.Count)]));
            })
                               .OnSuccess(smd => _scriptAccessor.GetScript(smd));

            if (selectScript.IsFailure)
            {
                OnDommeSaid(e.Session.Domme, "Error: " + selectScript.Error);
                return;
            }

            e.Session.Scripts.Push(selectScript.Value);
            _scriptTimer.Interval = 1000;
            _scriptTimer.Enabled  = false;
        }
Ejemplo n.º 8
0
 protected virtual void OnCommandProcessed(object sender, CommandProcessedEventArgs eventArgs)
 {
     CommandProcessed?.Invoke(sender, eventArgs);
 }
Ejemplo n.º 9
0
 private void EdgeCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     _teaseCountDown.Interval  = 1000;
     _teaseCountDown.AutoReset = true;
     _teaseCountDown.Enabled   = true;
 }
Ejemplo n.º 10
0
 private void VitalSubAssignmentCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     OnVitalSubUpdated(new EventArgs());
 }
Ejemplo n.º 11
0
        private void LikeImageCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var eventArgs = (ShowImageEventArgs)e.Parameter;

            OnQueryImage(eventArgs);
        }
Ejemplo n.º 12
0
        private void TauntFromFileCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var taunt = _vocabularyProcesser.ReplaceVocabulary(e.Session, (string)e.Parameter);

            OnDommeSaid(e.Session.Domme, taunt);
        }
Ejemplo n.º 13
0
 private void StopVideoCommandProcessed(object sender, CommandProcessedEventArgs e) => OnStopVideo();
Ejemplo n.º 14
0
 private void StartStrokingCommandProcessed(object sender, CommandProcessedEventArgs e)
 {
     //StrokeTimer.Start()
     //TauntTimer.Start();
 }
Ejemplo n.º 15
0
        private void ShowImageCommandProcessed(object sender, CommandProcessedEventArgs e)
        {
            var imd = (ImageMetaData)e.Parameter;

            OnShowImage(imd);
        }
Ejemplo n.º 16
0
 private static void command_onCommandProcessed(object sender, CommandProcessedEventArgs eventArgs)
 {
     Console.WriteLine();
     Console.WriteLine($"+++ Successfully processed command: {eventArgs.Command.Name} on {eventArgs.DateProcessed} ms: {eventArgs.DateProcessed.Millisecond}");
 }
Ejemplo n.º 17
0
 private static void command_onCommandFailed(object sender, CommandProcessedEventArgs eventArgs)
 {
     Console.WriteLine();
     Console.WriteLine($"!!! Failed to process command: {eventArgs.Command.Name}, finished processing attempt on {eventArgs.DateProcessed} ms: {eventArgs.DateProcessed.Millisecond}");
 }
Ejemplo n.º 18
0
 private void UnpauseVideoCommandProcessed(object sender, CommandProcessedEventArgs e) => OnUnpauseVideo();