0

So the project is an online MMO. It uses the uMMORPG2D asset (which in turn uses UNET).

The code in question has been working fine for the last week without incident, and hasn't been modified in any way in that time at all. However now it suddenly is throwing this error. I'm at a loss.

To complicate matters further, on my own build/version of the project it all runs fine. I do not get this error. However a friend who runs the exact same build/version does get this error.

The line that is claiming to be broken is extremely simple (couldn't be simpler). All it does is it sets one integer equal to another....the only potential problem is the integer being set is a [SyncVar] (but again, this has been the case for the last week+)

Below is the relevant code;

[SyncVar]
internal int mainID = 0;

public void SetIndices(int bodyIndex, [...])
{
    mainID = bodyIndex;
    [...]
}

SetIndices gets called from

int bodyID = Convert.ToInt32((long)mainrow[5]);
[...]
charCreator.SetIndices(bodyID, [...]);

There is no cast exception or anything of the sort (as far as I know) so I see no reason why this would cause an error?

The actual error is

InvalidProgramException: Invalid IL code in CharacterCreator:set_NetworkmainID (int): IL_0011: call
0x2b00000a

NeoKuro
  • 457
  • 1
  • 5
  • 21

1 Answers1

0

Whilst I'm not exactly certain as to the actual cause of the problem, the solution was to reinstall Unity.

I was advised by team members to implement HLAPI Pro plugin for Unity (which involved replacing Unity.dll files in the installation directory). I was told that an incorrect installation would result in many errors (which no one had) so assumed it worked fine.

After significant testing, the only difference between when it was working, and when the error started to show was the HLAPI Pro installation. So I uninstalled it and it was working fine.

Don't know why it broke, perhaps I installed it incorrectly, but reinstalling Unity resolved the issue.

NeoKuro
  • 457
  • 1
  • 5
  • 21