What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Strange Pulse Behavior...

toNyx

Well-Known Member
Joined
Oct 29, 2011
Messages
3,770
Reaction score
35
Hi fellow devs, encountered an error today while developing a plugin for flasks (very reactive tho, partially working with settings and form ;))

Here is the error :

Code:
Exception while pulsing plugin FlaskHelper: System.Exception: Seule une partie d’une requête ReadProcessMemory ou WriteProcessMemory a été effectuée, at addr: 00000008, Size: 28
   à GreyMagic.ExternalProcessMemory.ReadByteBuffer(IntPtr addr, Void* buffer, Int32 count)
   à GreyMagic.MemoryBase.Read[T](IntPtr addr)
   à Loki.Game.Std.Containers.StdMap[TKey,TValue](NativeMap nativeMap, ExternalProcessMemory m)
   à Loki.Game.Inventory.Inventory..()
   à System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   à System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   à System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   à System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   à System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   à System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
   à FlaskOptimizer.Helpers.ShouldUseLifeFlask(Int32 flaskId, Single flaskThreshold)
   à FlaskOptimizer.Helpers.CheckFlaskUsage(FlaskTypes flaskType, Single flaskThreshold)
   à FlaskOptimizer.Main.OnPulse()
   à Loki.Utilities.Plugins.PluginManager.PulsePlugin(IPlugin plugin)

The strange things are :

1) I use Cached values for flasks, so the items are not retrieve from "Me" instance
2) It works for few minutes, then starts derping, maybe too intensive?

Don't have any clue of what's happening, if anyone does :) enlighten me
 
Please post some code you are working with. Memory errors are basically from data that is cached too long and is now invalid, or something be used outside of the main bot thread the incorrect way.
 
Please post some code you are working with. Memory errors are basically from data that is cached too long and is now invalid, or something be used outside of the main bot thread the incorrect way.

The code is the same as in Exile.cs (for flasks) I just added thresholds settings instead of hardcoded ones could this be the problem?

Here is the code for the life flask for example :

Code:
// LifeFlask Logic
new Decorator(ret =>
        FlaskCd.IsFinished &&
        Me.HealthPercent < toNyxIncinerate.MyFlasksSettings.LifeFlaskThreshold &&
        LifeFlasks.Count() != 0 &&
        !Me.HasAura("flask_effect_life"),

        new Action(ret =>
                {
                        LifeFlasks.First().Use();
                        FlaskCd.Reset();
                })
),

Oh, and I moved the whole flask coding into another class, "FlasksHelper" can this interfere with the memory issue I have?

EDIT : btw, this happens in CRs too :o
 
Last edited:
Ok, seems like I found the issue, so for everyone encountering that one :

Error :

Exception while pulsing plugin FlaskHelper: System.Exception: Seule une partie d’une requête ReadProcessMemory ou WriteProcessMemory a été effectuée, at addr: 00000008, Size: 28

Reason :

It seems like it was related to some cached value, since I was using "private static Player Inv { get { return LokiPoe.PlayerInventory.Flasks.Items; } }"

Resolve :

Pretty simple, do a direct call to LokiPoe.PlayerInventory.Flasks.Items, seems to work for me

I'll edit if the problem is still here, for now (30mn) no more probs :s
 
Back
Top