Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

MissingMethodException when booting headless server

Discussion in 'FPS.Sample Game' started by charles_xl, Dec 2, 2018.

  1. charles_xl

    charles_xl

    Joined:
    Oct 4, 2016
    Posts:
    36
    I am porting over the server code from the FPSSample into my own project and running into the error
    `EXCEPTION Constructor on type 'HandleReplicatedEntityDataSpawn' not found.`
    when booting the server. I'm on Unity 2018.3b11 (which may be the issue) and Unity.Entities version 0.0.12-preview 12 (same as FPSSample).

    This is the full stack:

    Code (CSharp):
    1. 2: EXCEPTION Constructor on type 'HandleReplicatedEntityDataSpawn' not found.
    2.   at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00213] in <ac823e2bb42b41bda67924a45a0173c3>:0
    3.   at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00095] in <ac823e2bb42b41bda67924a45a0173c3>:0
    4.   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <ac823e2bb42b41bda67924a45a0173c3>:0
    5.   at Unity.Entities.World.CreateManagerInternal (System.Type type, System.Int32 capacity, System.Object[] constructorArguments) [0x0001e] in <2c2a4c92a7b94ced844f3846763cc263>:0
    6.   at Unity.Entities.World.CreateManager[T] (System.Object[] constructorArgumnents) [0x0001b] in <2c2a4c92a7b94ced844f3846763cc263>:0
    7.   at ReplicatedEntityModuleServer..ctor (GameWorld world, NetworkServer network) [0x000a7] in <d699f3885be94d1c831eb067dce77a1a>:0
    8.   at ServerGameWorld..ctor (GameWorld world, NetworkServer networkServer, System.Collections.Generic.Dictionary`2[TKey,TValue] clients) [0x0002c] in <d699f3885be94d1c831eb067dce77a1a>:0
    9.   at ServerGameLoop.EnterActiveState () [0x00019] in <d699f3885be94d1c831eb067dce77a1a>:0
    10.   at StateMachine`1[T].SwitchTo (T state) [0x000f3] in <d699f3885be94d1c831eb067dce77a1a>:0
    11.   at ServerGameLoop.UpdateLoadingState () [0x00000] in <d699f3885be94d1c831eb067dce77a1a>:0
    12.   at StateMachine`1[T].Update () [0x00000] in <d699f3885be94d1c831eb067dce77a1a>:0
    13.   at ServerGameLoop.Update () [0x000d7] in <d699f3885be94d1c831eb067dce77a1a>:0
    14.   at Game.Update () [0x000ec] in <d699f3885be94d1c831eb067dce77a1a>:0
    15. 2: MissingMethodException: Constructor on type 'HandleReplicatedEntityDataSpawn' not found.
    Any ideas as to what could be going on? It could be the Unity mismatch but I'm hoping not, it's a pita to downgrade a project.
     
    Last edited: Dec 2, 2018
  2. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    165
    Hello Charles,

    Since you are adding this to an existing project, Its hard to know what dependencies made it over in your merge correctly for the new systems found in FPS Sample.

    Are you running ECS to support FPS Samples implementation of it? Did you pull out any UNET stuff to replace with the FPS Samples new networking methods? All of these delicate situations, could throw a small errors.

    HandleReplicatedEntityDataSpawn sounds to me, like the replicated entity item tracked by the network updates, and that the constructor that generates these items is being poorly referenced (maybe not imported over, or the script didn't make it.)

    But I am guessing here, Good Luck.
    Micah
     
  3. charles_xl

    charles_xl

    Joined:
    Oct 4, 2016
    Posts:
    36
    Thanks for the response! Yeah I think I just need to dig more as I've truncated a decent amount of code. I did carry over the ECS implementation but I omitted the
    BundledResourceManager
    , I think that could be why as it is heavily used throughout the project and for setting up the server module itself.