Beispiel #1
0
 public static void Verbose(object message)
 {
     foreach (var m in SplitMessage(message))
     {
         PluginLog.LogVerbose($"{m}");
     }
 }
Beispiel #2
0
 public static void Verbose(object message, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerName = "", [CallerLineNumber] int lineNumber = -1)
 {
     foreach (var m in SplitMessage(message))
     {
         PluginLog.LogVerbose($"[{callerPath.Substring(_subStrIndex)}::{callerName}:{lineNumber}] {m}");
     }
 }
Beispiel #3
0
 private void UpdatePartyHook(IntPtr hudAgent)
 {
     _hudAgentPtr = hudAgent;
     PluginLog.LogVerbose($"Obtained HUD agent at address 0x{_hudAgentPtr.ToInt64():X16}.");
     _updatePartyHook.Original(hudAgent);
     _updatePartyHook.Disable();
     _updatePartyHook.Dispose();
 }
Beispiel #4
0
        private void OnHousingWardInfo(IntPtr dataPtr)
        {
            HousingWardInfo wardInfo = HousingWardInfo.Read(dataPtr);

            PluginLog.LogDebug($"Got HousingWardInfo for ward: {wardInfo.LandIdent.WardNumber} territory: {wardInfo.LandIdent.TerritoryTypeId}");

            // if the current wardinfo is for a different district than the last swept one, print the header\
            // or if the last sweep was > 10m ago
            if (wardInfo.LandIdent.WorldId != lastSweptDistrictWorldId ||
                wardInfo.LandIdent.TerritoryTypeId != lastSweptDistrictTerritoryTypeId ||
                lastSweepTime < (DateTime.Now - TimeSpan.FromMinutes(10)))
            {
                // reset last sweep info to the current sweep
                lastSweptDistrictWorldId         = wardInfo.LandIdent.WorldId;
                lastSweptDistrictTerritoryTypeId = wardInfo.LandIdent.TerritoryTypeId;
                lastSweptDistrictSeenWardNumbers.Clear();
                lastSweepTime = DateTime.Now;

                var districtName = this.territories.GetRow((uint)wardInfo.LandIdent.TerritoryTypeId).PlaceName.Value.Name;
                var worldName    = this.worlds.GetRow((uint)wardInfo.LandIdent.WorldId).Name;
                this.pi.Framework.Gui.Chat.Print($"Began sweep for {districtName} ({worldName})");
            }

            // if we've seen this ward already, ignore it
            if (lastSweptDistrictSeenWardNumbers.Contains(wardInfo.LandIdent.WardNumber))
            {
                PluginLog.LogDebug($"Skipped processing HousingWardInfo for ward: {wardInfo.LandIdent.WardNumber} because we have seen it already");
                return;
            }

            // add the ward number to this sweep's seen numbers
            lastSweptDistrictSeenWardNumbers.Add(wardInfo.LandIdent.WardNumber);
            // if that's all the wards, give the user a cookie
            if (lastSweptDistrictSeenWardNumbers.Count == numWardsPerDistrict)
            {
                this.pi.Framework.Gui.Chat.Print($"Swept all {numWardsPerDistrict} wards. Thank you!");
            }

            // iterate over houses to find open houses
            for (int i = 0; i < wardInfo.HouseInfoEntries.Length; i++)
            {
                HouseInfoEntry houseInfoEntry = wardInfo.HouseInfoEntries[i];
                PluginLog.LogVerbose(
                    $"Got {wardInfo.LandIdent.WardNumber + 1}-{i + 1}: owned by {houseInfoEntry.EstateOwnerName}, flags {houseInfoEntry.InfoFlags}, price {houseInfoEntry.HousePrice}");
                if ((houseInfoEntry.InfoFlags & HousingFlags.PlotOwned) == 0)
                {
                    this.OnFoundOpenHouse(wardInfo, houseInfoEntry, i);
                }
            }
            PluginLog.LogDebug($"Done processing HousingWardInfo for ward: {wardInfo.LandIdent.WardNumber}");
        }
 /// <summary>
 /// Log verbose message.
 /// </summary>
 /// <param name="messageTemplate">message to log.</param>
 public static void LogVerbose(string messageTemplate)
 {
     PluginLog.LogVerbose(messageTemplate);
 }