FMScoutFramework
FMScoutFramework copied to clipboard
System.ArgumentOutOfRangeException was unhandled by user code
Hi,
I'd used this framework when it was originally released, and come across some work I'd done in 2009 on an old hard drive....so pleased to see the framework is still being developed!
I read through the readme to try make this work with FM 2015 (v15.3.2) however I'm experiencing an error when just having a button to load data on a form.
Using visual studio 2015 Ent.
System.ArgumentOutOfRangeException was unhandled by user code
HResult=-2146233086
Message=Non-negative number required.
Parameter name: capacity
ParamName=capacity
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1..ctor(Int32 capacity)
at FMScoutFramework.Core.Managers.ObjectManager.GetMemoryAddresses(Int32 firstAddress, Int32 numberOfObjects) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 261
at FMScoutFramework.Core.Managers.ObjectManager.GetMemoryAddresses(Expression`1 baseObjectPointer, Func`2 compiledObjectPointer) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 248
at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjectRealtime[T](Expression`1 baseObjectPointer, Func`2 compiledObjectPointer, List`1 memoryAddresses) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 184
at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjects[T](Expression`1 baseObjectPointer, Func`2 compiledObjectPointer, List`1 memoryAddresses) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 178
at FMScoutFramework.Core.Managers.ObjectManager.RetrieveObjects[T](Expression`1 baseObjectAddress, Func`2 compiledObjectPointer) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 164
at FMScoutFramework.Core.Managers.ObjectManager.Load(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\VirtualMemory\Managers\ObjectManager.cs:line 49
at FMScoutFramework.Core.FMCore.LoadDataForCheckedGame(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 73
at FMScoutFramework.Core.FMCore.LoadData(Boolean refreshPersonCache) in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 53
at FMScoutFramework.Core.FMCore.LoadData() in C:\Users\X\Source\Repos\FMScoutFramework\FMCore.cs:line 47
at FMScoutiee.Form1.<loadData_Click>b__2_0() in C:\Users\X\Documents\Visual Studio 2015\Projects\FMScoutiee\FMScoutiee\Form1.cs:line 29
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
InnerException:
What operating system please? Is this for Windows? I'll also need to see the code that handles the button click and loading call to the framework
Windows
Currently just a form with a button on it.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
using FMScoutFramework.Core;
using FMScoutFramework.Core.Entities.InGame;
using System.Diagnostics;
namespace FMScoutiee
{
public partial class Form1 : Form
{
public FMCore fmCore = new FMCore(FMScoutFramework.Core.Entities.DatabaseModeEnum.Realtime);
public Form1()
{
InitializeComponent();
}
private void loadData_Click(object sender, EventArgs e)
{
fmCore.GameLoaded += new Action(GameLoaded);
new Action(() => fmCore.LoadData()).BeginInvoke((s) => { }, null);
}
public void GameLoaded()
{
Debug.WriteLine("Load Done");
}
}
}
Any idea ThanosSiopoudis?
@SeeInSeeOut it is most likely an incompatibility in the framework with the version you are using. Is it from Steam?
Yes its from Steam.
15.3.2 627042 (m.e v1555)