Exemplo n.º 1
0
        internal void Save()
        {
            if (!DataService.Key.Equals(_DataServiceStrategy))
            {
                Bootstrapper.SetDataStrategy(DataService.Key);
                Settings.DataService    = _DataService;
                Tasks.DataService       = _DataService;
                Paths.DataService       = _DataService;
                Mimes.DataService       = _DataService;
                Content.DataService     = _DataService;
                Credentials.DataService = _DataService;
                Indexer.DataService     = _DataService;
                Chronos.DataService     = _DataService;
                Mimes.DataService       = _DataService;
                Schema.DataService      = _DataService;
                Mimes.SaveWorkspace();
            }
            if (Content.CanSaveWorkspace())
            {
                Content.SetPreferences();
                Content.SaveWorkspace();
            }

            if (Schema.CanSaveWorkspace())
            {
                Schema.SetPreferences();
                Schema.SaveWorkspace();
            }
            if (Indexer.CanSaveWorkspace())
            {
                Indexer.SaveWorkspace();
            }

            if (Tasks.CanSaveWorkspace())
            {
                Tasks.SetPreferences();
                Tasks.SaveWorkspace();
            }
            if (_Chronos != null && _Chronos.CanSaveWorkspace())
            {
                _Chronos.SaveWorkspace();
            }
            if (Styx != null && Styx.CanSaveWorkspace())
            {
                Styx.SaveWorkspace();
            }
            // must be last so that preferences are persisted
            if (Settings.CanSaveWorkspace())
            {
                Settings.SaveWorkspace();
            }
        }
        //BattleGround Event
        public void WoWChat_Battleground(Styx.CommonBot.Chat.ChatLanguageSpecificEventArgs e)
        {
            if (e.Author != StyxWoW.Me.Name)
            {
                try
                {
                    string sMessageType = "BATTLEGROUND_MESSAGE";
                    string sCommandCheck = SQLConnector.SendJSON("[{\"TAB\":\"TABMessageReceive\"},{\"nToonId\":\"" + WatchMyToon.nToonId + "\"},{\"szMessageType\":\"" + sMessageType + "\"},{\"szMessagePartner\":\"" + e.Author + "\"},{\"szMessageText\":\"" + e.Message + "\"}]", "{\"Query\":\"Insert\"}", "{\"Limit\":\"0\"}");
                    Logging.Write(LogLevel.Verbose, Colors.Orange, "[WatchMyToon] - BattleGround Message Insert Report: " + sCommandCheck);

                    Logging.Write(LogLevel.Normal, Colors.LightBlue, "[WatchMyToon] - Received " + sMessageType);
                }
                catch (Exception ex)
                {
                    Logging.Write(LogLevel.Normal, Colors.Red, "[WatchMyToon] - WoWChat_Battleground SQL Failed!");
                    Logging.Write(LogLevel.Diagnostic, Colors.Red, "[WatchMyToon] - " + ex);
                }
            }
        }
Exemplo n.º 3
0
 private void ReportPoint( Styx.WoWPoint p )
 {
     _petLog.WriteLine( "<Hotspot X=\"" + p.X + "\" Y=\"" + p.Y + "\" Z=\"" + p.Z + "\"/>");
     _reportedPoint = p;
 }
Exemplo n.º 4
0
 // checks if a player is in the same area, if not performs Close - Start
 // then checks if a pet id is already registered, if not creates one and adds a pet name there
 public void AddSeen(string id, string name, Styx.WoWPoint point)
 {
     if (!_started || !PluginSettings.Instance.RecordPets) return;
     CheckAndDoZoneReset();
     if( _petsSeen.ContainsKey( id ))
     {
         //Logger.WriteDebug( "pet " +name+ " already reported");
         return;
     }
     _petsSeen[id] = 1;
     Styx.WoWPoint pointToReport = point;
     //Styx.WoWPoint pointToReport = StyxWoW.Me.Location;   // TODO: config?
     if (_reportedPoint.Equals(WoWPoint.Zero) || _reportedPoint.Distance2DSqr(pointToReport) > 200 * 200)
     {
         ReportPoint( point );
     }
     ReportSeen( name );
 }
Exemplo n.º 5
0
 public Composite FaceTarget(Styx.TreeSharp.CanRunDecoratorDelegate extra)
 {
     return new Decorator(ret => extra(ret) && (!Me.IsFacing(Me.CurrentTarget) || !Me.IsSafelyFacing(Me.CurrentTarget, 5f)),
                          new Action(delegate
                          {
                              Me.CurrentTarget.Face();
                          }
                              ));
 }
Exemplo n.º 6
0
 public Hotspot(Styx.WoWPoint p)
 {
     X = p.X; Y = p.Y; Z = p.Z;
 }
Exemplo n.º 7
0
 private void Chat_Yell(Styx.CommonBot.Chat.ChatLanguageSpecificEventArgs e)
 {
     Chatter(e.Message, e.Author, e.EventName);
 }
Exemplo n.º 8
0
        private static uint TotalIncomingHeals( Styx.Patchables.IncomingHeal[] heals, bool includeMyHeals = false)
        {
            uint aggcheck = heals
                .Where(heal => includeMyHeals || heal.OwnerGuid != StyxWoW.Me.Guid)
                .Aggregate(0u, (current, heal) => current + heal.HealAmount);
            #if false
            uint myincoming = 0;
            foreach (var heal in heals)
            {
                if (includeMyHeals || heal.OwnerGuid != StyxWoW.Me.Guid)
                    myincoming += heal.HealAmount;
            }

            uint sumcheck = (uint) heals
                .Where(heal => includeMyHeals || heal.OwnerGuid != StyxWoW.Me.Guid)
                .Sum( heal => (long) heal.HealAmount);

            if ( myincoming != aggcheck || aggcheck != sumcheck)
            {
                Logger.WriteDiagnostic(Color.HotPink, "Accuracy Error= my={0}  agg={1}  sum={2}", myincoming, aggcheck, sumcheck);
            }
            #endif
            return aggcheck;
        }
Exemplo n.º 9
0
 private void Chat_Whisper(Styx.CommonBot.Chat.ChatWhisperEventArgs e)
 {
     Chatter(e.Message, e.Author, e.EventName);
 }
Exemplo n.º 10
0
 private void Chat_Guild(Styx.CommonBot.Chat.ChatGuildEventArgs e)
 {
     Chatter(e.Message, e.Author, e.EventName);
 }
Exemplo n.º 11
0
 private void Chat_Emote(Styx.CommonBot.Chat.ChatAuthoredEventArgs e)
 {
     Chatter(e.Message, e.Author, e.EventName);
 }
Exemplo n.º 12
0
 private void QueueChat(Styx.CommonBot.Chat.ChatLanguageSpecificEventArgs e)
 {
     chatLogs.Add(new ChatLog(e.EventName, e.Author, e.Message, e.FireTimeStamp));
 }
Exemplo n.º 13
0
        public void LogSettings(string desc, Styx.Helpers.Settings set)
        {
            if (set == null)
                return;

            Logger.WriteFile("====== {0} Settings ======", desc);
            foreach (var kvp in set.GetSettings())
            {
                Logger.WriteFile("  {0}: {1}", kvp.Key, kvp.Value.ToString());
            }

            Logger.WriteFile("");
        }