ThanosSiopoudis / FMScoutFramework

A Real-Time Football Manager scout tool framework written in .NET/Mono for Windows/Linux/OS X
GNU General Public License v2.0
73 stars 26 forks source link

The Player data loaded is incorrect #35

Closed ThanosSiopoudis closed 8 years ago

ThanosSiopoudis commented 8 years ago

The player data is all messed up after the move to the single Person object. The problem is that the player data is at a negative offset relative to the Person pointer, not a positive one. The way it is now, it loads a Person's UID and RowID with the next person's data.

joshlit commented 8 years ago

I don't understand, this worked fine for me for weeks on Windows 15.3.2. For example this (78000335 is Suarez's ID)

Player player = fmCore.Players.Where(a => a.ID == 78000335).FirstOrDefault();
Console.WriteLine("ID:{0}    {1} {2} plays for {3}", player.ID, player.Firstname, player.Lastname, player.Club.Name);
Console.WriteLine("Corners: {0}, Crossing: {1}: Dribbling {2}, Finishing: {3}, First Touch: {4}", player.PlayerStats.Corners, player.PlayerStats.Crossing, player.PlayerStats.Dribbling, player.PlayerStats.Finishing, player.PlayerStats.FirstTouch);
Console.WriteLine("Value: {0:C0}   Wage: {1:C0}   Position: {2}", player.Value, player.Contract.Wage, player.PlayerStats.Position);

outputs theoutput

You're on linux right? is there a quick way I can test this out on linux?

earthslasthope commented 8 years ago

If you don't have a Linux machine then I'm afraid there is no quick way to test it out. If you have Parallels installed on your computer, perhaps you should install Ubuntu on a Virtual Machine and run football manager 2015 from Steam on it. MonoDevelop lets you compile C# code on Linux. Sorry but this is the best suggestion I can offer you right now.

ThanosSiopoudis commented 8 years ago

@joshlatimer
I'm on Mac, not Linux. I'm trying to find a way to make this work with split Persons / Players, but I had to revert it as it breaks everything on every platform except Windows.

The only way to test other platforms is a VM as @tthodarson said.

I'll re-merge your PR, but with some fixes. I'll let you know as soon as I'm done.

joshlit commented 8 years ago

I'm 90% sure that if it worked before the Person change then it should work with the Person change as long as the Version.PersonVersionOffsets.Player offset is set properly

ThanosSiopoudis commented 8 years ago

I didn't say your changes don't work on Windows, I tested before merging. The problem is with the rest OS'es. Like I said, I'm modifying your changes and will re-merge.