Cin-cout Posted December 6, 2008 Share Posted December 6, 2008 thanks DrBIf I had IEnumerable<Player> filter = fmDataContext.Players; if (!string.IsNullOrEmpty(pNationalityCombo.Text)) { filter = filter.Where(p=>p.Nationality.Name == pNationalityCombo.Text); } if (!string.IsNullOrEmpty(continentSearchCombo.Text)) { filter = filter.Where(p => p.Nationality.Continent.Name == continentSearchCombo.Text); } filter = filter.Where(p => p.Age >= minAge.Value); filter = filter.Where(p => p.Age <= maxAge.Value); filter = filter.Where(p => p.CurrentPlayingAbility >= caMin.Value); filter = filter.Where(p => p.CurrentPlayingAbility <= caMax.Value); filter = filter.Where(p => p.PotentialPlayingAbility >= paMin.Value); filter = filter.Where(p => p.PotentialPlayingAbility <= paMax.Value); filter = filter.Where(p => p.Value >= minValue.Value); filter = filter.Where(p => p.Value <= maxValue.Value); filter = filter.Where(p => p.SaleValue >= minSaleValue.Value); filter = filter.Where(p => p.SaleValue <= maxSaleValue.Value); Can I then LINQ query filter ... var searchquery = from p in filter select { Name = p.Name } ??? I'm having trouble with this, whenever I select nothing but the age filter, for instance setting the max age to 20, it returns an error.... System.ArgumentOutOfRangeException was unhandled Message="Year, Month, and Day parameters describe an un-representable DateTime." Source="mscorlib" StackTrace: at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) at System.DateTime..ctor(Int32 year, Int32 month, Int32 day) at Young3.FMSearch.Business.Converters.DateConverter.FromFmDateTime(Int32 date) in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Converters\DateConverter.cs:line 14 at Young3.FMSearch.Business.Managers.ProcessManager.ReadDateTime(Int32 address) in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Managers\ProcessManager.cs:line 84 at Young3.FMSearch.Business.Entities.InGame.Player.get_DateOfBirth() in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Entities\InGame\Player.cs:line 223 at Young3.FMSearch.Business.Entities.InGame.Player.get_Age() in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Entities\InGame\Player.cs:line 356 at WindowsFormsApplication1.Form1.<button1_Click>b__10(Player p) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 288 at System.Linq.Enumerable.<>c__DisplayClassf`1.<CombinePredicates>b__e(TSource x) at System.Linq.Enumerable.<>c__DisplayClassf`1.<CombinePredicates>b__e(TSource x) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at WindowsFormsApplication1.Form1.LINQToDataTable[T](IEnumerable`1 varlist) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 31 at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 316 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 19 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: I know that p.Age is returning a players age which is numeric so I'm not sure why it wont allow the filter Link to post Share on other sites More sharing options...
immuner Posted December 6, 2008 Share Posted December 6, 2008 I've noticed that sometimes when you query a DateTime it throws this error because some other parameters have been extracted wrong. For example mine was crashing on a player that had no name. Anyways, put that and it will stop throwing the exception and you see which players cause the error. This way you also avoid the exception try catch which causes an extreme slowdown. ushort year = (ushort)(((date & 0xff00) >> 8) + ((date & 0xff) << 8)); ushort num2 = (ushort)(Math.Abs((long)((date & 0xff000000L) >> 0x18)) + ((date & 0xff0000) >> 8)); if (year == 0) year = 1999; DateTime time = new DateTime(year, 1, 1); return time.AddDays((double)num2); P.S. Not all appearance bonuses come out right. P.S.2. Any fix for the stadiums? They are extracted alright, but you cant see them through the team.stadium. Link to post Share on other sites More sharing options...
Cin-cout Posted December 6, 2008 Share Posted December 6, 2008 where would I put that immuner? by the way did you come up with a way of double clicking a player and loading the stats in a seperate form? I havent actually used your program but thought I seen you had a problem with this a couple of weeks ago? Link to post Share on other sites More sharing options...
immuner Posted December 6, 2008 Share Posted December 6, 2008 no no ive done that. i didnt have a problem with that, as far as i remember must have been something similar you put that in the DateConverter.cs . im actually not using linq since i dont have the same select function per search. i could but i dont know how to write my own select or where . I saw you overriding the where function nicely. do you know how to do that with select? I was thinking of changing to linq if possible to speed up my search but i dont know if it will actually speed it up at all cause they also do a foreach to search. I've used C# only for this tool and my main languages are C++/Java so i might easily be doing something stupid. Link to post Share on other sites More sharing options...
Helder Luiz Posted December 6, 2008 Share Posted December 6, 2008 Correct, is a known bug. You can see the current bug list on the google project page. The memory address is wrong in the source code. The right memory address to the clubs is 176, not 204!!!! I don't know if I'm totally right, but the country's name and capital are being show now! Link to post Share on other sites More sharing options...
immuner Posted December 7, 2008 Share Posted December 7, 2008 Another fix i found is the following public string Name { get { return ProcessManager.ReadString(MemoryAddress + ClubOffsets.Name, null); } } gives you the stadiums names when looking through a team. Seems teams are not right though. I get algeria about 4 or 5 times. Plus the ClubStatus is wrong. Seems to be 0 or 1 for all clubs and another number for all national teams. And 0 or 1 is not the club status (professional or not) because in the game albania gives me 0 and Wigan gives me 1 and they are both professional (or the other way around ). Tried int16, int32 also but seems the address is wrong. Another bug i found is that for national teams there is no country. The national team name is under club name while for clubs you can get the country status. Link to post Share on other sites More sharing options...
goldorakiller Posted December 7, 2008 Share Posted December 7, 2008 Can we have prefered moves ? Link to post Share on other sites More sharing options...
neevesc Posted December 7, 2008 Share Posted December 7, 2008 I've noticed that sometimes when you query a DateTime it throws this error because some other parameters have been extracted wrong. For example mine was crashing on a player that had no name.Anyways, put that and it will stop throwing the exception and you see which players cause the error. This way you also avoid the exception try catch which causes an extreme slowdown. ushort year = (ushort)(((date & 0xff00) >> 8) + ((date & 0xff) << 8)); ushort num2 = (ushort)(Math.Abs((long)((date & 0xff000000L) >> 0x18)) + ((date & 0xff0000) >> 8)); if (year == 0) year = 1999; DateTime time = new DateTime(year, 1, 1); return time.AddDays((double)num2); P.S. Not all appearance bonuses come out right. P.S.2. Any fix for the stadiums? They are extracted alright, but you cant see them through the team.stadium. I have found a problem when converting a date in the early part of the year, as one of the byte values had a 0, and I would get an arithmatic overflow exception. The following VB code works for me (i am converting the c# code to VB): Public Function ReadDateTime(ByVal address As Integer) As DateTime Dim buffer As Byte() = ReadProcessMemory(address, 4) 'Return Converters.DateConverter.FromFmDateTime(((buffer(3) + (buffer(2) * &H100)) + (buffer(1) * &H10000)) + (buffer(0) * &H1000000)) Return Converters.DateConverter.GetDate(buffer(0), buffer(1), buffer(2), buffer(3)) End Function Public Function GetDate(ByVal Days2 As Integer, ByVal Days1 As Integer, ByVal Year2 As Integer, ByVal Year1 As Integer) As DateTime 'set the default variables value Dim uiYear1 As UInteger = 0 Dim uiYear2 As UInteger = 0 Dim uiDay1 As UInteger = 0 Dim uiDay2 As UInteger = 0 Dim uiYear As UInteger = 0 Dim uiDays As UInteger = 0 Try ' Set variables uiYear1 = Convert.ToUInt32(Year1) uiYear2 = Convert.ToUInt32(Year2) uiDay1 = Convert.ToUInt32(Days1) uiDay2 = Convert.ToUInt32(Days2) Catch exception As OverflowException ' Show overflow message and return 'TextBox2.Text = "Overflow" Exit Function End Try ' We need to convert our integers into HEX values for days into year and the year it's self, ' as this is how the game stores these vlues in memory. Dim sYearHEX As String = [string].Format("{0:x2}", uiYear1) & [string].Format("{0:x2}", uiYear2).ToUpper Dim sDaysHEX As String = [string].Format("{0:x2}", uiDay1) & [string].Format("{0:x2}", uiDay2).ToUpper ' Now we Convert HEX values to Integer uiYear = Convert.ToUInt32(sYearHEX, 16) ' Year uiDays = Convert.ToUInt32(sDaysHEX, 16) ' Days into Year Dim TempDate As New Date(uiYear, 1, 1) ' Declare a NEW Date using Year. Dim dtmDate As Date ' Date Variable dtmDate = TempDate.AddDays(uiDays) ' Add the Days into year to the date giving the correct Date. Return dtmDate ' Return date. End Function Link to post Share on other sites More sharing options...
Undergroundfc.com Posted December 7, 2008 Share Posted December 7, 2008 DrBernhard, if a new FM patch comes out, what do we need exactly to make our editors work with the future version? New Assembly DLL files? also can anyone help.. currently if i search for Kaka on my editor, he doesnt appear. if i type Kaká <--- with á (special character) then he will appear.. so anyone know how to change á into a when searching? sorry for such a beginner question.. somehow this wasnt taught in school Link to post Share on other sites More sharing options...
chapperzUK Posted December 7, 2008 Share Posted December 7, 2008 That is amazing! Could you tell me how to show info like Current Ability, Potential Ability, Attributes, Value, Sell Value etc. Thanks! Link to post Share on other sites More sharing options...
DrBernhard Posted December 7, 2008 Author Share Posted December 7, 2008 DrBernhard, if a new FM patch comes out, what do we need exactly to make our editors work with the future version?New Assembly DLL files? also can anyone help.. currently if i search for Kaka on my editor, he doesnt appear. if i type Kaká <--- with á (special character) then he will appear.. so anyone know how to change á into a when searching? sorry for such a beginner question.. somehow this wasnt taught in school Best way would be creating a small function like: public String GetRidOfStupidCharactersInName(string input) { string output = input; output = output.replace("á", "a"); output = output.replace("à", a"); etc. } Then do in your compare something like: var results = from p in fmDataContext.Players where GetRidOfStupidCharactersInName(p.ToString()) == "Kaka" select p; Link to post Share on other sites More sharing options...
DrBernhard Posted December 7, 2008 Author Share Posted December 7, 2008 That is amazing! Could you tell me how to show info like Current Ability, Potential Ability, Attributes, Value, Sell Value etc. Thanks! Download sample app and look at the source. Or better; read a book about programming. Link to post Share on other sites More sharing options...
DrBernhard Posted December 7, 2008 Author Share Posted December 7, 2008 First of all, thanks guys for the feedback and the solvation of the bugs :-) will throw an update and some bug fixxes within the next few days DrBernhard, if a new FM patch comes out, what do we need exactly to make our editors work with the future version?New Assembly DLL files? Correct. Updating assembly will directly let your app work with new patch. Link to post Share on other sites More sharing options...
goldorakiller Posted December 7, 2008 Share Posted December 7, 2008 Does prefered moves avalaible ? Link to post Share on other sites More sharing options...
immuner Posted December 7, 2008 Share Posted December 7, 2008 A very important issue is the ability to detect not only if an fm process is running but if it has loaded a save game. the problem is that if i try to load the fmDataContext while fm is running but not a savegame then it gets initialized and if you try to load a saved game and load fmDataContext again nothing happens and you need to close the application (your scout, editor) and load it again. That is because of the static declaration of the ObjectManager and ProcessManager where, as static, cannot be disposed. And since there is no delete keyword in C#, I've no idea how to do that. DrBernhard? plus the Dispose, should contain public void Dispose() { Countries = null; Players = null; Clubs = null; Teams = null; Continents = null; Cities = null; Stadiums = null; NonPlayingStaff = null; } there is another small memory leak somewhere but i havent managed to find where. also the Reload function should be exposed to the Interface as public void Reload() { ObjectManager.Reload(); } and it should also contain stadiums and staff as there is always the case a player might retire and start a coaching career or a chairman decides to build a new stadium. Rare cases, but they exist. public static void Reload() { Players.Clear(); Teams.Clear(); Clubs.Clear(); Stadiums.Clear(); NonPlayingStaff.Clear(); Players = RetrieveObjects<Player>(MemoryAddresses.Player); Teams = RetrieveObjects<Team>(MemoryAddresses.Team); Clubs = RetrieveObjects<Club>(MemoryAddresses.Club); Stadiums = RetrieveObjects<Stadium>(MemoryAddresses.Stadium); NonPlayingStaff = LoadNonPlayingStaff(); } Finally number of teams is wrong. Too many teams are coming out twice and other with wrong data. Maybe offset? Link to post Share on other sites More sharing options...
chapperzUK Posted December 8, 2008 Share Posted December 8, 2008 Download sample app and look at the source.Or better; read a book about programming. Thanks! I am just starting programming and have been doing a course for a few months now. Can anyone recommend any books? Would be much appreciated Link to post Share on other sites More sharing options...
Puzzle Posted December 8, 2008 Share Posted December 8, 2008 My bad i should have read the entire thread. Trying to combine, FMM and Genie Scout into 1 application BTW has anyone found a solution to see generated players in the scout yet? I just bought a player which is 15 but he doesn't show up when i search for 0 to 16 year olds. Link to post Share on other sites More sharing options...
immuner Posted December 8, 2008 Share Posted December 8, 2008 its a bug. ive posted a hack solution above until we get updated dll's make sure you check if a player's name is empty first. not all are read properly. Link to post Share on other sites More sharing options...
Puzzle Posted December 9, 2008 Share Posted December 9, 2008 I can't Find Kaka. I wanted to test my code but kaka aint on there Anyways i made a RemoveFunkyChar function thingy. I'll share it with you guys. public String RemoveWeirdChars(string input) { string output = input; output = output.Replace("À", "A"); output = output.Replace("Á", "A"); output = output.Replace("Â", "A"); output = output.Replace("Ã", "A"); output = output.Replace("Ä", "A"); output = output.Replace("Å", "A"); output = output.Replace("à", "a"); output = output.Replace("á", "a"); output = output.Replace("â", "a"); output = output.Replace("ã", "a"); output = output.Replace("å", "a"); output = output.Replace("ä", "a"); output = output.Replace("Æ", "AE"); output = output.Replace("æ", "ae"); output = output.Replace("ß", "B"); output = output.Replace("Ç", "C"); output = output.Replace("¢", "c"); output = output.Replace("ç", "c"); output = output.Replace("ð", "d"); output = output.Replace("Ð", "D"); output = output.Replace("È", "E"); output = output.Replace("É", "E"); output = output.Replace("Ê", "E"); output = output.Replace("Ë", "E"); output = output.Replace("è", "e"); output = output.Replace("é", "e"); output = output.Replace("ê", "e"); output = output.Replace("ë", "e"); output = output.Replace("§", "S"); output = output.Replace("Š", "S"); output = output.Replace("Ì", "I"); output = output.Replace("Í", "I"); output = output.Replace("Î", "I"); output = output.Replace("Ï", "I"); output = output.Replace("ì", "i"); output = output.Replace("í", "i"); output = output.Replace("î", "i"); output = output.Replace("ï", "i"); output = output.Replace("Ñ", "N"); output = output.Replace("ñ", "n"); output = output.Replace("Ò", "O"); output = output.Replace("Ó", "O"); output = output.Replace("Ô", "O"); output = output.Replace("Õ", "O"); output = output.Replace("Ö", "O"); output = output.Replace("Ø", "O"); output = output.Replace("ò", "o"); output = output.Replace("ó", "o"); output = output.Replace("ô", "o"); output = output.Replace("õ", "o"); output = output.Replace("ö", "o"); output = output.Replace("ø", "o"); output = output.Replace("Ù", "U"); output = output.Replace("Ú", "U"); output = output.Replace("Û", "U"); output = output.Replace("Ü", "U"); output = output.Replace("ù", "u"); output = output.Replace("ú", "u"); output = output.Replace("û", "u"); output = output.Replace("ü", "u"); output = output.Replace("µ", "u"); output = output.Replace("ý", "y"); output = output.Replace("Ý", "y"); output = output.Replace("Ÿ", "y"); output = output.Replace("ÿ", "y"); output = output.Replace("Ž", "Z"); output = output.Replace("ž", "z"); return output; } But can anyone tell me why i can't see Kaká this is my code private void btnSearch_Click(object sender, EventArgs e) { IEnumerable<Player> filter = fmDataContext.Players; if (!string.IsNullOrEmpty(txtNation.Text)) { filter = filter.Where(p => RemoveWeirdChars(p.Nationality.Name.ToString()).Contains(txtNation.Text)); } if (!string.IsNullOrEmpty(txtClub.Text)) { filter = filter.Where(p => RemoveWeirdChars(p.Team.Club.ToString()).Contains(txtClub.Text)); } if (!string.IsNullOrEmpty(txtName.Text)) { filter = filter.Where(p => RemoveWeirdChars(p.ToString()).Contains(txtName.Text)); } filter = filter.Where(p => p.FirstName.Length > 0); filter = filter.Where(p => p.Age >= numAgeMin.Value); filter = filter.Where(p => p.Age <= numAgeMax.Value); filter = filter.Where(p => p.CurrentPlayingAbility >= numCAMin.Value); filter = filter.Where(p => p.CurrentPlayingAbility <= numCAMax.Value); filter = filter.Where(p => p.PotentialPlayingAbility >= numPAMin.Value); filter = filter.Where(p => p.PotentialPlayingAbility <= numPAMax.Value); filter = filter.Where(p => p.Value >= numValueMin.Value); filter = filter.Where(p => p.Value <= numValueMax.Value); filter = filter.Where(p => p.SaleValue >= numSaleValueMin.Value); filter = filter.Where(p => p.SaleValue <= numSaleValueMax.Value); gridPlayers.AutoGenerateColumns = true; gridPlayers.DataSource = (from p in filter select new { ID = p.ID, FirstName = p.FirstName, LastName = p.LastName, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility, Age = p.Age, Value = p.Value, SaleValue = p.SaleValue }).ToList(); } Link to post Share on other sites More sharing options...
chapperzUK Posted December 9, 2008 Share Posted December 9, 2008 Download sample app and look at the source.Or better; read a book about programming. I could not find it in the sample app. Link to post Share on other sites More sharing options...
Gesh Posted December 9, 2008 Share Posted December 9, 2008 I could not find it in the sample app. the book about programming is not in the sample app, you gotta go buy the book Link to post Share on other sites More sharing options...
chapperzUK Posted December 9, 2008 Share Posted December 9, 2008 the book about programming is not in the sample app, you gotta go buy the book haha, funny . could any please tell me. Link to post Share on other sites More sharing options...
kertiek Posted December 9, 2008 Share Posted December 9, 2008 for the search of names ...of players or teams or nations .. etc .. use REGEX ... ( regular expresions ) later when i am back home i will share the code with the use of regex .. its mutch faster and this method its done specialy for the comparison without special characters like acentuation and etc. sorry for the crappy english .. Link to post Share on other sites More sharing options...
Undergroundfc.com Posted December 9, 2008 Share Posted December 9, 2008 that would be nice kertiek! for the moment im having that prob too.. cant look for kaka or arsene wenger.. or anyone with special characters in their names Link to post Share on other sites More sharing options...
immuner Posted December 9, 2008 Share Posted December 9, 2008 regex is not always faster. benchmark is the only way to find out. Link to post Share on other sites More sharing options...
Puzzle Posted December 9, 2008 Share Posted December 9, 2008 BTW i do find players like Sámas but not Kaká so i don't think it has anything to do with the way i replace the characters. Link to post Share on other sites More sharing options...
kertiek Posted December 9, 2008 Share Posted December 9, 2008 i did a method that replaces one by one each character with special cases ... and with regex was half faster ... all this searching with 74000 players ... searching for matias fernandez ( the one from villarreal "matias fernández" ); with my method was 0.9 secs .. and with regex 0.4 ... Link to post Share on other sites More sharing options...
Puzzle Posted December 9, 2008 Share Posted December 9, 2008 Could you show me your replacement code? Link to post Share on other sites More sharing options...
DrBernhard Posted December 9, 2008 Author Share Posted December 9, 2008 Kaka is a nickname, so you have to match player.NickName instead of player.ToString() Link to post Share on other sites More sharing options...
Puzzle Posted December 10, 2008 Share Posted December 10, 2008 Good point Fixxed that and now i can find all the players by name. Still missing some Generated players though. Now to work on my Editor part. Link to post Share on other sites More sharing options...
whoismilan Posted December 10, 2008 Share Posted December 10, 2008 Thanks a bunch for this! (both for the source and for giving me an excuse to finally look into C#) Link to post Share on other sites More sharing options...
Cin-cout Posted December 11, 2008 Share Posted December 11, 2008 I'm having a problem with Age on mine.. var searchQuery = from p in filter where p.Age >= minAge.Value && p.Age <= maxAge.Value select new { ID = p.ID, Name = GetName(p), Age = p.Age, Position = GetPosition(p), Nationality = p.Nationality.Name, Club = p.Team.Club.Name, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility, Value = p.Value, SaleValue = p.SaleValue, Foot = GetFoot(p), }; Now when search between two ages, for example 16 and 21, it returns the following error.... System.ArgumentOutOfRangeException was unhandled Message="Year, Month, and Day parameters describe an un-representable DateTime." Source="mscorlib" StackTrace: at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) at System.DateTime..ctor(Int32 year, Int32 month, Int32 day) at Young3.FMSearch.Business.Converters.DateConverter.FromFmDateTime(Int32 date) in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Converters\DateConverter.cs:line 14 at Young3.FMSearch.Business.Managers.ProcessManager.ReadDateTime(Int32 address) in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Managers\ProcessManager.cs:line 84 at Young3.FMSearch.Business.Entities.InGame.Player.get_DateOfBirth() in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Entities\InGame\Player.cs:line 223 at Young3.FMSearch.Business.Entities.InGame.Player.get_Age() in D:\Visual Studio 2008\Projects\FM2009ScoutFramework_Live\Framework\Business\Entities\InGame\Player.cs:line 356 at WindowsFormsApplication1.Form1.<button1_Click>b__1d(Player p) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 344 at System.Linq.Enumerable.<>c__DisplayClassf`1.<CombinePredicates>b__e(TSource x) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at WindowsFormsApplication1.Form1.LINQToDataTable[T](IEnumerable`1 varlist) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 31 at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 360 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() in C:\Documents and Settings\Dan\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 19 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: Really not sure how to fix it :/ Link to post Share on other sites More sharing options...
immuner Posted December 11, 2008 Share Posted December 11, 2008 ive answer above on that. check for empty players names. some players are read wrong, they have no name, and their age is messed up Link to post Share on other sites More sharing options...
Cin-cout Posted December 11, 2008 Share Posted December 11, 2008 yes I tried your fix, I included the line in DateConverter.cs but it still throws up the error. Link to post Share on other sites More sharing options...
immuner Posted December 11, 2008 Share Posted December 11, 2008 hmmm ok...exception is thrown on at least one player. try to limit your searches until you find that one and when you do use the debugger to find out what is wrong with this guy.... thats how i found my errors anyways Link to post Share on other sites More sharing options...
Cin-cout Posted December 11, 2008 Share Posted December 11, 2008 is it definately on a player name? Would it not be best to just set a default name if player.ToString() = null? or something like that? I just dont know :/ Link to post Share on other sites More sharing options...
immuner Posted December 11, 2008 Share Posted December 11, 2008 im just saying that the cases this was happening to me was on players with random data. all these players had empty name. one had an age of 108!!! your case? i dunno. thats why i proposed to limit your searches and find out which player is causing this and then check whats wrong with him. Link to post Share on other sites More sharing options...
Cin-cout Posted December 11, 2008 Share Posted December 11, 2008 how would I know which player it is though if its stopping the program running? did you write the results to a log file or something? Link to post Share on other sites More sharing options...
immuner Posted December 11, 2008 Share Posted December 11, 2008 i am not using linq so i used the call stack to go back and see which player it is. you could filter your searches more or write a for loop to iterate through the players with the same filter. try that. Link to post Share on other sites More sharing options...
Cin-cout Posted December 11, 2008 Share Posted December 11, 2008 it just stalls everytime I search using an Age filter, cant get my head around it. it'll have to be one of those things I come back to, thanks immuner anyway. Link to post Share on other sites More sharing options...
neevesc Posted December 11, 2008 Share Posted December 11, 2008 I am pleased to let you know that I have finished converting DrBernHard's FM Framework from C# to VB.Net. I have added new data items and corrected a few wrong memory address offsets. The code includes an example editor, which I have not tested as yet. The code can be checked out using SVN http://code.google.com/p/fm-framework-vbnet/ Thanks goes to: DrBernHard for the hard work in creating the Framework in the first place. Developerfusion, for their C# to VB.Net conversion tool (http://www.developerfusion.com/tools/convert/csharp-to-vb/). Link to post Share on other sites More sharing options...
Puzzle Posted December 11, 2008 Share Posted December 11, 2008 neevesc how did you test the memory adresses? Link to post Share on other sites More sharing options...
Tari Posted December 11, 2008 Share Posted December 11, 2008 Working with the framework just requires the express edition! Express edition cannot edit the framework, because there are multiple projects in the solution. Got studio professional sorted. But how do you join the project on the google code thingy? Link to post Share on other sites More sharing options...
Puzzle Posted December 11, 2008 Share Posted December 11, 2008 Yeh i wanted to know that too. Link to post Share on other sites More sharing options...
neevesc Posted December 12, 2008 Share Posted December 12, 2008 neevesc how did you test the memory adresses? By using Artmoney, which is a memory HEX editor. Just search for values, that wont give too many results (Player ID, bank balance etc), then look for values that corespond to those values in game (wages, transfer budget etc), change one and see what happens !! Link to post Share on other sites More sharing options...
neevesc Posted December 12, 2008 Share Posted December 12, 2008 im just saying that the cases this was happening to me was on players with random data. all these players had empty name. one had an age of 108!!!your case? i dunno. thats why i proposed to limit your searches and find out which player is causing this and then check whats wrong with him. This could be the way that the date is calculated. I have found that this isn't 100%. Have you tried the code I posted on 07/12/2008 further up this page ? I have done some testing with various players and all of their dates come out perfect, as was not the case before. Link to post Share on other sites More sharing options...
Cin-cout Posted December 12, 2008 Share Posted December 12, 2008 I seen you code neevesc but wasnt sure how to convert it to c# Link to post Share on other sites More sharing options...
immuner Posted December 12, 2008 Share Posted December 12, 2008 This could be the way that the date is calculated. I have found that this isn't 100%.Have you tried the code I posted on 07/12/2008 further up this page ? I have done some testing with various players and all of their dates come out perfect, as was not the case before. ive seen it but i havent tried it as the way i did it causes no crashes on mine anymore. i havent tested it thoroughly though to see how many players have this problem so i am not sure whether all the players come out. i am currently working on something else but will try it for sure Link to post Share on other sites More sharing options...
neevesc Posted December 12, 2008 Share Posted December 12, 2008 I seen you code neevesc but wasnt sure how to convert it to c# Try this http://www.developerfusion.com/tools/convert/vb-to-csharp/ I have used their C# to VB converter, to convert the FM Framework. Link to post Share on other sites More sharing options...
neevesc Posted December 12, 2008 Share Posted December 12, 2008 All you need to to is copy the code and paste it into the text box on the web page, and click Convert to C#. You'll get a warning about allowing access to the clip board, which you can accept or refuse. You'll then see the code converted to C# at the top of the screen, which you can copy. Link to post Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.